Ocean
Ocean::SceneDescription::Field Class Referenceabstract

This class is the base class for all scene description fields. More...

Inheritance diagram for Ocean::SceneDescription::Field:

Public Types

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...
 

Public Member Functions

virtual ~Field ()
 Destructs a field object. More...
 
Timestamp timestamp () const
 Returns the most recent field modification timestamp. More...
 
virtual Type type () const =0
 Returns the type of this field. More...
 
virtual unsigned int dimension () const =0
 Returns the dimension of this field. 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...
 
virtual Fieldcopy () const =0
 Returns a new instance of this field. More...
 
virtual bool assign (const Field &field)=0
 Assigns a field to this field if both field have the identical field type. More...
 
Fieldoperator= (const Field &field)
 Assigns a field to this field. More...
 

Static Public Member Functions

template<typename T >
static const T & cast (const Field &field)
 Casts an unspecific field object to the real field object. More...
 

Protected Member Functions

 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

Timestamp timestamp_
 Field timestamp. More...
 

Detailed Description

This class is the base class for all scene description fields.

Member Enumeration Documentation

◆ Type

Definition of scalar field types.

Enumerator
TYPE_INVALID 

Invalid field type.

TYPE_BOOLEAN 

Field with a boolean value.

TYPE_COLOR 

Field with a color value.

TYPE_FLOAT 

Field with a float value.

TYPE_INT 

Field with an integer value.

TYPE_MATRIX3 

Field with a 3x3 matrix as value.

TYPE_MATRIX4 

Field with a 4x4 matrix as value.

TYPE_NODE 

Field with a node as value.

TYPE_ROTATION 

Field with a rotation value.

TYPE_STRING 

Field with a string value.

TYPE_TIME 

Field with a time value.

TYPE_VECTOR2 

Field with a 2D vector as value.

TYPE_VECTOR3 

Field with a 3D vector as value.

TYPE_VECTOR4 

Field with a 4D vector as value.

Constructor & Destructor Documentation

◆ ~Field()

Ocean::SceneDescription::Field::~Field ( )
inlinevirtual

Destructs a field object.

◆ Field() [1/3]

Ocean::SceneDescription::Field::Field ( )
protecteddefault

Creates a new field.

The field timestamp will be set to invalid.

◆ Field() [2/3]

Ocean::SceneDescription::Field::Field ( const Field field)
protecteddelete

Disabled copy constructor.

Parameters
fieldObject which would be copied

◆ Field() [3/3]

Ocean::SceneDescription::Field::Field ( const Timestamp  timestamp)
inlineexplicitprotected

Creates a new field with an explicit modification timestamp.

Parameters
timestampExplicit field timestamp

Member Function Documentation

◆ assign()

◆ cast()

template<typename T >
const T & Ocean::SceneDescription::Field::cast ( const Field field)
static

Casts an unspecific field object to the real field object.

Parameters
fieldUnspecific field object
Returns
Specified field object

◆ copy()

◆ dimension()

◆ is0D()

bool Ocean::SceneDescription::Field::is0D ( ) const
inline

Returns whether this field is a 0D field.

Returns
True, if so

◆ is1D()

bool Ocean::SceneDescription::Field::is1D ( ) const
inline

Returns whether this field is a 1D field.

Returns
True, if so

◆ isType() [1/2]

bool Ocean::SceneDescription::Field::isType ( const Type  type) const
inline

Returns whether this field has a given type.

Parameters
typeType to check
Returns
True, if so

◆ isType() [2/2]

bool Ocean::SceneDescription::Field::isType ( const Type  type,
const unsigned int  dimension 
) const
inline

Returns whether this field has a given type and dimension.

Parameters
typeType to check
dimensionDimension to check
Returns
True, if so

◆ operator=()

Field & Ocean::SceneDescription::Field::operator= ( const Field field)
inline

Assigns a field to this field.

The field value and field timestamp is copied only if the field types are identical.

Parameters
fieldField to assign
Returns
Reference to this object

◆ setTimestamp()

void Ocean::SceneDescription::Field::setTimestamp ( const Timestamp  timestamp)
inline

Sets the field timestamp explicitly.

Parameters
timestampField timestamp to set

◆ timestamp()

Timestamp Ocean::SceneDescription::Field::timestamp ( ) const
inline

Returns the most recent field modification timestamp.

Returns
Field timestamp

◆ type()

Field Documentation

◆ timestamp_

Timestamp Ocean::SceneDescription::Field::timestamp_
protected

Field timestamp.


The documentation for this class was generated from the following file: