Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
orxonox::Listable Class Reference

Listable stores the entries of all object lists pointing to this instance. More...

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

Inheritance diagram for orxonox::Listable:
orxonox::Identifiable orxonox::BaseSound orxonox::ChatListener orxonox::ClientConnectionListener orxonox::Configurable orxonox::Context orxonox::DevModeListener orxonox::JoyStickQuantityListener orxonox::NetworkChatListener orxonox::TimeFactorListener orxonox::Timer orxonox::UpdateListener orxonox::ViewportEventListener orxonox::WindowEventListener orxonox::XMLNameListener

Public Member Functions

 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...
 

Static Private Member Functions

template<class T >
static ObjectListElement< T > * createObjectListElement (T *object)
 
static void deleteObjectListElement (ObjectListBaseElement *element)
 
static SmallObjectAllocatorgetObjectListElementAllocator ()
 

Private Attributes

Contextcontext_
 The object will register itself in the object lists of this context. More...
 
std::vector< ObjectListBaseElement * > elements_
 The corresponding ObjectListElements in all object lists the object is registered in. More...
 

Friends

class Context
 

Detailed Description

Listable stores the entries of all object lists pointing to this instance.

Constructor & Destructor Documentation

orxonox::Listable::Listable ( )

Constructor: Allocates space in the element list.

orxonox::Listable::Listable ( Context context)

Constructor: Allocates space in the element list and assigns the context.

orxonox::Listable::~Listable ( )
virtual

Destructor: Removes the object from the object-lists.

Member Function Documentation

template<class T >
static ObjectListElement<T>* orxonox::Listable::createObjectListElement ( T *  object)
inlinestaticprivate
void orxonox::Listable::deleteObjectListElement ( ObjectListBaseElement element)
staticprivate
Context* orxonox::Listable::getContext ( ) const
inline
SmallObjectAllocator & orxonox::Listable::getObjectListElementAllocator ( )
staticprivate
void orxonox::Listable::setContext ( Context context)

Changes the context.

The object is removed from the current context and added to the new one. This also applies to all object lists the object is registered in.

void orxonox::Listable::unregisterObject ( )

Removes this object from the object-lists.

Friends And Related Function Documentation

friend class Context
friend

Member Data Documentation

Context* orxonox::Listable::context_
private

The object will register itself in the object lists of this context.

std::vector<ObjectListBaseElement*> orxonox::Listable::elements_
private

The corresponding ObjectListElements in all object lists the object is registered in.


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