PropertyValue Module
Module Contents
Todo
compare throws errors when parsed by Breathe so documentation isn’t generated for this function.
Breathe doesn’t easily support overloaded functions utilizing doxygenfunction::, need to figure out
how to handle the manually declared overloaded functions.
-
enum tracktable::PropertyUnderlyingType
Values:
-
enumerator TYPE_UNKNOWN
-
enumerator TYPE_REAL
-
enumerator TYPE_STRING
-
enumerator TYPE_TIMESTAMP
-
enumerator TYPE_NULL
-
enumerator TYPE_UNKNOWN
-
class NullValue
Public Functions
-
inline NullValue(PropertyUnderlyingType my_type)
Instantiate NullValue with a specified value
- Parameters:
my_type – [in] Value to set as null value
-
inline NullValue(NullValue const &other)
Copy contructor, NullValue with a copy of another
- Parameters:
other – [in] NullValue to copy from
-
inline bool operator==(NullValue const&) const
Check whether one NullValue is equal to another by comparing the properties.
Two items are equal if all of their properties are equal.
- Parameters:
other – [in] NullValue for comparison
- Returns:
Boolean indicating equivalency
Public Members
-
PropertyUnderlyingType ExpectedType
Private Functions
Friends
- friend class boost::serialization::access
-
inline NullValue(PropertyUnderlyingType my_type)
-
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, andNull. If you do not initialize a variant then its type will beNull` 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::variantbut 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
-
inline PropertyValue tracktable::make_null(PropertyUnderlyingType null_type)
-
bool tracktable::is_property_null(PropertyValueT const &value)
Check whether a particular property is null.
Check to see whether a property value is null.
- Parameters:
value – [in] Property value to check
- Returns:
True/false (null or not)
- Returns:
True/false depending on whether or not the supplied value is null
-
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>
PropertyUnderlyingType tracktable::string_to_property_type(text_type const &input) Utility method: convert a string to a PropertyUnderlyingType.
-
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>
PropertyValue tracktable::to_property_variant(source_type const &source, PropertyUnderlyingType thing_type) Utility method: convert a source type (usually a string) to a PropertyValue.