nrEngine::EventFactory Class Reference
[Event-Management]

Event factories are used to create events of certain types. More...


Public Member Functions

 EventFactory (const std::string &name)
virtual ~EventFactory ()
bool isSupported (const std::string &eventType) const
virtual SharedPtr< Eventcreate (const std::string &eventType)=0
const std::string & getName () const

Protected Types

typedef std::list< std::string > NameList
 List containing all supported event types by their names.

Protected Member Functions

virtual void fillSupported ()=0
 Fill the list of supported event types.

Protected Attributes

NameList mSupportedTypes
 Variabl eto hold all supported types.
std::string mName
 Name of the factory.


Detailed Description

Event factories are used to create events of certain types.

EventFatory is an object which is able to create events of certain type. You can either create events by yourself or through such a factory.

We introduce the concept of a factory to enable sharing of new event types through plugins. That means, that plugins provide the engine such a factory to create an event object within the engine memory either in the plugin (dynamic library) memory.

Definition at line 38 of file EventFactory.h.


Constructor & Destructor Documentation

nrEngine::EventFactory::EventFactory ( const std::string &  name  ) 

Create a instance of a new factory.

Definition at line 22 of file EventFactory.cpp.

nrEngine::EventFactory::~EventFactory (  )  [virtual]

Release used memory and remove the list of supported event types from the event manager. So no new events of the supported types could be created throguh this factory

Definition at line 27 of file EventFactory.cpp.


Member Function Documentation

bool nrEngine::EventFactory::isSupported ( const std::string &  eventType  )  const

Return true if the given event type is supported

Definition at line 35 of file EventFactory.cpp.

References mSupportedTypes.

virtual SharedPtr<Event> nrEngine::EventFactory::create ( const std::string &  eventType  )  [pure virtual]

Create a new instance of an event of the given type

Parameters:
eventType Type name of the event to create
Returns:
NULL if the event could not been created or a valid smart pointer otherwise

const std::string& nrEngine::EventFactory::getName (  )  const

Get the name

Definition at line 71 of file EventFactory.h.


The documentation for this class was generated from the following files:
Generated on Wed Sep 12 23:19:43 2007 for nrEngine by  doxygen 1.5.1