Ocean
Ocean::SceneDescription::Field1D< T > Class Template Reference

This class implements all 1D fields (fields holding an array of single values). More...

Inheritance diagram for Ocean::SceneDescription::Field1D< T >:

Public Types

typedef std::vector< T > Values
 Definition of a vector holding the single values. More...
 
- 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...
 

Public Member Functions

 Field1D ()=default
 Creates a new multi value field with no value. More...
 
 Field1D (const T &value)
 Creates a new multi value field by a given initialization value. More...
 
 Field1D (const T &value, const Timestamp timestamp)
 Creates a new multi value field by a given initialization value. More...
 
 Field1D (const Values &values)
 Creates a new multi value field by given initilization values. More...
 
 Field1D (const Values &values, const Timestamp timestamp)
 Creates a new multi value field by given initilization values. 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 Valuesvalues () const
 Returns the values of this field. More...
 
Valuesvalues ()
 Returns the values of this field. More...
 
void setValues (const Values &value)
 Sets the values of this field and changes the timestamp to the current time. More...
 
void setValues (const Values &value, const Timestamp timestamp)
 Sets the values 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...
 
Fieldoperator= (const Field &field)
 Assigns a field to this field. More...
 

Static Public Attributes

static constexpr Type fieldType = TypeMapper<T>::type()
 Scalar type of this multi field. More...
 
static constexpr unsigned int fieldDimension = 1u
 Dimension of this multi field. More...
 

Protected Member Functions

Fieldcopy () 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

Values values_
 Field values. More...
 
- Protected Attributes inherited from Ocean::SceneDescription::Field
Timestamp timestamp_
 Field timestamp. More...
 

Additional Inherited Members

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

Detailed Description

template<typename T>
class Ocean::SceneDescription::Field1D< T >

This class implements all 1D fields (fields holding an array of single values).

Member Typedef Documentation

◆ Values

template<typename T >
typedef std::vector<T> Ocean::SceneDescription::Field1D< T >::Values

Definition of a vector holding the single values.

Constructor & Destructor Documentation

◆ Field1D() [1/5]

template<typename T >
Ocean::SceneDescription::Field1D< T >::Field1D ( )
default

Creates a new multi value field with no value.

◆ Field1D() [2/5]

template<typename T >
Ocean::SceneDescription::Field1D< T >::Field1D ( const T &  value)
inline

Creates a new multi value field by a given initialization value.

The modification timestamp will be set to zero.

Parameters
valueInitialization value

◆ Field1D() [3/5]

template<typename T >
Ocean::SceneDescription::Field1D< T >::Field1D ( const T &  value,
const Timestamp  timestamp 
)
inline

Creates a new multi value field by a given initialization value.

Parameters
valueInitialization value
timestampExplicit field timestamp

◆ Field1D() [4/5]

template<typename T >
Ocean::SceneDescription::Field1D< T >::Field1D ( const Values values)
inline

Creates a new multi value field by given initilization values.

The modification timestamp will be set to zero.

Parameters
valuesInitialization values

◆ Field1D() [5/5]

template<typename T >
Ocean::SceneDescription::Field1D< T >::Field1D ( const Values values,
const Timestamp  timestamp 
)
inline

Creates a new multi value field by given initilization values.

Parameters
valuesInitialization values
timestampExplicit field timestamp

Member Function Documentation

◆ assign()

template<typename T >
bool Ocean::SceneDescription::Field1D< T >::assign ( const Field field)
overridevirtual

Assigns a field to this field if both field have the identical field type.

See also
Field::assignField().

Implements Ocean::SceneDescription::Field.

◆ copy()

template<typename T >
Field * Ocean::SceneDescription::Field1D< T >::copy
overrideprotectedvirtual

Returns a new instance of this field.

See also
Field::copy().

Implements Ocean::SceneDescription::Field.

◆ dimension()

template<typename T >
unsigned int Ocean::SceneDescription::Field1D< T >::dimension
overridevirtual

Returns the dimension of this field.

See also
Field::dimension().

Implements Ocean::SceneDescription::Field.

◆ setValues() [1/2]

template<typename T >
void Ocean::SceneDescription::Field1D< T >::setValues ( const Values value)
inline

Sets the values of this field and changes the timestamp to the current time.

Parameters
valueValues to set

◆ setValues() [2/2]

template<typename T >
void Ocean::SceneDescription::Field1D< T >::setValues ( const Values value,
const Timestamp  timestamp 
)
inline

Sets the values of this field and defines an explicit modification timestamp.

Parameters
valueValues to set
timestampExplicit modification timestamp

◆ type()

template<typename T >
Field::Type Ocean::SceneDescription::Field1D< T >::type
overridevirtual

Returns the type of this field.

See also
Field::type().

Implements Ocean::SceneDescription::Field.

◆ values() [1/2]

template<typename T >
Field1D< T >::Values & Ocean::SceneDescription::Field1D< T >::values
inline

Returns the values of this field.

Returns
Field values

◆ values() [2/2]

template<typename T >
const Field1D< T >::Values & Ocean::SceneDescription::Field1D< T >::values
inline

Returns the values of this field.

Returns
Field values

Field Documentation

◆ fieldDimension

template<typename T >
constexpr unsigned int Ocean::SceneDescription::Field1D< T >::fieldDimension = 1u
staticconstexpr

Dimension of this multi field.

◆ fieldType

template<typename T >
constexpr Type Ocean::SceneDescription::Field1D< T >::fieldType = TypeMapper<T>::type()
staticconstexpr

Scalar type of this multi field.

◆ values_

template<typename T >
Values Ocean::SceneDescription::Field1D< T >::values_
protected

Field values.


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