Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Private Attributes | List of all members
orxonox::SubclassIdentifier< T > Class Template Reference

The SubclassIdentifier acts almost like an Identifier, but has some prerequisites. More...

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

Public Member Functions

 SubclassIdentifier ()
 Constructor: Automaticaly assigns the Identifier of the given class. More...
 
 SubclassIdentifier (Identifier *identifier)
 Constructor: Assigns the given Identifier. More...
 
template<class O >
 SubclassIdentifier (const SubclassIdentifier< O > &identifier)
 Copyconstructor: Assigns the identifier of another SubclassIdentifier. More...
 
T * fabricate (Context *context) const
 Creates a new object of the type of the assigned Identifier and dynamic_casts it to the minimal type given by T. More...
 
IdentifiergetIdentifier () const
 Returns the assigned identifier. More...
 
 operator Identifier * () const
 Returns the assigned identifier. This allows you to assign a SubclassIdentifier to a normal Identifier*. More...
 
Identifieroperator* () const
 Overloading of the * operator: returns the assigned identifier. More...
 
Identifieroperator-> () const
 Overloading of the -> operator: returns the assigned identifier. More...
 
SubclassIdentifier< T > & operator= (Identifier *identifier)
 Overloading of the = operator: assigns the identifier and checks its type. More...
 
template<class O >
SubclassIdentifier< T > & operator= (const SubclassIdentifier< O > &identifier)
 Overloading of the = operator: assigns the identifier of another SubclassIdentifier. More...
 

Private Attributes

Identifieridentifier_
 The assigned identifier. More...
 

Detailed Description

template<class T>
class orxonox::SubclassIdentifier< T >

The SubclassIdentifier acts almost like an Identifier, but has some prerequisites.

You can only assign an Identifier that belongs to a class T (or derived) to a SubclassIdentifier<T>. If you assign something else, the program prints an error.

Because we know the base-type, a dynamic_cast is done, which makes it easier to create a new object.

See also
See SubclassIdentifier.h for some examples.

Constructor & Destructor Documentation

template<class T>
orxonox::SubclassIdentifier< T >::SubclassIdentifier ( )
inline

Constructor: Automaticaly assigns the Identifier of the given class.

template<class T>
orxonox::SubclassIdentifier< T >::SubclassIdentifier ( Identifier identifier)
inline

Constructor: Assigns the given Identifier.

template<class T>
template<class O >
orxonox::SubclassIdentifier< T >::SubclassIdentifier ( const SubclassIdentifier< O > &  identifier)
inline

Copyconstructor: Assigns the identifier of another SubclassIdentifier.

Member Function Documentation

template<class T>
T* orxonox::SubclassIdentifier< T >::fabricate ( Context context) const
inline

Creates a new object of the type of the assigned Identifier and dynamic_casts it to the minimal type given by T.

template<class T>
Identifier* orxonox::SubclassIdentifier< T >::getIdentifier ( ) const
inline

Returns the assigned identifier.

template<class T>
orxonox::SubclassIdentifier< T >::operator Identifier * ( ) const
inline

Returns the assigned identifier. This allows you to assign a SubclassIdentifier to a normal Identifier*.

template<class T>
Identifier* orxonox::SubclassIdentifier< T >::operator* ( ) const
inline

Overloading of the * operator: returns the assigned identifier.

template<class T>
Identifier* orxonox::SubclassIdentifier< T >::operator-> ( ) const
inline

Overloading of the -> operator: returns the assigned identifier.

template<class T>
SubclassIdentifier<T>& orxonox::SubclassIdentifier< T >::operator= ( Identifier identifier)
inline

Overloading of the = operator: assigns the identifier and checks its type.

Parameters
identifierThe Identifier to assign
Returns
The SubclassIdentifier itself
template<class T>
template<class O >
SubclassIdentifier<T>& orxonox::SubclassIdentifier< T >::operator= ( const SubclassIdentifier< O > &  identifier)
inline

Overloading of the = operator: assigns the identifier of another SubclassIdentifier.

Member Data Documentation

template<class T>
Identifier* orxonox::SubclassIdentifier< T >::identifier_
private

The assigned identifier.


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