TrueReality  v0.1.1912
trApp::AppBase Class Reference

An application base from which all other application classes should be derived. More...

#include <AppBase.h>

Inheritance diagram for trApp::AppBase:
Collaboration diagram for trApp::AppBase:

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

 AppBase (const std::string &name=CLASS_TYPE)
 Holds the class type name for efficient comparisons. More...
 
virtual const std::string & GetType () const override
 Gets the type. More...
 
virtual void Run ()
 Starts the application loop. More...
 
virtual void Quit ()
 Stops the application loop and exits the application. 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::UniqueIdGetUUID (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("trApp::AppBase")
 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

 ~AppBase ()
 Destructor. More...
 
- Protected Member Functions inherited from trBase::Base
 ~Base ()
 Base destructor. More...
 
- Protected Member Functions inherited from trBase::SmrtClass
 ~SmrtClass ()
 

Protected Attributes

trBase::SmrtPtr< trManager::SystemManagermSysMan
 

Private Attributes

trBase::SmrtPtr< trCore::SystemDirectormSysDirector
 

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...
 

Detailed Description

An application base from which all other application classes should be derived.

Definition at line 38 of file AppBase.h.

Member Typedef Documentation

◆ BaseClass

Definition at line 41 of file AppBase.h.

Constructor & Destructor Documentation

◆ AppBase()

trApp::AppBase::AppBase ( const std::string &  name = CLASS_TYPE)

Holds the class type name for efficient comparisons.

Default constructor.

Parameters
name(Optional) The name of the class.

Definition at line 31 of file AppBase.cpp.

References trManager::SystemManager::GetInstance(), trManager::DirectorPriority::HIGHEST, mSysDirector, mSysMan, and trManager::SystemManager::RegisterDirector().

Here is the call graph for this function:

◆ ~AppBase()

trApp::AppBase::~AppBase ( )
protected

Destructor.

Definition at line 44 of file AppBase.cpp.

Member Function Documentation

◆ GetType()

const std::string & trApp::AppBase::GetType ( ) const
overridevirtual

Gets the type.

Returns
The type.

Implements trBase::Base.

Definition at line 49 of file AppBase.cpp.

References CLASS_TYPE.

◆ Quit()

void trApp::AppBase::Quit ( )
virtual

Stops the application loop and exits the application.

Definition at line 61 of file AppBase.cpp.

References mSysMan, trManager::SystemManager::SendMessage(), and trCore::SystemControls::SHUT_DOWN.

Here is the call graph for this function:

◆ Run()

void trApp::AppBase::Run ( )
virtual

Starts the application loop.

Definition at line 55 of file AppBase.cpp.

References mSysDirector, and trCore::SystemDirector::Run().

Here is the call graph for this function:

Member Data Documentation

◆ CLASS_TYPE

const trUtil::RefStr trApp::AppBase::CLASS_TYPE = trUtil::RefStr("trApp::AppBase")
static

Adds an easy and swappable access to the base class.

Definition at line 43 of file AppBase.h.

Referenced by GetType().

◆ mSysDirector

trBase::SmrtPtr<trCore::SystemDirector> trApp::AppBase::mSysDirector
private

Definition at line 91 of file AppBase.h.

Referenced by AppBase(), and Run().

◆ mSysMan

trBase::SmrtPtr<trManager::SystemManager> trApp::AppBase::mSysMan
protected

Definition at line 79 of file AppBase.h.

Referenced by AppBase(), and Quit().


The documentation for this class was generated from the following files: