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
class NullValue

Public Functions

inline NullValue()

Instantiate NullValue using a default type

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 void operator=(NullValue const &other)

Assign a NullValue to the value of another.

Parameters:

other[in] NullValue to assign value of

Returns:

NullValue with the new assigned value

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

inline bool operator!=(NullValue const&) const

Check whether two NullValue are unequal.

Parameters:

other[in] NullValue for comparison

Returns:

Boolean indicating equivalency

inline bool operator<(NullValue const &other) const

Check whether NullValue is less than another.

Parameters:

other[in] NullValue for comparison

Returns:

Boolean indicating equivalency

Public Members

PropertyUnderlyingType ExpectedType

Private Functions

template<typename Archive>
inline void serialize(Archive &ar, const unsigned int)

Serialize the coordinates to an archive

Parameters:
  • ar[in] Archive to serialize to

  • version[in] Version of the archive

Friends

friend class boost::serialization::access
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::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
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.