Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Protected Member Functions | List of all members
orxonox::RealTimer Class Reference

RealTimer is a helper class that executes a function after a given amount of seconds in real-time. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/tools/Timer.h>

Inheritance diagram for orxonox::RealTimer:
orxonox::Timer orxonox::Listable orxonox::Identifiable

Public Member Functions

 RealTimer ()
 Constructor: Sets the default-values. More...
 
 RealTimer (float interval, bool bLoop, const ExecutorPtr &executor, bool bKillAfterCall=false)
 Constructor: Initializes and starts the timer, which will call an executor after some time. More...
 
- Public Member Functions inherited from orxonox::Timer
 Timer ()
 Constructor: Sets the default-values. More...
 
 Timer (float interval, bool bLoop, const ExecutorPtr &executor, bool bKillAfterCall=false)
 Constructor: Initializes and starts the timer, which will call an executor after some time. More...
 
 Timer (float interval, bool bLoop, std::function< void(void)> func, bool bKillAfterCall=false)
 
void addTime (float time)
 Increases the remaining time of the timer by the given amount of time (in seconds). More...
 
float getRemainingTime () const
 Returns the remaining time until the timer calls the executor. More...
 
bool isActive () const
 Returns true if the timer is active (neither stopped nor paused). More...
 
void pauseTimer ()
 Pauses the timer - it will continue with the actual state if you call unpauseTimer(). More...
 
void removeTime (float time)
 Decreases the remaining time of the timer by the given amount of time (in seconds) More...
 
void run ()
 Calls the executor and destroys the timer if requested. More...
 
void setInterval (float interval)
 Changes the calling interval. More...
 
void setLoop (bool bLoop)
 Defines if the timer call the executor every interval seconds or only once. More...
 
void setTimer (float interval, bool bLoop, const ExecutorPtr &executor, bool bKillAfterCall=false)
 Initializes and starts the timer, which will call an executor after some time. More...
 
void setTimer (float interval, bool bLoop, std::function< void(void)> func, bool bKillAfterCall=false)
 
void startTimer ()
 Re-starts the timer: The executor will be called after interval seconds. More...
 
void stopTimer ()
 Stops the timer. More...
 
void tick (const Clock &time)
 Updates the timer before the frames are rendered. More...
 
void unpauseTimer ()
 Unpauses the timer - continues with the given state. More...
 
- Public Member Functions inherited from orxonox::Listable
 Listable ()
 Constructor: Allocates space in the element list. More...
 
 Listable (Context *context)
 Constructor: Allocates space in the element list and assigns the context. More...
 
virtual ~Listable ()
 Destructor: Removes the object from the object-lists. More...
 
ContextgetContext () const
 
void setContext (Context *context)
 Changes the context. More...
 
void unregisterObject ()
 Removes this object from the object-lists. More...
 
- Public Member Functions inherited from orxonox::Identifiable
 Identifiable ()
 Constructor: Sets the default values. More...
 
virtual ~Identifiable ()
 
ORX_FORCEINLINE voidgetDerivedPointer (unsigned int classID)
 Returns a valid pointer of any derived type that is registered in the class hierarchy. More...
 
template<class T >
ORX_FORCEINLINE T * getDerivedPointer (unsigned int classID)
 Version of getDerivedPointer with template. More...
 
template<class T >
ORX_FORCEINLINE const T * getDerivedPointer (unsigned int classID) const
 Const version of getDerivedPointer with template. More...
 
IdentifiergetIdentifier () const
 Returns the Identifier of the object. More...
 
bool isA (const Identifier *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
template<class B >
bool isA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isA (const Identifiable *object)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isChildOf (const Identifier *identifier)
 Returns true if the object's class is a child of the given type. More...
 
template<class B >
bool isChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a child of the given type. More...
 
bool isChildOf (const Identifiable *object)
 Returns true if the object's class is a child of the given type. More...
 
bool isDirectChildOf (const Identifier *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
template<class B >
bool isDirectChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectChildOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectParentOf (const Identifier *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
template<class B >
bool isDirectParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
bool isDirectParentOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isExactlyA (const Identifier *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
template<class B >
bool isExactlyA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
bool isExactlyA (const Identifiable *object)
 Returns true if the object's class is exactly of the given type. More...
 
bool isParentOf (const Identifier *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
template<class B >
bool isParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
bool isParentOf (const Identifiable *object)
 Returns true if the object's class is a parent of the given type. More...
 

Protected Member Functions

virtual float getTimeFactor () override
 Returns always 1 because RealTimer doesn't depend on the game time. More...
 

Detailed Description

RealTimer is a helper class that executes a function after a given amount of seconds in real-time.

The time interval of RealTimer doesn't depend on the game time, it will also call the function if the game is paused. See Timer for a timer class that depends on the game time.

Constructor & Destructor Documentation

orxonox::RealTimer::RealTimer ( )

Constructor: Sets the default-values.

orxonox::RealTimer::RealTimer ( float  interval,
bool  bLoop,
const ExecutorPtr executor,
bool  bKillAfterCall = false 
)

Constructor: Initializes and starts the timer, which will call an executor after some time.

Parameters
intervalThe timer-interval in seconds
bLoopIf true, the executor gets called every interval seconds
executorThe executor that will be called
bKillAfterCallIf true, the timer will be deleted after the executor was called

Member Function Documentation

float orxonox::RealTimer::getTimeFactor ( )
overrideprotectedvirtual

Returns always 1 because RealTimer doesn't depend on the game time.

Reimplemented from orxonox::Timer.


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