|
TrueReality
v0.1.1912
|
This is a Base class that carries the Class name and Unique ID of all the derived classes. More...
#include <Base.h>


Public Types | |
| using | BaseClass = trBase::SmrtClass |
Public Types inherited from trBase::SmrtClass | |
| using | BaseClass = osg::Referenced |
Public Member Functions | |
| Base (const std::string &name=CLASS_TYPE) | |
| Holds the class type name for efficient comparisons. More... | |
| virtual const std::string & | GetType () const override=0 |
| Returns the class type. 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::Base") |
| Adds an easy and swappable access to the base class. More... | |
Protected Member Functions | |
| ~Base () | |
| Base destructor. More... | |
Protected Member Functions inherited from trBase::SmrtClass | |
| ~SmrtClass () | |
Private Attributes | |
| trUtil::RefStr | mName |
| trBase::UniqueId | mId |
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 is a Base class that carries the Class name and Unique ID of all the derived classes.
Definition at line 36 of file trBase/Base.h.
Definition at line 40 of file trBase/Base.h.
| trBase::Base::Base | ( | const std::string & | name = CLASS_TYPE | ) |
|
protected |
Base destructor.
Note, that it is protected so that classes cannot be deleted other than by being dereferenced and the reference count being zero (see trBase::SmrtClass), preventing the deletion of nodes which are still in use. This also means that Nodes cannot be created on stack i.e Node node will not compile, forcing all nodes to be created on the heap i.e Node* node = new Node().
Definition at line 37 of file Base.cpp.
References GetName(), and LOG_D.

|
virtual |
Returns this instances name.
Definition at line 49 of file Base.cpp.
References mName.
Referenced by trManager::EntityBase::AddChild(), trManager::EntityBase::AddInvokable(), Base(), trManager::SystemManager::CallInvokable(), trManager::EntityBase::Emancipate(), trCore::Nodes::FrameStamp::operator=(), trManager::SystemManager::RegisterActor(), trManager::SystemManager::RegisterDirector(), trManager::ActorBase::RegisterForMessage(), trManager::ActorBase::RegisterForMessagesAboutEntity(), trManager::SystemManager::RegisterForMessagesAboutEntity(), trManager::SystemManager::RegisterMsgWithMsgVectorMap(), trManager::ActorBase::RemoveAllActorModules(), trManager::EntityBase::RemoveFromHierarchy(), trManager::ActorBase::SendMessage(), trManager::ActorBase::SendNetworkMessage(), trManager::EntityBase::SetParent(), trManager::SystemManager::UnregisterActor(), trManager::SystemManager::UnregisterDirector(), trManager::SystemManager::UnregisterDirectorFromGlobalMessages(), trManager::ActorBase::UnRegisterFromMessage(), trManager::ActorBase::UnregisterFromMessagesAboutEntity(), trManager::SystemManager::UnregisterFromMessagesAboutEntity(), trManager::SystemManager::UnregisterMsgFromMsgMap(), trManager::SystemManager::UnregisterMsgFromMsgVectorMap(), and ~Base().

|
virtual |
|
overridepure virtual |
Returns the class type.
Implements trBase::SmrtClass.
Implemented in trCore::Nodes::NodeVisitor, trCore::Nodes::Node, trCore::Nodes::FrameStamp, trSG::Node, trManager::DirectorBase, trManager::EntityBase, trBase::NodeBase, trManager::SystemManager, trCore::SystemDirector, trManager::ActorModuleBase, trApp::AppBase, trManager::ActorBase, trBase::UserDataContainer, and trSG::NodeVisitor.
|
virtual |
Returns the instances Universally Unique ID.
Definition at line 67 of file Base.cpp.
References mId.
Referenced by trCore::SystemDirector::CameraSynch(), trCore::SystemDirector::EventTraversal(), trManager::EntityBase::FindChild(), trCore::SystemDirector::Frame(), trCore::SystemDirector::FrameSynch(), trCore::SystemDirector::PostEventTraversal(), trCore::SystemDirector::PostFrame(), trCore::SystemDirector::PreFrame(), trManager::SystemManager::RegisterActor(), trManager::SystemManager::RegisterDirector(), trCore::SystemDirector::SetTimeScale(), trCore::SystemDirector::ShutDown(), trManager::SystemManager::UnregisterActor(), trManager::SystemManager::UnregisterDirector(), and trManager::SystemManager::UnregisterDirectorFromGlobalMessages().

|
virtual |
Sets this instances name.
| name | The name. |
Reimplemented in trCore::Nodes::NodeVisitor, trCore::Nodes::Node, trCore::Nodes::FrameStamp, trSG::Node, trBase::NodeBase, and trSG::NodeVisitor.
Definition at line 43 of file Base.cpp.
References mName.
Referenced by trCore::Nodes::FrameStamp::FrameStamp(), trSG::NodeVisitor::SetName(), trBase::NodeBase::SetName(), trCore::Nodes::FrameStamp::SetName(), trSG::Node::SetName(), trCore::Nodes::Node::SetName(), and trCore::Nodes::NodeVisitor::SetName().

|
virtual |
|
static |
Adds an easy and swappable access to the base class.
Definition at line 42 of file trBase/Base.h.
|
private |
Definition at line 120 of file trBase/Base.h.
|
private |
Definition at line 119 of file trBase/Base.h.