LoveBrains  1.0.0
Public Member Functions | Static Public Member Functions | List of all members
Graphics::FactoryObjects Class Reference

Define a factory of objects that will fill the environment in term of the environment file. More...

#include <factory_object.h>

Public Member Functions

 FactoryObjects (void)
 Constructor.
 
 ~FactoryObjects (void)
 Destructor.
 
IObjectCreate (std::string const &key) const
 Create a new object of the given key. More...
 
bool Contains (std::string const &key) const
 Search if an object is contained in the factory. More...
 

Static Public Member Functions

static void Register (std::string const &key, IObject *obj)
 Register a new object in the factory. More...
 
static void DeleteAll (void)
 Delete all the objects that have been registered in the factory.
 

Detailed Description

Define a factory of objects that will fill the environment in term of the environment file.

Member Function Documentation

bool Graphics::FactoryObjects::Contains ( std::string const &  key) const

Search if an object is contained in the factory.

Parameters
key: Contains the key of the object.
Returns
true : if it's contained.
false : if it's not contained.
IObject * Graphics::FactoryObjects::Create ( std::string const &  key) const

Create a new object of the given key.

Parameters
key: Contains the key of the object.
void Graphics::FactoryObjects::Register ( std::string const &  key,
IObject obj 
)
static

Register a new object in the factory.

Parameters
key: Contains the key of the object.
obj: Contains the object that will be cloned in order to create a new object.

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