orxonox::ClassFactory< T > Class Template Reference

The ClassFactory is able to create new objects of a specific class. More...

#include <src/core/ClassFactory.h>

Inheritance diagram for orxonox::ClassFactory< T >:

orxonox::BaseFactory

List of all members.

Public Member Functions

BaseObjectfabricate (BaseObject *creator)
 Creates and returns a new object of class T.

Static Public Member Functions

static bool create (const std::string &name, bool bLoadable=true)
 Adds the ClassFactory to the Identifier of the same type and the Identifier to the Factory.

Private Member Functions

 ClassFactory (const ClassFactory &factory)
 ClassFactory ()
virtual ~ClassFactory ()

Static Private Member Functions

static T * createNewObject (BaseObject *creator)
 Creates and returns a new object of class T; this is a wrapper for the new operator.


Detailed Description

template<class T>
class orxonox::ClassFactory< T >

The ClassFactory is able to create new objects of a specific class.

Constructor & Destructor Documentation

template<class T>
orxonox::ClassFactory< T >::ClassFactory (  )  [inline, private]

template<class T>
orxonox::ClassFactory< T >::ClassFactory ( const ClassFactory< T > &  factory  )  [inline, private]

template<class T>
virtual orxonox::ClassFactory< T >::~ClassFactory (  )  [inline, private, virtual]


Member Function Documentation

template<class T>
bool orxonox::ClassFactory< T >::create ( const std::string name,
bool  bLoadable = true 
) [inline, static]

Adds the ClassFactory to the Identifier of the same type and the Identifier to the Factory.

Parameters:
name The name of the class
bLoadable True if the class can be loaded through XML
Returns:
Always true (this is needed because the compiler only allows assignments before main())

References orxonox::Factory::add(), and COUT.

template<class T>
T * orxonox::ClassFactory< T >::createNewObject ( BaseObject creator  )  [inline, static, private]

Creates and returns a new object of class T; this is a wrapper for the new operator.

Returns:
The new object

References orxonox::KeyCode::T.

template<class T>
BaseObject * orxonox::ClassFactory< T >::fabricate ( BaseObject creator  )  [inline, virtual]

Creates and returns a new object of class T.

Returns:
The new object

Implements orxonox::BaseFactory.


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

Generated on Tue Jul 28 16:22:22 2009 for Orxonox by  doxygen 1.5.6