orxonox::OrxonoxClass Class Reference
The class all objects and interfaces of the game-logic (not the engine) are derived from. More...
#include <core/OrxonoxClass.h>
Public Member Functions | |
| OrxonoxClass () | |
| Constructor: Sets the default values. | |
| virtual | ~OrxonoxClass () |
| Destructor: Removes the object from the object-lists, notifies all DestructionListener (for example weak pointers) that this object is being deleted. | |
| void | destroy () |
| Deletes the object if no smart pointers point to this object. | |
| template<class T > | |
| ORX_FORCEINLINE const T * | getDerivedPointer (unsigned int classID) const |
| Const version of getDerivedPointer with template. | |
| template<class T > | |
| ORX_FORCEINLINE T * | getDerivedPointer (unsigned int classID) |
| Version of getDerivedPointer with template. | |
| ORX_FORCEINLINE void * | getDerivedPointer (unsigned int classID) |
| Returns a valid pointer of any derived type that is registered in the class hierarchy. | |
| Identifier * | getIdentifier () const |
| Returns the Identifier of the object. | |
| unsigned int | getReferenceCount () const |
| Returns the number of smart pointers that point to this object. | |
| bool | isA (const OrxonoxClass *object) |
| Returns true if the object's class is of the given type or a derivative. | |
| template<class B > | |
| bool | isA (const SubclassIdentifier< B > *identifier) |
| Returns true if the object's class is of the given type or a derivative. | |
| bool | isA (const Identifier *identifier) |
| Returns true if the object's class is of the given type or a derivative. | |
| bool | isChildOf (const OrxonoxClass *object) |
| Returns true if the object's class is a child of the given type. | |
| template<class B > | |
| bool | isChildOf (const SubclassIdentifier< B > *identifier) |
| Returns true if the object's class is a child of the given type. | |
| bool | isChildOf (const Identifier *identifier) |
| Returns true if the object's class is a child of the given type. | |
| bool | isDirectChildOf (const OrxonoxClass *object) |
| Returns true if the object's class is a direct child of the given type. | |
| template<class B > | |
| bool | isDirectChildOf (const SubclassIdentifier< B > *identifier) |
| Returns true if the object's class is a direct child of the given type. | |
| bool | isDirectChildOf (const Identifier *identifier) |
| Returns true if the object's class is a direct child of the given type. | |
| bool | isDirectParentOf (const OrxonoxClass *object) |
| Returns true if the object's class is a direct child of the given type. | |
| template<class B > | |
| bool | isDirectParentOf (const SubclassIdentifier< B > *identifier) |
| Returns true if the object's class is a direct parent of the given type. | |
| bool | isDirectParentOf (const Identifier *identifier) |
| Returns true if the object's class is a direct parent of the given type. | |
| bool | isExactlyA (const OrxonoxClass *object) |
| Returns true if the object's class is exactly of the given type. | |
| template<class B > | |
| bool | isExactlyA (const SubclassIdentifier< B > *identifier) |
| Returns true if the object's class is exactly of the given type. | |
| bool | isExactlyA (const Identifier *identifier) |
| Returns true if the object's class is exactly of the given type. | |
| bool | isParentOf (const OrxonoxClass *object) |
| Returns true if the object's class is a parent of the given type. | |
| template<class B > | |
| bool | isParentOf (const SubclassIdentifier< B > *identifier) |
| Returns true if the object's class is a parent of the given type. | |
| bool | isParentOf (const Identifier *identifier) |
| Returns true if the object's class is a parent of the given type. | |
| void | setConfigValues () |
| Function to collect the SetConfigValue-macro calls. | |
| void | unregisterObject () |
| Removes this object from the object-lists. | |
Protected Member Functions | |
| virtual void | preDestroy () |
| This virtual function is called if destroy() is called and no SmartPtr points to this object. Used in some cases to create a new SmartPtr to prevent destruction. | |
Private Member Functions | |
| void | decrementReferenceCount () |
| Decrements the reference counter (for smart pointers). | |
| void | incrementReferenceCount () |
| Increments the reference counter (for smart pointers). | |
| void | registerDestructionListener (DestructionListener *pointer) |
| Register a destruction listener (for example a weak pointer which points to this object). | |
| void | unregisterDestructionListener (DestructionListener *pointer) |
| Unegister a destruction listener (for example a weak pointer which pointed to this object before). | |
Private Attributes | |
| std::set< DestructionListener * > | destructionListeners_ |
| All destruction listeners (for example weak pointers which point to this object and like to get notified if it dies). | |
| Identifier * | identifier_ |
| The Identifier of the object. | |
| MetaObjectList * | metaList_ |
| MetaObjectList, containing all ObjectLists and ObjectListElements the object is registered in. | |
| std::vector< std::pair < unsigned int, void * > > | objectPointers_ |
| 'Fast map' that holds this-pointers of all derived types | |
| std::set< const Identifier * > * | parents_ |
| List of all parents of the object. | |
| int | referenceCount_ |
| Counts the references from smart pointers to this object. | |
| bool | requestedDestruction_ |
| Becomes true after someone called delete on this object. | |
Friends | |
| class | ClassIdentifier |
| class | DestructionListener |
| class | SmartPtr |
Detailed Description
The class all objects and interfaces of the game-logic (not the engine) are derived from.
The BaseObject and Interfaces are derived with virtual public OrxonoxClass from OrxonoxClass. OrxonoxClass is needed to create the class-hierarchy at startup and to store the Identifier and the MetaObjectList, as well as to provide an interface for SmartPtr and WeakPtr.
Constructor & Destructor Documentation
| orxonox::OrxonoxClass::OrxonoxClass | ( | ) |
Constructor: Sets the default values.
| orxonox::OrxonoxClass::~OrxonoxClass | ( | ) | [virtual] |
Destructor: Removes the object from the object-lists, notifies all DestructionListener (for example weak pointers) that this object is being deleted.
Member Function Documentation
| void orxonox::OrxonoxClass::decrementReferenceCount | ( | ) | [inline, private] |
Decrements the reference counter (for smart pointers).
| void orxonox::OrxonoxClass::destroy | ( | void | ) |
Deletes the object if no smart pointers point to this object.
Otherwise schedules the object to be deleted as soon as possible.
Reimplemented in orxonox::Core, orxonox::Game, orxonox::GraphicsManager, orxonox::GUIManager, and orxonox::Pickupable.
| ORX_FORCEINLINE const T* orxonox::OrxonoxClass::getDerivedPointer | ( | unsigned int | classID | ) | const [inline] |
Const version of getDerivedPointer with template.
| ORX_FORCEINLINE T* orxonox::OrxonoxClass::getDerivedPointer | ( | unsigned int | classID | ) | [inline] |
Version of getDerivedPointer with template.
| ORX_FORCEINLINE void* orxonox::OrxonoxClass::getDerivedPointer | ( | unsigned int | classID | ) | [inline] |
Returns a valid pointer of any derived type that is registered in the class hierarchy.
- Returns:
- Returns NULL if the no pointer was found.
| Identifier* orxonox::OrxonoxClass::getIdentifier | ( | ) | const [inline] |
Returns the Identifier of the object.
| unsigned int orxonox::OrxonoxClass::getReferenceCount | ( | ) | const [inline] |
Returns the number of smart pointers that point to this object.
| void orxonox::OrxonoxClass::incrementReferenceCount | ( | ) | [inline, private] |
Increments the reference counter (for smart pointers).
| bool orxonox::OrxonoxClass::isA | ( | const OrxonoxClass * | object | ) |
Returns true if the object's class is of the given type or a derivative.
| bool orxonox::OrxonoxClass::isA | ( | const SubclassIdentifier< B > * | identifier | ) | [inline] |
Returns true if the object's class is of the given type or a derivative.
| bool orxonox::OrxonoxClass::isA | ( | const Identifier * | identifier | ) |
Returns true if the object's class is of the given type or a derivative.
| bool orxonox::OrxonoxClass::isChildOf | ( | const OrxonoxClass * | object | ) |
Returns true if the object's class is a child of the given type.
| bool orxonox::OrxonoxClass::isChildOf | ( | const SubclassIdentifier< B > * | identifier | ) | [inline] |
Returns true if the object's class is a child of the given type.
| bool orxonox::OrxonoxClass::isChildOf | ( | const Identifier * | identifier | ) |
Returns true if the object's class is a child of the given type.
| bool orxonox::OrxonoxClass::isDirectChildOf | ( | const OrxonoxClass * | object | ) |
Returns true if the object's class is a direct child of the given type.
| bool orxonox::OrxonoxClass::isDirectChildOf | ( | const SubclassIdentifier< B > * | identifier | ) | [inline] |
Returns true if the object's class is a direct child of the given type.
| bool orxonox::OrxonoxClass::isDirectChildOf | ( | const Identifier * | identifier | ) |
Returns true if the object's class is a direct child of the given type.
| bool orxonox::OrxonoxClass::isDirectParentOf | ( | const OrxonoxClass * | object | ) |
Returns true if the object's class is a direct child of the given type.
| bool orxonox::OrxonoxClass::isDirectParentOf | ( | const SubclassIdentifier< B > * | identifier | ) | [inline] |
Returns true if the object's class is a direct parent of the given type.
| bool orxonox::OrxonoxClass::isDirectParentOf | ( | const Identifier * | identifier | ) |
Returns true if the object's class is a direct parent of the given type.
| bool orxonox::OrxonoxClass::isExactlyA | ( | const OrxonoxClass * | object | ) |
Returns true if the object's class is exactly of the given type.
| bool orxonox::OrxonoxClass::isExactlyA | ( | const SubclassIdentifier< B > * | identifier | ) | [inline] |
Returns true if the object's class is exactly of the given type.
| bool orxonox::OrxonoxClass::isExactlyA | ( | const Identifier * | identifier | ) |
Returns true if the object's class is exactly of the given type.
| bool orxonox::OrxonoxClass::isParentOf | ( | const OrxonoxClass * | object | ) |
Returns true if the object's class is a parent of the given type.
| bool orxonox::OrxonoxClass::isParentOf | ( | const SubclassIdentifier< B > * | identifier | ) | [inline] |
Returns true if the object's class is a parent of the given type.
| bool orxonox::OrxonoxClass::isParentOf | ( | const Identifier * | identifier | ) |
Returns true if the object's class is a parent of the given type.
| virtual void orxonox::OrxonoxClass::preDestroy | ( | void | ) | [inline, protected, virtual] |
This virtual function is called if destroy() is called and no SmartPtr points to this object. Used in some cases to create a new SmartPtr to prevent destruction.
Reimplemented in orxonox::NotificationManager, orxonox::Pickupable, orxonox::PickupCarrier, orxonox::AmbientSound, orxonox::ControllableEntity, and orxonox::Pawn.
| void orxonox::OrxonoxClass::registerDestructionListener | ( | DestructionListener * | pointer | ) | [inline, private] |
Register a destruction listener (for example a weak pointer which points to this object).
| void orxonox::OrxonoxClass::setConfigValues | ( | void | ) | [inline] |
Function to collect the SetConfigValue-macro calls.
Reimplemented in orxonox::Shell, orxonox::Core, orxonox::Game, orxonox::GraphicsManager, orxonox::GUIManager, orxonox::InputBuffer, orxonox::InputManager, orxonox::JoyStick, orxonox::KeyBinder, orxonox::KeyBinderManager, orxonox::TrafficControl, orxonox::WANDiscoverable, orxonox::WANDiscovery, orxonox::ParticleInterface, orxonox::ScreenshotManager, orxonox::SkyboxGenerator, orxonox::ChatOverlay, orxonox::HUDEnemyHealthBar, orxonox::HUDNavigation, orxonox::Stats, orxonox::Pong, orxonox::PongAI, orxonox::Projectile, orxonox::GSMainMenu, orxonox::Dynamicmatch, orxonox::Gametype, orxonox::LastManStanding, orxonox::LastTeamStanding, orxonox::TeamGametype, orxonox::UnderAttack, orxonox::Camera, orxonox::Model, orxonox::Bot, orxonox::HumanPlayer, orxonox::Engine, orxonox::LevelManager, orxonox::MoodManager, orxonox::InGameConsole, orxonox::SoundManager, orxonox::Test, orxonox::ControllableEntity, orxonox::FpsPlayer, orxonox::SpaceShip, and orxonox::Spectator.
| void orxonox::OrxonoxClass::unregisterDestructionListener | ( | DestructionListener * | pointer | ) | [inline, private] |
Unegister a destruction listener (for example a weak pointer which pointed to this object before).
| void orxonox::OrxonoxClass::unregisterObject | ( | ) |
Removes this object from the object-lists.
Friends And Related Function Documentation
friend class ClassIdentifier [friend] |
friend class DestructionListener [friend] |
friend class SmartPtr [friend] |
Member Data Documentation
std::set<DestructionListener*> orxonox::OrxonoxClass::destructionListeners_ [private] |
All destruction listeners (for example weak pointers which point to this object and like to get notified if it dies).
Identifier* orxonox::OrxonoxClass::identifier_ [private] |
The Identifier of the object.
MetaObjectList* orxonox::OrxonoxClass::metaList_ [private] |
MetaObjectList, containing all ObjectLists and ObjectListElements the object is registered in.
std::vector<std::pair<unsigned int, void*> > orxonox::OrxonoxClass::objectPointers_ [private] |
'Fast map' that holds this-pointers of all derived types
std::set<const Identifier*>* orxonox::OrxonoxClass::parents_ [private] |
List of all parents of the object.
int orxonox::OrxonoxClass::referenceCount_ [private] |
Counts the references from smart pointers to this object.
bool orxonox::OrxonoxClass::requestedDestruction_ [private] |
Becomes true after someone called delete on this object.
The documentation for this class was generated from the following files:
- libraries/core/OrxonoxClass.h
- libraries/core/OrxonoxClass.cc
Generated on Wed May 22 06:32:22 2013 for Orxonox by
1.6.3








