Skyscraper 2.0
SBS::TimerObject Class Reference

#include <timer.h>

Inheritance diagram for SBS::TimerObject:
Collaboration diagram for SBS::TimerObject:

Public Member Functions

 TimerObject (Object *parent, const std::string &name)
 
virtual ~TimerObject ()
 
void Start (int milliseconds=-1, bool oneshot=false)
 
void Stop ()
 
virtual void Notify ()
 
bool IsRunning ()
 
void Loop ()
 
unsigned long GetCurrentTime ()
 
void Report (const std::string &message)
 
- Public Member Functions inherited from SBS::Object
 Object (Object *parent)
 
virtual ~Object ()
 
void SetValues (const std::string &type, const std::string &name, bool is_permanent, bool is_movable=true)
 
bool IsPermanent ()
 
bool IsMovable ()
 
const std::string & GetType ()
 
int GetNumber ()
 
void AddChild (Object *object)
 
ObjectGetChild (int index)
 
int GetChildrenCount ()
 
void RemoveChild (Object *object)
 
SceneNodeGetSceneNode ()
 
void ShowBoundingBox (bool value)
 
virtual void Move (const Vector3 &vector, Real speed=1.0)
 
virtual void Move (Real X, Real Y, Real Z, Real speed=1.0)
 
virtual void SetPosition (const Vector3 &position)
 
void SetPositionRelative (const Vector3 &position)
 
virtual void SetPosition (Real X, Real Y, Real Z)
 
void SetPositionRelative (Real X, Real Y, Real Z)
 
virtual void SetPositionY (Real value)
 
virtual Vector3 GetPosition (bool relative=false)
 
virtual void Rotate (const Vector3 &vector, Real speed=1.0)
 
virtual void Rotate (Real X, Real Y, Real Z, Real speed=1.0)
 
virtual void SetRotation (const Vector3 &rotation)
 
virtual void SetRotation (Real X, Real Y, Real Z)
 
virtual Vector3 GetRotation ()
 
Quaternion GetOrientation (bool relative=false)
 
void SetOrientation (const Quaternion &q, bool relative=false)
 
virtual void OnMove (bool parent)
 
virtual void OnRotate (bool parent)
 
virtual void OnClick (Vector3 &position, bool shift, bool ctrl, bool alt, bool right)
 
virtual void OnUnclick (bool right)
 
virtual void OnHit ()
 
void NotifyMove (bool parent=false)
 
void NotifyRotate (bool parent=false)
 
virtual void ResetState ()
 
void ChangeParent (Object *new_parent)
 
bool IsGlobal ()
 
void Init (bool children=true)
 
virtual void OnInit ()
 
void RegisterLoop (Object *object)
 
void UnregisterLoop (Object *object)
 
virtual void Enabled (bool value)
 
std::string GetNameBase ()
 
template<typename T >
bool IsType ()
 
template<typename T >
T * ConvertTo ()
 
- Public Member Functions inherited from SBS::ObjectBase
 ObjectBase (Object *parent)
 
virtual ~ObjectBase ()
 
ObjectGetParent ()
 
SBSGetRoot ()
 
void SetName (const std::string &name)
 
const std::string & GetName ()
 
std::string GetNameBase ()
 
virtual bool ReportError (const std::string &message)
 

Private Attributes

int Interval
 
bool OneShot
 
unsigned long CurrentTime
 
unsigned long LastHit
 
unsigned long StartTime
 
bool Running
 

Additional Inherited Members

- Public Attributes inherited from SBS::Object
std::string command
 
std::string command_processed
 
std::string context
 
int linenum
 
std::string includefile
 
bool parent_deleting
 
- Protected Member Functions inherited from SBS::Object
void EnableLoop (bool value)
 
void LoopChildren ()
 
bool SelfDestruct ()
 
- Protected Attributes inherited from SBS::ObjectBase
SBSsbs
 

Detailed Description

Definition at line 29 of file timer.h.

Constructor & Destructor Documentation

◆ TimerObject()

SBS::TimerObject::TimerObject ( Object * parent,
const std::string & name )

Definition at line 30 of file timer.cpp.

References CurrentTime, Interval, LastHit, OneShot, Running, SBS::Object::SetValues(), and StartTime.

Here is the call graph for this function:

◆ ~TimerObject()

SBS::TimerObject::~TimerObject ( )
virtual

Definition at line 43 of file timer.cpp.

References Running, and Stop().

Here is the call graph for this function:

Member Function Documentation

◆ GetCurrentTime()

unsigned long SBS::TimerObject::GetCurrentTime ( )

Definition at line 99 of file timer.cpp.

References CurrentTime.

◆ IsRunning()

◆ Loop()

void SBS::TimerObject::Loop ( )
virtual

Reimplemented from SBS::Object.

Definition at line 79 of file timer.cpp.

References CurrentTime, SBS::SBS::GetCurrentTime(), Interval, LastHit, Notify(), OneShot, Report(), Running, SBS::ObjectBase::sbs, StartTime, Stop(), and SBS::SBS::Verbose.

Here is the call graph for this function:

◆ Notify()

◆ Report()

void SBS::TimerObject::Report ( const std::string & message)
virtual

Reimplemented from SBS::ObjectBase.

Definition at line 104 of file timer.cpp.

References SBS::ObjectBase::GetName(), SBS::ObjectBase::GetParent(), and SBS::ObjectBase::Report().

Referenced by Loop(), Start(), and Stop().

Here is the call graph for this function:

◆ Start()

◆ Stop()

Member Data Documentation

◆ CurrentTime

unsigned long SBS::TimerObject::CurrentTime
private

Definition at line 46 of file timer.h.

Referenced by GetCurrentTime(), Loop(), and TimerObject().

◆ Interval

int SBS::TimerObject::Interval
private

Definition at line 44 of file timer.h.

Referenced by Loop(), Start(), and TimerObject().

◆ LastHit

unsigned long SBS::TimerObject::LastHit
private

Definition at line 47 of file timer.h.

Referenced by Loop(), Start(), and TimerObject().

◆ OneShot

bool SBS::TimerObject::OneShot
private

Definition at line 45 of file timer.h.

Referenced by Loop(), Start(), and TimerObject().

◆ Running

bool SBS::TimerObject::Running
private

Definition at line 49 of file timer.h.

Referenced by IsRunning(), Loop(), Start(), Stop(), TimerObject(), and ~TimerObject().

◆ StartTime

unsigned long SBS::TimerObject::StartTime
private

Definition at line 48 of file timer.h.

Referenced by Loop(), Start(), and TimerObject().


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