|
TrueReality
v0.1.1912
|
This is the base class for all the messages in TR. More...
#include <MessageBase.h>


Public Types | |
| using | BaseClass = trBase::SmrtClass |
Public Types inherited from trBase::SmrtClass | |
| using | BaseClass = osg::Referenced |
Public Member Functions | |
| MessageBase (const trBase::UniqueId *fromActorID, const trBase::UniqueId *aboutActorID=NULL, const bool isDirect=false, const std::string &messageFilter=trUtil::StringUtils::STR_BLANK) | |
| Holds the class/message type name for efficient comparisons. More... | |
| bool | operator== (const MessageBase &msg) const |
| bool | operator!= (const MessageBase &msg) const |
| virtual const std::string & | GetMessageType () const =0 |
| Returns the Message type. More... | |
| virtual const trBase::UniqueId * | GetFromActorID () const |
| Returns the ID of the actor the message was sent from. More... | |
| virtual const trBase::UniqueId * | GetAboutActorID () const |
| Returns the ID of the actor this message is about, or sent to. More... | |
| virtual const bool & | GetIsDirect () const |
| Returns True if this message is a direct message and skips all Directors. More... | |
| virtual const std::string & | GetMessageFilter () |
| Returns the custom Filter string. 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 | MESSAGE_TYPE |
| Adds an easy and swappable access to the base class. More... | |
Protected Member Functions | |
| ~MessageBase () | |
| dtor. More... | |
| virtual const std::string & | GetType () const override |
| Returns the class type Made protected to hide it. More... | |
Protected Member Functions inherited from trBase::SmrtClass | |
| ~SmrtClass () | |
Private Attributes | |
| trBase::ObsrvrPtr< const trBase::UniqueId > | mFromActorID |
| trBase::ObsrvrPtr< const trBase::UniqueId > | mAboutActorID |
| bool | mIsDirect |
| const std::string * | mMessageFilter |
| 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 the base class for all the messages in TR.
It is immutable, and all messages derived from it should keep that tradition.
Definition at line 40 of file MessageBase.h.
Definition at line 44 of file MessageBase.h.
| trManager::MessageBase::MessageBase | ( | const trBase::UniqueId * | fromActorID, |
| const trBase::UniqueId * | aboutActorID = NULL, |
||
| const bool | isDirect = false, |
||
| const std::string & | messageFilter = trUtil::StringUtils::STR_BLANK |
||
| ) |
Holds the class/message type name for efficient comparisons.
ctor.
| fromActorID | Id of the actor this message is being sent from. |
| aboutActorID | (Optional) Id of the actor this message is being sent to, or is about. |
| isDirect | (Optional) If TRUE, this message will skip all the Directors. |
| messageFilter | (Optional) A custom filter for developer use. |
Definition at line 32 of file MessageBase.cpp.
References LOG_D, mAboutActorID, mFromActorID, mId, mIsDirect, mMessageFilter, and trBase::UniqueId::ToString().

|
protected |
dtor.
Definition at line 42 of file MessageBase.cpp.
References LOG_D, mId, and trBase::UniqueId::ToString().

|
virtual |
Returns the ID of the actor this message is about, or sent to.
This ID can be empty if the message is not directed toward a specific Actor.
Definition at line 79 of file MessageBase.cpp.
References mAboutActorID.
Referenced by trManager::SystemManager::SendMessageToListeners().

|
virtual |
Returns the ID of the actor the message was sent from.
The ID should never be empty.
Definition at line 73 of file MessageBase.cpp.
References mFromActorID.
Referenced by trManager::SystemManager::SendMessageToActors(), trManager::SystemManager::SendMessageToDirectors(), and trManager::SystemManager::SendMessageToListeners().

|
virtual |
Returns True if this message is a direct message and skips all Directors.
Definition at line 85 of file MessageBase.cpp.
References mIsDirect.
Referenced by trManager::SystemManager::SendMessageToDirectors().

|
virtual |
Returns the custom Filter string.
Definition at line 91 of file MessageBase.cpp.
References mMessageFilter.
|
pure virtual |
Returns the Message type.
Implemented in trManager::MessageEntityRegistered, trManager::MessageEntityUnregistered, trCore::MessageCameraSynch, trCore::MessageEventTraversal, trCore::MessageFrame, trCore::MessageFrameSynch, trCore::MessagePostEventTraversal, trCore::MessagePostFrame, trManager::MessageTick, trCore::MessageSystemControl, and trCore::MessageSystemEvent.
Referenced by trCore::SystemDirector::OnMessage(), trManager::SystemManager::SendGlobalyRegisteredMessage(), trManager::SystemManager::SendMessageToActors(), and trManager::SystemManager::SendMessageToDirectors().

|
overrideprotectedvirtual |
Returns the class type Made protected to hide it.
Implements trBase::SmrtClass.
Definition at line 67 of file MessageBase.cpp.
References MESSAGE_TYPE.
|
inline |
Definition at line 61 of file MessageBase.h.
| bool trManager::MessageBase::operator== | ( | const MessageBase & | msg | ) | const |
Definition at line 48 of file MessageBase.cpp.
References mAboutActorID, mFromActorID, mIsDirect, and mMessageFilter.
|
private |
Definition at line 129 of file MessageBase.h.
Referenced by GetAboutActorID(), MessageBase(), and operator==().
|
static |
Adds an easy and swappable access to the base class.
Definition at line 46 of file MessageBase.h.
Referenced by GetType().
|
private |
Definition at line 129 of file MessageBase.h.
Referenced by GetFromActorID(), MessageBase(), and operator==().
|
private |
Definition at line 132 of file MessageBase.h.
Referenced by MessageBase(), and ~MessageBase().
|
private |
Definition at line 130 of file MessageBase.h.
Referenced by GetIsDirect(), MessageBase(), and operator==().
|
private |
Definition at line 131 of file MessageBase.h.
Referenced by GetMessageFilter(), MessageBase(), and operator==().