User Manual, Developers Guide and API Documentation

wns::StaticFactory< CREATOR > Class Template Reference

Monostate class keeping a registry of creators for interface-implementations. More...

#include <StaticFactory.hpp>

List of all members.

Public Types

typedef std::map< std::string,
CREATOR * > 
CreateMap
 Internal storage definition for name to creator mapping.
typedef void(* RegisterFunction )(std::string name, CREATOR *creator)

Static Public Member Functions

static CREATORcreator (std::string name)
 Lookup and return the creator with the given name.
static CreateMapgetMap ()
 Return the internal mapping.
static bool knows (std::string name)
 Check if a creator with the given name has registered.
static void reg (std::string name, CREATOR *creator)
 Register a creator.


Detailed Description

template<typename CREATOR>
class wns::StaticFactory< CREATOR >

Author:
Fabian Debus <fabian.debus@illator.de>
Indepth documentation can be found on the StaticFactory page.

Definition at line 138 of file StaticFactory.hpp.


Member Typedef Documentation

template<typename CREATOR>
typedef std::map<std::string, CREATOR*> wns::StaticFactory< CREATOR >::CreateMap

Useful for reflection.

Definition at line 169 of file StaticFactory.hpp.

template<typename CREATOR>
typedef void(* wns::StaticFactory< CREATOR >::RegisterFunction)(std::string name, CREATOR *creator)


Member Function Documentation

template<typename CREATOR>
CREATOR * wns::StaticFactory< CREATOR >::creator ( std::string  name  )  [inline, static]

If no creator with the given name has been registered, throw an exception of type FIXME. Never return a NULL-pointer.

Definition at line 192 of file StaticFactory.hpp.

template<typename CREATOR>
StaticFactory< CREATOR >::CreateMap * wns::StaticFactory< CREATOR >::getMap (  )  [inline, static]

Useful for reflection.

Definition at line 182 of file StaticFactory.hpp.

template<typename CREATOR>
bool wns::StaticFactory< CREATOR >::knows ( std::string  name  )  [inline, static]

Definition at line 228 of file StaticFactory.hpp.

template<typename CREATOR>
void wns::StaticFactory< CREATOR >::reg ( std::string  name,
CREATOR creator 
) [inline, static]

In most cases this method will not be used directly. StaticFactoryRegister instances use this method to register creators.

Definition at line 213 of file StaticFactory.hpp.


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

Generated on Sat May 26 03:32:51 2012 for openWNS by  doxygen 1.5.5