|
Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
|
#include <object_factory.h>
Public Member Functions | |
| PRODUCT * | create (const std::string &name) const |
| bool | add (const std::string &name, PRODUCT *(*maker)()) |
| size_t | size () const |
Private Attributes | |
| std::map< std::string, PRODUCT *(*)() > | manufacturers |
A generic storage class for storing items, such as variable values or function pointers. The storage class can store any type of item that does not require a constructor call, i.e., it does not create a new copy of an item when one is requested.
Definition at line 36 of file object_factory.h.
|
inline |
Register a maker to the factory. This function will fail to succeed if the factory already contains a maker with the given name.
| name | A unique name for the maker. |
| func | The maker function. |
Definition at line 72 of file object_factory.h.
|
inline |
Get an item (product) with the given name.
| name | The name of the item. |
| func | The requested item is stored here, if it was found. |
Definition at line 58 of file object_factory.h.
|
inline |
Definition at line 80 of file object_factory.h.
|
private |
Container for all stored maker functions.
Definition at line 50 of file object_factory.h.