Property

class Property

This class holds the data used in properties by the Atom and the Frame classes. A property can have various types: bool, double, string or Vector3D.

Public Types

enum Kind

Possible types held by a property.

Values:

enumerator BOOL
enumerator DOUBLE
enumerator STRING
enumerator VECTOR3D

Public Functions

inline Property(bool value)

Create a property holding a boolean value.

inline Property(double value)

Create a property holding a double value.

inline Property(Vector3D value)

Create a property holding a Vector3D value.

inline Property(std::string value)

Create a property holding a string value.

inline Property(const char *value)

Create a property holding a string value from a const char*.

inline Property(int value)

Create a property holding a double value from an int.

inline Property(long value)

Create a property holding a double value from a long.

inline Property(long long value)

Create a property holding a double value from a long long.

inline Property(unsigned value)

Create a property holding a double value from an unsigned.

inline Property(unsigned long value)

Create a property holding a double value from an unsigned long.

inline Property(unsigned long long value)

Create a property holding a double value from an unsigned long long.

inline Kind kind() const

Get the kind of property, i.e. the type of the held value

bool as_bool() const

Get the boolean value stored in this Property

Throws:

PropertyError – if this property does not hold a boolean value

double as_double() const

Get the double value stored in this Property

Throws:

PropertyError – if this property does not hold a double value

Vector3D as_vector3d() const

Get the Vector3D value stored in this Property

Throws:

PropertyError – if this property does not hold a Vector3D value

const std::string &as_string() const

Get the string value stored in this Property

Throws:

PropertyError – if this property does not hold a string value

Public Static Functions

static std::string kind_as_string(Kind kind)

Get the given kind name as a string.