|
Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
|
#include <item_storage.h>
Public Member Functions | |
| bool | get (const std::string &name, ITEM &item) const |
| bool | store (const std::string &name, ITEM item) |
Private Attributes | |
| std::map< std::string, ITEM > | warehouse |
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 item_storage.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 50 of file item_storage.h.
|
inline |
Register a item (product) to the factory. This function will fail to succeed if the factory already contains an item (product) with the same name.
| name | A unique name for the item (product). |
| func | Registered item (product). |
Definition at line 63 of file item_storage.h.
|
private |
Container for all stored items.
Definition at line 42 of file item_storage.h.