|
TrueReality
v0.1.1912
|
This class creates a GUID, or a Unique ID that is used through out TR to identify and distinguish one object from another. More...
#include <UniqueId.h>


Public Types | |
| using | BaseClass = trBase::SmrtClass |
Public Types inherited from trBase::SmrtClass | |
| using | BaseClass = osg::Referenced |
Public Member Functions | |
| UniqueId (bool createNewId=true) | |
| Holds the class type name for efficient comparisons. More... | |
| UniqueId (const UniqueId &toCopy) | |
| Makes a copy of the passed in Unique ID GUID. More... | |
| UniqueId (const std::string &toCopy) | |
| Makes the Unique ID equal to the ID in the passes in string. More... | |
| virtual | ~UniqueId () |
| dtor More... | |
| virtual const std::string & | GetType () const override |
| Returns the class type. More... | |
| const std::string | ToString () const |
| Convert the current GUID into a string. More... | |
| void | FromString (const std::string &idString) |
| Assign the GUID value to this instance from a string. More... | |
| bool | IsNull () const |
| Returns true if the GUID is equal to 00000000-0000-0000-0000-000000000000. More... | |
| UniqueId & | operator= (const UniqueId &id) |
| Copy the GUID from another unique id. More... | |
| UniqueId & | operator= (const UniqueId *id) |
| Copy the GUID from another unique id. More... | |
| UniqueId & | operator= (const std::string &id) |
| Copy the GUID form a string. More... | |
| bool | operator== (const UniqueId &id) const |
| Equality operator. More... | |
| bool | operator!= (const UniqueId &id) const |
| Inequality operator. More... | |
| bool | operator< (const UniqueId &id) const |
| Less-than comparison operator. More... | |
| bool | operator> (const UniqueId &id) const |
| Greater-than comparison operator. 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::UniqueId") |
| Adds an easy and swappable access to the base class. More... | |
Protected Attributes | |
| implId * | mGUIDPtr = nullptr |
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... | |
Protected Member Functions inherited from trBase::SmrtClass | |
| ~SmrtClass () | |
This class creates a GUID, or a Unique ID that is used through out TR to identify and distinguish one object from another.
Definition at line 42 of file UniqueId.h.
Definition at line 47 of file UniqueId.h.
|
explicit |
Holds the class type name for efficient comparisons.
| createNewId | if true, generates a new id. If not, it sets the id to empty. |
Definition at line 254 of file UniqueId.cpp.
References trBase::implId::implId().

| trBase::UniqueId::UniqueId | ( | const UniqueId & | toCopy | ) |
Makes a copy of the passed in Unique ID GUID.
Definition at line 260 of file UniqueId.cpp.
References trBase::implId::GetData(), and mGUIDPtr.

|
explicit |
Makes the Unique ID equal to the ID in the passes in string.
The string should be in 00000000-0000-0000-0000-000000000000 format.
Definition at line 272 of file UniqueId.cpp.
References mGUIDPtr.
|
virtual |
| void trBase::UniqueId::FromString | ( | const std::string & | idString | ) |
Assign the GUID value to this instance from a string.
The = operator can be used to accomplish the same thing. The string should be in 00000000-0000-0000-0000-000000000000 format.
Definition at line 300 of file UniqueId.cpp.
References trBase::implId::FromString(), and mGUIDPtr.

|
overridevirtual |
Returns the class type.
Implements trBase::SmrtClass.
Definition at line 288 of file UniqueId.cpp.
References CLASS_TYPE.
| bool trBase::UniqueId::IsNull | ( | ) | const |
Returns true if the GUID is equal to 00000000-0000-0000-0000-000000000000.
Definition at line 306 of file UniqueId.cpp.
References trBase::implId::IsNull(), and mGUIDPtr.

| bool trBase::UniqueId::operator!= | ( | const UniqueId & | id | ) | const |
Inequality operator.
| id | The identifier. |
Definition at line 339 of file UniqueId.cpp.
References mGUIDPtr.
| bool trBase::UniqueId::operator< | ( | const UniqueId & | id | ) | const |
Less-than comparison operator.
| id | The identifier. |
Definition at line 345 of file UniqueId.cpp.
References mGUIDPtr.
Copy the GUID from another unique id.
The assignment operator is public so that unique id's can be changed if they are member variables. Use const to control when they are changed.
Definition at line 312 of file UniqueId.cpp.
References mGUIDPtr.
Copy the GUID from another unique id.
The assignment operator is public so that unique id's can be changed if they are member variables. Use const to control when they are changed.
Definition at line 319 of file UniqueId.cpp.
References mGUIDPtr.
| UniqueId & trBase::UniqueId::operator= | ( | const std::string & | id | ) |
Copy the GUID form a string.
The assignment operator is public so that unique id's can be changed if they are member variables. Use const to control when they are changed.
Definition at line 326 of file UniqueId.cpp.
References mGUIDPtr.
| bool trBase::UniqueId::operator== | ( | const UniqueId & | id | ) | const |
Equality operator.
| id | The identifier. |
Definition at line 333 of file UniqueId.cpp.
References mGUIDPtr.
| bool trBase::UniqueId::operator> | ( | const UniqueId & | id | ) | const |
Greater-than comparison operator.
| id | The identifier. |
Definition at line 351 of file UniqueId.cpp.
References mGUIDPtr.
| const std::string trBase::UniqueId::ToString | ( | ) | const |
Convert the current GUID into a string.
Definition at line 294 of file UniqueId.cpp.
References mGUIDPtr, and trBase::implId::ToString().
Referenced by trManager::MessageBase::MessageBase(), and trManager::MessageBase::~MessageBase().


|
static |
Adds an easy and swappable access to the base class.
Definition at line 49 of file UniqueId.h.
Referenced by GetType().
|
protected |
Definition at line 160 of file UniqueId.h.
Referenced by FromString(), IsNull(), operator!=(), operator<(), operator=(), operator==(), operator>(), ToString(), UniqueId(), and ~UniqueId().