Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | List of all members
orxonox::UpdateListener Class Referenceabstract

Inherit from UpdateListener if you need to receive calls before or after the game is ticked. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/UpdateListener.h>

Inheritance diagram for orxonox::UpdateListener:
orxonox::Listable orxonox::Identifiable orxonox::DestroyLaterManager orxonox::InGameConsole orxonox::SoundManager

Public Member Functions

 UpdateListener ()
 
virtual void postUpdate (const Clock &time)=0
 Gets called by Core after the framework was ticked (but before graphics are drawn). More...
 
virtual void preUpdate (const Clock &time)=0
 Gets called by Core before the framework is ticked. 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...
 

Detailed Description

Inherit from UpdateListener if you need to receive calls before or after the game is ticked.

All classes inheriting from UpdateListener need to be strictly independent of each other and may not rely on a specific order in which all UpdateListeners are called.

If you do have such a dependency between two UpdateListeners, e.g. A::preUpdate() always needs to be called before B::preUpdate(), then you need to create a third class C (which inherits from UpdateListener) with the following implementation: void C::preUpdate() { A::preUpdate(); B::preUpdate(); } This is the only way to ensure that A gets called before B. In this example, only C inherits from UpdateListener, while A and B do not. Instead they receive the update from C.

Constructor & Destructor Documentation

orxonox::UpdateListener::UpdateListener ( )

Member Function Documentation

virtual void orxonox::UpdateListener::postUpdate ( const Clock time)
pure virtual

Gets called by Core after the framework was ticked (but before graphics are drawn).

Implemented in orxonox::SoundManager, orxonox::InGameConsole, and orxonox::DestroyLaterManager.

virtual void orxonox::UpdateListener::preUpdate ( const Clock time)
pure virtual

Gets called by Core before the framework is ticked.

Implemented in orxonox::SoundManager, orxonox::InGameConsole, and orxonox::DestroyLaterManager.


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