Ocean
|
This class implements all 0D fields (fields holding a single value only). More...
Public Member Functions | |
Field0D ()=default | |
Creates a new single value field with an undefined value. More... | |
Field0D (const T &value) | |
Creates a new single value field by a given initialization value. More... | |
Field0D (const T &value, const Timestamp timestamp) | |
Creates a new single value field by a given initialization value and an explicit timestamp. More... | |
Type | type () const override |
Returns the type of this field. More... | |
unsigned int | dimension () const override |
Returns the dimension of this field. More... | |
const T & | value () const |
Returns the value of this field. More... | |
void | setValue (const T &value) |
Sets the value of this field and changes the modification timestamp to the current time. More... | |
void | setValue (const T &value, const Timestamp timestamp) |
Sets the value of this field and defines an explicit modification timestamp. More... | |
bool | assign (const Field &field) override |
Assigns a field to this field if both field have the identical field type. More... | |
Public Member Functions inherited from Ocean::SceneDescription::Field | |
virtual | ~Field () |
Destructs a field object. More... | |
Timestamp | timestamp () const |
Returns the most recent field modification timestamp. More... | |
bool | is0D () const |
Returns whether this field is a 0D field. More... | |
bool | is1D () const |
Returns whether this field is a 1D field. More... | |
bool | isType (const Type type) const |
Returns whether this field has a given type. More... | |
bool | isType (const Type type, const unsigned int dimension) const |
Returns whether this field has a given type and dimension. More... | |
void | setTimestamp (const Timestamp timestamp) |
Sets the field timestamp explicitly. More... | |
Field & | operator= (const Field &field) |
Assigns a field to this field. More... | |
Static Public Attributes | |
static constexpr Type | fieldType = TypeMapper<T>::type() |
Scalar type of this single field. More... | |
static constexpr unsigned int | fieldDimension = 0u |
Dimension of this single field. More... | |
Protected Member Functions | |
Field * | copy () const override |
Returns a new instance of this field. More... | |
Protected Member Functions inherited from Ocean::SceneDescription::Field | |
Field ()=default | |
Creates a new field. More... | |
Field (const Field &field)=delete | |
Disabled copy constructor. More... | |
Field (const Timestamp timestamp) | |
Creates a new field with an explicit modification timestamp. More... | |
Protected Attributes | |
T | value_ |
Field (single) value. More... | |
Protected Attributes inherited from Ocean::SceneDescription::Field | |
Timestamp | timestamp_ |
Field timestamp. More... | |
Additional Inherited Members | |
Public Types inherited from Ocean::SceneDescription::Field | |
enum | Type : uint32_t { TYPE_INVALID = 0u , TYPE_BOOLEAN , TYPE_COLOR , TYPE_FLOAT , TYPE_INT , TYPE_MATRIX3 , TYPE_MATRIX4 , TYPE_NODE , TYPE_ROTATION , TYPE_STRING , TYPE_TIME , TYPE_VECTOR2 , TYPE_VECTOR3 , TYPE_VECTOR4 } |
Definition of scalar field types. More... | |
Static Public Member Functions inherited from Ocean::SceneDescription::Field | |
template<typename T > | |
static const T & | cast (const Field &field) |
Casts an unspecific field object to the real field object. More... | |
This class implements all 0D fields (fields holding a single value only).
|
default |
Creates a new single value field with an undefined value.
|
inline |
Creates a new single value field by a given initialization value.
The modification timestamp will be set to zero.
value | Initialization value |
|
inline |
Creates a new single value field by a given initialization value and an explicit timestamp.
value | Initialization value |
timestamp | Explicit field timestamp |
|
overridevirtual |
Assigns a field to this field if both field have the identical field type.
Implements Ocean::SceneDescription::Field.
|
overrideprotectedvirtual |
Returns a new instance of this field.
Implements Ocean::SceneDescription::Field.
|
overridevirtual |
Returns the dimension of this field.
Implements Ocean::SceneDescription::Field.
|
inline |
Sets the value of this field and changes the modification timestamp to the current time.
value | Value to set |
|
inline |
Sets the value of this field and defines an explicit modification timestamp.
value | Value to set |
timestamp | Explicit modification timestamp |
|
overridevirtual |
|
inline |
Returns the value of this field.
|
staticconstexpr |
Dimension of this single field.
|
staticconstexpr |
Scalar type of this single field.
|
protected |
Field (single) value.