Ocean
|
This class is the base class for all nodes able to handle fields loaded during runtime. More...
Public Member Functions | |
bool | addField (const std::string &name, const Field &field) |
Adds a new field during runtime. More... | |
unsigned int | dynamicFields () const |
Returns the number of dynamic fields. More... | |
bool | hasAnyField (const std::string &fieldName) const override |
Returns whether this node has a special standard or dynamic field. More... | |
bool | hasDynamicField (const std::string &name) const |
Returns whether this node holds a specific dynamic field. More... | |
const std::string & | dynamicFieldName (const unsigned int index) const |
Returns the name of a dynamic field by a given index. More... | |
const Field & | anyField (const std::string &fieldName) const override |
Returns the field base of a specified standard or dynamic field. More... | |
Field & | anyField (const std::string &fieldName) override |
Returns the field base of a specified standard or dynamic field. More... | |
const Field & | dynamicField (const std::string &fieldName) const |
Returns the field base of a specified dynamic field. More... | |
Field & | dynamicField (const std::string &fieldName) |
Returns the field base of a specified dynamic field. More... | |
template<typename T > | |
const T & | dynamicField (const std::string &fieldName) const |
Returns a specified dynamic field. More... | |
template<typename T > | |
T & | dynamicField (const std::string &fieldName) |
Returns a specified dynamic field. More... | |
bool | removeField (const std::string &name) |
Removes a field added during runtime. More... | |
bool | isDynamic () const override |
Returns whether this node can hold dynamic generated field. More... | |
Public Member Functions inherited from Ocean::SceneDescription::Node | |
virtual DescriptionType | descriptionType () const =0 |
Returns the scene description type of this node. More... | |
NodeId | id () const |
Returns the unique node id of this node. More... | |
const std::string & | name () const |
Returns the name of this node. More... | |
const std::string & | type () const |
Returns the type of this node. More... | |
const Field & | field (const std::string &fieldName) const |
Returns the field base of a specified (standard) field. More... | |
Field & | field (const std::string &fieldName) |
Returns the field base of a specified (standard) field. More... | |
template<typename T > | |
const T & | field (const std::string &fieldName) const |
Returns a specified (standard) field. More... | |
template<typename T > | |
T & | field (const std::string &fieldName) |
Returns a specified (standard) field. More... | |
template<typename T > | |
const T & | anyField (const std::string &fieldName) const |
Returns a specified standard or dynamic field. More... | |
template<typename T > | |
T & | anyField (const std::string &fieldName) |
Returns a specified standard or dynamic field. More... | |
FieldAccessType | fieldAccessType (const std::string &fieldName) const |
Returns the access type of a specified field. More... | |
virtual void | setName (const std::string &name) |
Sets the name of this node. More... | |
bool | hasField (const std::string &fieldName) const |
Returns whether this node has a special (standard) field. More... | |
virtual std::string | originalFieldName (const std::string &fieldName) const |
Tries to translate an alias field name to the original field name. More... | |
Field::Type | fieldType (const std::string &fieldName) const |
Returns the type of a special field. More... | |
unsigned int | fieldDimension (const std::string &fieldName) const |
Return the dimension of a special field. More... | |
Protected Types | |
typedef std::vector< Field * > | DynamicFields |
Definition of a vector holding fields. More... | |
typedef std::unordered_map< std::string, unsigned int > | DynamicFieldIndices |
Definition of a map mapping field names to field indices. More... | |
Protected Types inherited from Ocean::SceneDescription::Node | |
typedef std::map< std::string, Field * > | FieldMap |
Definition of a map mapping field names to fields. More... | |
Protected Member Functions | |
DynamicNode () | |
Creates a new dynamic node object. More... | |
~DynamicNode () override | |
Destructs a dynamic node object. More... | |
Protected Member Functions inherited from Ocean::SceneDescription::Node | |
Node () | |
Creates a new node. More... | |
Node (const Node &node)=delete | |
Disabled copy constructor. More... | |
virtual | ~Node () |
Destructs a node. More... | |
virtual size_t | objectAddress () const |
Returns the address of the most derived object. More... | |
void | registerField (NodeSpecification &specification, const std::string &fieldName, const Field &field, const FieldAccessType accessType=ACCESS_GET_SET) |
Registers a new field to a specified node type. More... | |
Node & | operator= (const Node &node)=delete |
Disabled copy operator. More... | |
Protected Attributes | |
DynamicFields | dynamicFields_ |
Vector holding the dynamic fields. More... | |
DynamicFieldIndices | dynamicFieldIndices_ |
Map mapping names of dynamic fields to indices. More... | |
Protected Attributes inherited from Ocean::SceneDescription::Node | |
NodeId | nodeId_ |
Unique node id. More... | |
std::string | name_ |
Node name. More... | |
NodeSpecification * | specification_ = nullptr |
Pointer to the node specification, guaranteed to exist as long as the node exist. More... | |
Additional Inherited Members | |
Public Types inherited from Ocean::SceneDescription::Node | |
enum | FieldAccessType { ACCESS_NONE = 0 , ACCESS_GET = 1 , ACCESS_SET = 2 , ACCESS_GET_SET = ACCESS_GET | ACCESS_SET , ACCESS_EXPLICIT_NOTIFICATION = 4 } |
Definition of different field access types. More... | |
Static Protected Member Functions inherited from Ocean::SceneDescription::Node | |
static Lock & | nodeIdCounterLock () |
Returns the lock for the node id counter. More... | |
Static Protected Attributes inherited from Ocean::SceneDescription::Node | |
static NodeId | nodeIdCounter_ |
Unique node id counter. More... | |
This class is the base class for all nodes able to handle fields loaded during runtime.
|
protected |
Definition of a map mapping field names to field indices.
|
protected |
Definition of a vector holding fields.
|
protected |
Creates a new dynamic node object.
|
overrideprotected |
Destructs a dynamic node object.
bool Ocean::SceneDescription::DynamicNode::addField | ( | const std::string & | name, |
const Field & | field | ||
) |
Adds a new field during runtime.
name | The name of the node |
field | Field to add |
|
overridevirtual |
Returns the field base of a specified standard or dynamic field.
Reimplemented from Ocean::SceneDescription::Node.
|
overridevirtual |
Returns the field base of a specified standard or dynamic field.
Reimplemented from Ocean::SceneDescription::Node.
Field& Ocean::SceneDescription::DynamicNode::dynamicField | ( | const std::string & | fieldName | ) |
Returns the field base of a specified dynamic field.
Beware: Changing a field value using this function will not produce any field changing event functions!
fieldName | Name of the dynamic field to return |
T & Ocean::SceneDescription::DynamicNode::dynamicField | ( | const std::string & | fieldName | ) |
Returns a specified dynamic field.
Beware: Changing a field value using this function will not produce any field changing event functions!
fieldName | Name of the dynamic field to return |
const Field& Ocean::SceneDescription::DynamicNode::dynamicField | ( | const std::string & | fieldName | ) | const |
Returns the field base of a specified dynamic field.
fieldName | Name of the dynamic field to return |
const T & Ocean::SceneDescription::DynamicNode::dynamicField | ( | const std::string & | fieldName | ) | const |
Returns a specified dynamic field.
fieldName | Name of the dynamic field to return |
const std::string& Ocean::SceneDescription::DynamicNode::dynamicFieldName | ( | const unsigned int | index | ) | const |
Returns the name of a dynamic field by a given index.
index | Index of the dynamic field to return |
|
inline |
Returns the number of dynamic fields.
|
overridevirtual |
Returns whether this node has a special standard or dynamic field.
Reimplemented from Ocean::SceneDescription::Node.
bool Ocean::SceneDescription::DynamicNode::hasDynamicField | ( | const std::string & | name | ) | const |
Returns whether this node holds a specific dynamic field.
name | The name of the dynamic field to check |
|
overridevirtual |
Returns whether this node can hold dynamic generated field.
Reimplemented from Ocean::SceneDescription::Node.
bool Ocean::SceneDescription::DynamicNode::removeField | ( | const std::string & | name | ) |
Removes a field added during runtime.
name | The name of the field to remove |
|
protected |
Map mapping names of dynamic fields to indices.
|
protected |
Vector holding the dynamic fields.