TrueReality  v0.1.1912
trCore::Nodes::FrameStamp Class Reference

Class which encapsulates the frame number, reference time and calendar time of specific frame, used to synchronize operations on the scene graph and other machines when using a graphics cluster. More...

#include <FrameStamp.h>

Inheritance diagram for trCore::Nodes::FrameStamp:
Collaboration diagram for trCore::Nodes::FrameStamp:

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

 FrameStamp (const std::string name=CLASS_TYPE)
 Holds the class type name for efficient comparisons. More...
 
 FrameStamp (const osg::FrameStamp fs, const std::string name=CLASS_TYPE)
 Constructor. More...
 
virtual const std::string & GetType () const override
 Returns the class type. More...
 
virtual void SetName (const std::string &name)
 Sets this instances name. More...
 
virtual osg::FrameStamp * AsOSGClass ()
 Returns a pointer to the internal OSG FrameStamp. More...
 
virtual const osg::FrameStamp * AsOSGClass () const
 Returns a constant pointer to the internal OSG FrameStamp. More...
 
void SetFrameNumber (unsigned int fnum)
 Sets frame number. More...
 
unsigned int GetFrameNumber () const
 Gets frame number. More...
 
void SetReferenceTime (double refTime)
 Sets reference time. More...
 
double GetReferenceTime () const
 Gets reference time. More...
 
void SetSimulationTime (double refTime)
 Sets simulation time. More...
 
double GetSimulationTime () const
 Gets simulation time. More...
 
void SetCalendarTime (const tm &calendarTime)
 Sets calendar time. More...
 
void GetCalendarTime (tm &calendarTime) const
 Gets calendar time. More...
 
FrameStampoperator= (const FrameStamp &fs)
 Assignment operator. 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 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("trCore::Nodes::FrameStamp")
 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

 ~FrameStamp ()
 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< osg::FrameStamp > mFrameStamp
 The frame stamp. More...
 

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

Class which encapsulates the frame number, reference time and calendar time of specific frame, used to synchronize operations on the scene graph and other machines when using a graphics cluster.

Note the calendar time can be an artificial simulation time or capture the real time of day etc.

Author
Maxim Serebrennik

Definition at line 54 of file FrameStamp.h.

Member Typedef Documentation

◆ BaseClass

Constructor & Destructor Documentation

◆ FrameStamp() [1/2]

trCore::Nodes::FrameStamp::FrameStamp ( const std::string  name = CLASS_TYPE)

Holds the class type name for efficient comparisons.

Constructor.

Parameters
name(Optional) The name.

Definition at line 33 of file FrameStamp.cpp.

References mFrameStamp, and trBase::Base::SetName().

Here is the call graph for this function:

◆ FrameStamp() [2/2]

trCore::Nodes::FrameStamp::FrameStamp ( const osg::FrameStamp  fs,
const std::string  name = CLASS_TYPE 
)

Constructor.

Parameters
fsThe file system.
name(Optional) The name.

Definition at line 40 of file FrameStamp.cpp.

References mFrameStamp, and trBase::Base::SetName().

Here is the call graph for this function:

◆ ~FrameStamp()

trCore::Nodes::FrameStamp::~FrameStamp ( )
protected

dtor.

Definition at line 127 of file FrameStamp.cpp.

Member Function Documentation

◆ AsOSGClass() [1/2]

osg::FrameStamp * trCore::Nodes::FrameStamp::AsOSGClass ( )
virtual

Returns a pointer to the internal OSG FrameStamp.

Returns
Null if it fails, else a pointer to an osg::FrameStamp.

Definition at line 59 of file FrameStamp.cpp.

References trBase::SmrtPtr< T >::Get(), and mFrameStamp.

Referenced by trCore::Nodes::NodeVisitor::SetFrameStamp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AsOSGClass() [2/2]

const osg::FrameStamp * trCore::Nodes::FrameStamp::AsOSGClass ( ) const
virtual

Returns a constant pointer to the internal OSG FrameStamp.

Returns
Null if it fails, else a pointer to a const osg::FrameStamp.

Definition at line 65 of file FrameStamp.cpp.

References trBase::SmrtPtr< T >::Get(), and mFrameStamp.

Here is the call graph for this function:

◆ GetCalendarTime()

void trCore::Nodes::FrameStamp::GetCalendarTime ( tm &  calendarTime) const

Gets calendar time.

Parameters
[in,out]calendarTimeThe calendar time.

Definition at line 113 of file FrameStamp.cpp.

References mFrameStamp.

◆ GetFrameNumber()

unsigned int trCore::Nodes::FrameStamp::GetFrameNumber ( ) const

Gets frame number.

Returns
The frame number.

Definition at line 77 of file FrameStamp.cpp.

References mFrameStamp.

◆ GetReferenceTime()

double trCore::Nodes::FrameStamp::GetReferenceTime ( ) const

Gets reference time.

Returns
The reference time.

Definition at line 89 of file FrameStamp.cpp.

References mFrameStamp.

◆ GetSimulationTime()

double trCore::Nodes::FrameStamp::GetSimulationTime ( ) const

Gets simulation time.

Returns
The simulation time.

Definition at line 101 of file FrameStamp.cpp.

References mFrameStamp.

◆ GetType()

const std::string & trCore::Nodes::FrameStamp::GetType ( ) const
overridevirtual

Returns the class type.

Returns
The type.

Implements trBase::Base.

Definition at line 47 of file FrameStamp.cpp.

References CLASS_TYPE.

◆ operator=()

FrameStamp & trCore::Nodes::FrameStamp::operator= ( const FrameStamp fs)

Assignment operator.

Parameters
fsThe file system.
Returns
A shallow copy of this object.

Definition at line 119 of file FrameStamp.cpp.

References trBase::Base::GetName(), mFrameStamp, and SetName().

Here is the call graph for this function:

◆ SetCalendarTime()

void trCore::Nodes::FrameStamp::SetCalendarTime ( const tm &  calendarTime)

Sets calendar time.

Parameters
calendarTimeThe calendar time.

Definition at line 107 of file FrameStamp.cpp.

References mFrameStamp.

◆ SetFrameNumber()

void trCore::Nodes::FrameStamp::SetFrameNumber ( unsigned int  fnum)

Sets frame number.

Parameters
fnumThe fnum.

Definition at line 71 of file FrameStamp.cpp.

References mFrameStamp.

◆ SetName()

void trCore::Nodes::FrameStamp::SetName ( const std::string &  name)
virtual

Sets this instances name.

Parameters
nameThe name.

Reimplemented from trBase::Base.

Definition at line 53 of file FrameStamp.cpp.

References trBase::Base::SetName().

Referenced by operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetReferenceTime()

void trCore::Nodes::FrameStamp::SetReferenceTime ( double  refTime)

Sets reference time.

Parameters
refTimeThe reference time.

Definition at line 83 of file FrameStamp.cpp.

References mFrameStamp.

◆ SetSimulationTime()

void trCore::Nodes::FrameStamp::SetSimulationTime ( double  refTime)

Sets simulation time.

Parameters
refTimeThe reference time.

Definition at line 95 of file FrameStamp.cpp.

References mFrameStamp.

Member Data Documentation

◆ CLASS_TYPE

const trUtil::RefStr trCore::Nodes::FrameStamp::CLASS_TYPE = trUtil::RefStr("trCore::Nodes::FrameStamp")
static

Adds an easy and swappable access to the base class.

Definition at line 60 of file FrameStamp.h.

Referenced by GetType().

◆ mFrameStamp

trBase::SmrtPtr<osg::FrameStamp> trCore::Nodes::FrameStamp::mFrameStamp
protected

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