SCENE C++ API  2.1.0
Public Member Functions | Friends | List of all members
LSAttributeContainer Class Reference

A general information container class which can contain attributes of different type. More...

#include <lsattributecontainer.h>

+ Inheritance diagram for LSAttributeContainer:

Public Member Functions

LSString getTypeName () const
 Gets the type name of this instance. More...
 
LSString getName () const
 Gets the name of the container. More...
 
LSResult::Result setName (LSString name)
 Sets the name of the container. More...
 
LSString getUuid () const
 Returns the unique id of the container. More...
 
LSString assignUuid ()
 Assigns a unique id to the container if the container does not not yet have a unique id. More...
 
unsigned int getNumAttributes () const
 Get the number of attributes in the container. More...
 
LSString getAttributeName (unsigned int index) const
 Get the name of an attribute in the container. More...
 
unsigned int getAttributeIndex (LSString name) const
 Get the index of an attribute in the container. More...
 
LSAttribute getAttribute (unsigned int index) const
 Get an attribute based on its index. More...
 
LSAttribute getAttribute (LSString name) const
 Get an attribute based on its name. More...
 
LSResult::Result setAttribute (unsigned int index, const LSAttribute &attribute)
 Set an attribute based on its index. More...
 
LSResult::Result setAttribute (LSString name, const LSAttribute &attribute)
 Set an attribute based on its name. More...
 
LSResult::Result addCustomAttribute (LSString name, const LSAttribute &attribute)
 Add a new custom attribute to the container. More...
 
bool removeCustomAttribute (LSString name)
 Remove a custom attribute from the container. More...
 
unsigned int getNumFields () const
 Returns the number of fields in the container. More...
 
ref_ptr< LSAttributeContainergetField (unsigned int index) const
 Returns the field at position n in the container. More...
 
ref_ptr< LSAttributeContainergetField (const LSString &name) const
 Returns the field with the given name. More...
 
LSResult::Result addField (const LSString &name, const LSString &typeName, ref_ptr< LSAttributeContainer > &fieldOut)
 Add a field to the container. More...
 
bool rmField (const LSString &name)
 Removes the field with a given name from the container. More...
 

Friends

bool operator== (const LSAttributeContainer &container1, const LSAttributeContainer &container2)
 
bool operator!= (const LSAttributeContainer &container1, const LSAttributeContainer &container2)
 

Additional Inherited Members

- Protected Member Functions inherited from LSRefType
void ref () const
 Increments the internal reference counter. More...
 
void unref () const
 Decrements the internal reference counter. More...
 

Detailed Description

A general information container class which can contain attributes of different type.

Version
SCENE API Version 2.0.0.

Member Function Documentation

◆ getTypeName()

LSString getTypeName ( ) const

Gets the type name of this instance.

For objects not known to this API version, the default type name is FallbackObject

Returns
The type name of this instance.
Version
SCENE API Version 2.0.0.

◆ getName()

LSString getName ( ) const

Gets the name of the container.

Returns
The name of the container.
Version
SCENE API Version 2.0.0.

◆ setName()

LSResult::Result setName ( LSString  name)

Sets the name of the container.

Parameters
nameThe name to be set for the container.

◆ getUuid()

LSString getUuid ( ) const

Returns the unique id of the container.

Returns
The unique id of the container or an empty string if the container does not yet have an id.
Version
SCENE API Version 2.0.0.

◆ assignUuid()

LSString assignUuid ( )

Assigns a unique id to the container if the container does not not yet have a unique id.

If a unique id is already present nothing is changed.

Returns
The unique id of the container.
Version
SCENE API Version 2.0.0.

◆ getNumAttributes()

unsigned int getNumAttributes ( ) const

Get the number of attributes in the container.

Returns
The number of attributes in the container.
Version
SCENE API Version 2.0.0.

◆ getAttributeName()

LSString getAttributeName ( unsigned int  index) const

Get the name of an attribute in the container.

Version
SCENE API Version 2.0.0.

◆ getAttributeIndex()

unsigned int getAttributeIndex ( LSString  name) const

Get the index of an attribute in the container.

Version
SCENE API Version 2.0.0.

◆ getAttribute() [1/2]

LSAttribute getAttribute ( unsigned int  index) const

Get an attribute based on its index.

Version
SCENE API Version 2.0.0.

◆ getAttribute() [2/2]

LSAttribute getAttribute ( LSString  name) const

Get an attribute based on its name.

Version
SCENE API Version 2.0.0.

◆ setAttribute() [1/2]

LSResult::Result setAttribute ( unsigned int  index,
const LSAttribute attribute 
)

Set an attribute based on its index.

Version
SCENE API Version 2.0.0.

◆ setAttribute() [2/2]

LSResult::Result setAttribute ( LSString  name,
const LSAttribute attribute 
)

Set an attribute based on its name.

Version
SCENE API Version 2.0.0.

◆ addCustomAttribute()

LSResult::Result addCustomAttribute ( LSString  name,
const LSAttribute attribute 
)

Add a new custom attribute to the container.

Version
SCENE API Version 2.0.0.

◆ removeCustomAttribute()

bool removeCustomAttribute ( LSString  name)

Remove a custom attribute from the container.

Version
SCENE API Version 2.0.0.

◆ getNumFields()

unsigned int getNumFields ( ) const

Returns the number of fields in the container.

Returns
The number of fields in the container.
Version
SCENE API Version 2.0.0.

◆ getField() [1/2]

ref_ptr<LSAttributeContainer> getField ( unsigned int  index) const

Returns the field at position n in the container.

Version
SCENE API Version 2.0.0.

◆ getField() [2/2]

ref_ptr<LSAttributeContainer> getField ( const LSString name) const

Returns the field with the given name.

Version
SCENE API Version 2.0.0.

◆ addField()

LSResult::Result addField ( const LSString name,
const LSString typeName,
ref_ptr< LSAttributeContainer > &  fieldOut 
)

Add a field to the container.

Version
SCENE API Version 2.0.0.

◆ rmField()

bool rmField ( const LSString name)

Removes the field with a given name from the container.

Version
SCENE API Version 2.0.0.

Friends And Related Function Documentation

◆ operator==

bool operator== ( const LSAttributeContainer container1,
const LSAttributeContainer container2 
)
friend
Version
SCENE API Version 2.0.0.

◆ operator!=

bool operator!= ( const LSAttributeContainer container1,
const LSAttributeContainer container2 
)
friend
Version
SCENE API Version 2.0.0.