PropertyValue Module¶
Module Contents¶
-
enum
tracktable
::
PropertyUnderlyingType
¶ Values:
-
TYPE_UNKNOWN
= 0¶
-
TYPE_REAL
= 1¶
-
TYPE_STRING
= 2¶
-
TYPE_TIMESTAMP
= 3¶
-
TYPE_NULL
= 4¶
-
-
class
NullValue
¶ -
Public Members
-
PropertyUnderlyingType
ExpectedType
¶
-
PropertyUnderlyingType
-
typedef boost::variant<NullValue, double, string_type, Timestamp>
tracktable
::
PropertyValue
¶ Discriminated union type for properties.
We support four data types for properties: double-precision float, string, timestamp, and Null. If you do not initialize a variant then its type will be Null by default.
Note that there is not a separate integer data type. You’ll need to use doubles for that. This is a deliberate decision: we run into compiler troubles trying to serialize and unserialize property values if we allow integers as a distinct type.
Under the hood this will probably always be a boost::variant but we will provide our own interface so that you don’t have to know or care exactly how Boost does it.
-
typedef PropertyValue
tracktable
::
PropertyValueT
¶
-
PropertyValue
tracktable
::
make_null
(PropertyUnderlyingType null_type)¶
Warning
doxygenfunction: Cannot find function “tracktable::compare ” in doxygen xml output for project “tracktable_cpp” from directory: readthedocs/doxygen/doxyxml
-
TRACKTABLE_CORE_EXPORT bool tracktable::is_property_null(PropertyValueT const & value)
Check whether a particular property is null.
Check to see whether a property value is null.
- Return
True/false (null or not)
- Return
True/false depending on whether or not the supplied value is null
- Parameters
[in] value
: Property value to check
-
TRACKTABLE_CORE_EXPORT PropertyUnderlyingType tracktable::property_underlying_type(PropertyValue const & value)
Get a property’s underlying type.
Retrieve a numeric constant that specifies the type stored in a property. This function is meant to help with serialization.
-
template<typename
text_type
>
PropertyUnderlyingTypetracktable
::
string_to_property_type
(text_type const &input)¶ Utility method: convert a string to a PropertyUnderlyingType.
-
TRACKTABLE_CORE_EXPORT tracktable::string_type tracktable::property_type_as_string(tracktable::PropertyValueT const & p)
Return a property’s data type as a string.
-
template<typename
source_type
>
PropertyValuetracktable
::
to_property_variant
(source_type const &source, PropertyUnderlyingType thing_type)¶ Utility method: convert a source type (usually a string) to a PropertyValue.