Public Member Functions |
| input () |
| input (std::map< std::string, item_wrapper > &values) |
const item * | operator[] (const std::string &inval) |
void | add_redir (const std::string &name, const item_wrapper &inv) |
| Redirects an input value to a local item.
|
void | add_remap (const std::string &oldname, const std::string &newname) |
| Remaps one name to another item. Mappings will prioritize local variables over global.
|
void | insert_item (std::shared_ptr< item > inval) |
template<class T > |
void | insert_item (std::shared_ptr< T > inval) |
template<class T > |
void | retrieve (T &inval, const std::string &name, item *caller) |
| Type safe method of retrieving value from a variable.
|
template<class T > |
void | retrieve (T &inval, const std::string &name, item *caller, T &&stdval) |
template<class T > |
void | retrieve (T &inval, const std::string &name, item *caller, const T &stdval) |
template<class T > |
void | retrieve_notrack (T &inval, const std::string &name) |
template<class T > |
void | retrieve_notrack (T &inval, const std::string &name, T &&stdval) |
template<class T > |
void | retrieve_notrack (T &inval, const std::string &name, const T &stdval) |
This class wraps the raw input for retrieval purposes.
Definition at line 34 of file input.h.
template<class T >
void input::retrieve |
( |
T & |
inval, |
|
|
const std::string & |
name, |
|
|
item * |
caller |
|
) |
| |
|
inline |
Type safe method of retrieving value from a variable.
This function provides a type-safe interface for extracting values from the item class The variable type is automatically inferred from the passed type- For example, passing an int to recieve an unsigned will result in a failure, as will passing anything other than a size_t. Same goes for doubles and floats
When retrieving item* type classes, the type of pointer passed must be in the same inheritance line as the value being retrieved.
- Parameters
-
inval | A reference to the variable that will recieve the internal value of the item |
name | The name of the item being retrieved |
caller | The item receiving the variable |
Definition at line 86 of file input.h.