|
TrueReality
v0.1.1912
|
This class hold custom user data. More...
#include <UserDataContainer.h>


Public Types | |
| using | BaseClass = trBase::Base |
Public Types inherited from trBase::Base | |
| using | BaseClass = trBase::SmrtClass |
Public Types inherited from trBase::SmrtClass | |
| using | BaseClass = osg::Referenced |
Public Member Functions | |
| UserDataContainer (const std::string name=CLASS_TYPE) | |
| Holds the class type name for efficient comparisons. More... | |
| virtual const std::string & | GetType () const override |
| Returns the class type. More... | |
| virtual trBase::SmrtClass * | GetUserDataContainer () |
| Returns the user data object. More... | |
| virtual const trBase::SmrtClass * | GetUserDataContainer () const |
| Returns the user data object. More... | |
| virtual void | SetUserDataContainer (trBase::SmrtClass *data) |
| Sets the user data object. More... | |
| virtual std::vector< std::string > | GetDescriptionList () |
| Returns a list of Description strings. More... | |
| virtual const std::vector< std::string > | GetDescriptionList () const |
| Returns a list of Description strings. More... | |
| virtual int | GetDescriptionListCount () |
| Returns the number of objects stored in the Description list. More... | |
| virtual std::string | GetDescription (int index=0) |
| Returns the specified description. More... | |
| virtual const std::string | GetDescription (int index=0) const |
| Returns the specified description. More... | |
| virtual void | AddDescription (std::string description) |
| Adds a new description string to the list of descriptions. More... | |
| virtual void | SetDescriptions (std::vector< std::string > descriptions) |
| Set a new list of descriptions strings. More... | |
| virtual std::vector< trBase::SmrtPtr< trBase::Base > > | GetObjectList () |
| Returns the list of all the user objects cast down to Base class. More... | |
| virtual const std::vector< trBase::SmrtPtr< trBase::Base > > | GetObjectList () const |
| Returns the list of all the user objects cast down to Base class. More... | |
| virtual int | GetObjectListCount () |
| Returns the number of objects stored in the Object list. More... | |
| virtual trBase::SmrtPtr< trBase::Base > | GetObject (int index=0) |
| Returns the specified object. More... | |
| virtual const trBase::SmrtPtr< trBase::Base > | GetObject (int index=0) const |
| Returns the specified object. More... | |
| virtual void | AddObject (trBase::SmrtPtr< trBase::Base > obj) |
| Adds a new object to the object list. More... | |
| virtual void | SetObjects (std::vector< trBase::SmrtPtr< trBase::Base >> objList) |
| Set a new list of objects. More... | |
Public Member Functions inherited from trBase::Base | |
| Base (const std::string &name=CLASS_TYPE) | |
| Holds the class type name for efficient comparisons. More... | |
| virtual void | SetName (const std::string &name) |
| Sets this instances name. More... | |
| virtual const std::string & | GetName () |
| Returns this instances name. More... | |
| virtual const std::string & | GetName () const |
| Returns this instances name. More... | |
| virtual void | SetUUID (const trBase::UniqueId &id) |
| Overwrites the default internal UUID with the passed in one. More... | |
| virtual const trBase::UniqueId & | GetUUID (void) |
| Returns the instances Universally Unique ID. More... | |
Public Member Functions inherited from trBase::SmrtClass | |
| SmrtClass () | |
| Adds an easy and swappable access to the base class. More... | |
| SmrtClass (bool threadSafeRefUnref) | |
| Constructor. More... | |
| SmrtClass (const SmrtClass &inst) | |
| Copy constructor. More... | |
| virtual bool | GetThreadSafeRefUnref () |
| Get whether a mutex is used to ensure Ref() and UnRef() are thread safe. More... | |
| OpenThreads::Mutex * | GetRefMutex () const |
| Get the mutex used to ensure thread safety of Ref()/UnRef(). More... | |
| int | Ref () const |
| Increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
| int | Unref () const |
| Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More... | |
| int | UnRefNoDelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More... | |
| int | ReferenceCount () const |
| Return the number of pointers currently referencing this object. More... | |
Static Public Attributes | |
| static const trUtil::RefStr | CLASS_TYPE = trUtil::RefStr("trBase::UserDataContainer") |
| Adds an easy and swappable access to the base class. More... | |
Static Public Attributes inherited from trBase::Base | |
| static const trUtil::RefStr | CLASS_TYPE = trUtil::RefStr("trBase::Base") |
| Adds an easy and swappable access to the base class. More... | |
Protected Member Functions | |
| ~UserDataContainer () | |
| dtor More... | |
Protected Member Functions inherited from trBase::Base | |
| ~Base () | |
| Base destructor. More... | |
Protected Member Functions inherited from trBase::SmrtClass | |
| ~SmrtClass () | |
Protected Attributes | |
| trBase::SmrtPtr< trBase::SmrtClass > | mUserDataContainer |
| std::vector< std::string > | mDescriptionList |
| std::vector< trBase::SmrtPtr< trBase::Base > > | mObjectList |
Additional Inherited Members | |
Static Public Member Functions inherited from trBase::SmrtClass | |
| static OpenThreads::Mutex * | GetGlobalReferencedMutex () |
| Get the optional global Referenced mutex, this can be shared between all trBase::SmrtClass. More... | |
This class hold custom user data.
Since all the objects in this class can be different, it is strongly encouraged to use the Description field to note what objects are stored in the instance.
Definition at line 41 of file UserDataContainer.h.
Definition at line 45 of file UserDataContainer.h.
| trBase::UserDataContainer::UserDataContainer | ( | const std::string | name = CLASS_TYPE | ) |
Holds the class type name for efficient comparisons.
ctor
Definition at line 30 of file UserDataContainer.cpp.
|
protected |
dtor
Definition at line 35 of file UserDataContainer.cpp.
|
virtual |
Adds a new description string to the list of descriptions.
Definition at line 94 of file UserDataContainer.cpp.
References mDescriptionList.
|
virtual |
Adds a new object to the object list.
Definition at line 136 of file UserDataContainer.cpp.
References mObjectList.
|
virtual |
Returns the specified description.
Returns the first one if no index is specified
Definition at line 82 of file UserDataContainer.cpp.
References mDescriptionList.
|
virtual |
Returns the specified description.
Returns the first one if no index is specified
Definition at line 88 of file UserDataContainer.cpp.
References mDescriptionList.
|
virtual |
Returns a list of Description strings.
Definition at line 64 of file UserDataContainer.cpp.
References mDescriptionList.
|
virtual |
Returns a list of Description strings.
Definition at line 70 of file UserDataContainer.cpp.
References mDescriptionList.
|
virtual |
Returns the number of objects stored in the Description list.
Definition at line 76 of file UserDataContainer.cpp.
References mDescriptionList.
|
virtual |
Returns the specified object.
Returns the first one if no index is specified
Definition at line 124 of file UserDataContainer.cpp.
References mObjectList.
|
virtual |
Returns the specified object.
Returns the first one if no index is specified
Definition at line 130 of file UserDataContainer.cpp.
References mObjectList.
|
virtual |
Returns the list of all the user objects cast down to Base class.
Definition at line 106 of file UserDataContainer.cpp.
References mObjectList.
|
virtual |
Returns the list of all the user objects cast down to Base class.
Definition at line 112 of file UserDataContainer.cpp.
References mObjectList.
|
virtual |
Returns the number of objects stored in the Object list.
Definition at line 118 of file UserDataContainer.cpp.
References mObjectList.
|
overridevirtual |
Returns the class type.
Implements trBase::Base.
Definition at line 40 of file UserDataContainer.cpp.
References CLASS_TYPE.
|
virtual |
Returns the user data object.
Definition at line 46 of file UserDataContainer.cpp.
References mUserDataContainer.
|
virtual |
Returns the user data object.
Definition at line 52 of file UserDataContainer.cpp.
References mUserDataContainer.
|
virtual |
Set a new list of descriptions strings.
Definition at line 100 of file UserDataContainer.cpp.
References mDescriptionList.
|
virtual |
Set a new list of objects.
Definition at line 142 of file UserDataContainer.cpp.
References mObjectList.
|
virtual |
Sets the user data object.
Definition at line 58 of file UserDataContainer.cpp.
References mUserDataContainer.
|
static |
Adds an easy and swappable access to the base class.
Definition at line 47 of file UserDataContainer.h.
Referenced by GetType().
|
protected |
Definition at line 147 of file UserDataContainer.h.
Referenced by AddDescription(), GetDescription(), GetDescriptionList(), GetDescriptionListCount(), and SetDescriptions().
|
protected |
Definition at line 148 of file UserDataContainer.h.
Referenced by AddObject(), GetObject(), GetObjectList(), GetObjectListCount(), and SetObjects().
|
protected |
Definition at line 146 of file UserDataContainer.h.
Referenced by GetUserDataContainer(), and SetUserDataContainer().