File kernel/src/simulationTools/EventFactory.hpp¶
Go to the source code of this file
Factory to generate user-defined Events.
Defines
-
AUTO_REGISTER_EVENT(class_name, class_type)¶
-
namespace EventFactory¶
Namespace for Events factory related objects.
Typedefs
-
typedef SP::Event (*object_creator)(double, int)¶
A pointer to function, returning a pointer to Event, built with its type (ie class name) and a pointer to Model.
-
typedef std::map<int, object_creator> MapFactory¶
The type of the factory map.
-
typedef MapFactory::iterator MapFactoryIt¶
An iterator through the MapFactory.
Functions
-
class Registry¶
- #include <>
Registry Class for Events.
Public Functions
-
void add(int type, object_creator creator)¶
Add an object_creator into the factory_map, factory_map[name] = object.
- Parameters
type – the type of the object added
creator – object creator
Public Static Functions
Private Members
-
MapFactory factory_map¶
map that links a std::string, the type of the class, to a pointer to function, used to build the object.
-
void add(int type, object_creator creator)¶
-
class Registration¶
- #include <>
Registration Class for Events.
Class used for auto-registration of Event-type objects.
Public Functions
-
Registration(int type, object_creator creator)¶
To register some new object into the factory.
- Parameters
type – the type of the object added
creator – object creator
-
Registration(int type, object_creator creator)¶
-
typedef SP::Event (*object_creator)(double, int)¶