LILAC
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
input Class Reference

This class wraps the raw input for retrieval purposes. More...

#include <input.h>

Public Member Functions

 input ()
 input (std::map< std::string, item_wrapper > &values)
const itemoperator[] (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)

Private Member Functions

item_wrapperget_val (const std::string &value)
 gets a value from the input

Private Attributes

std::map< std::string,
item_wrapper > * 
invals
 Points to the actual map of input values.
std::map< std::string,
item_wrapper
re_directions
 Re-directs an input value to a locally defined item.
std::map< std::string,
std::string
re_mappings
 Re-directs one name to another.

Friends

void eval_lisp (std::string in_cmd, input &inv)

Detailed Description

This class wraps the raw input for retrieval purposes.

Definition at line 34 of file input.h.

Constructor & Destructor Documentation

input::input ( )
inline

Definition at line 47 of file input.h.

input::input ( std::map< std::string, item_wrapper > &  values)

Definition at line 19 of file input.cpp.

Member Function Documentation

void input::add_redir ( const std::string name,
const item_wrapper inv 
)

Redirects an input value to a local item.

Definition at line 55 of file input.cpp.

Here is the caller graph for this function:

void input::add_remap ( const std::string oldname,
const std::string newname 
)

Remaps one name to another item. Mappings will prioritize local variables over global.

Definition at line 59 of file input.cpp.

Here is the caller graph for this function:

item_wrapper & input::get_val ( const std::string value)
private

gets a value from the input

Definition at line 43 of file input.cpp.

Here is the caller graph for this function:

void input::insert_item ( std::shared_ptr< item inval)

Definition at line 21 of file input.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
void input::insert_item ( std::shared_ptr< T >  inval)
inline

Definition at line 62 of file input.h.

Here is the call graph for this function:

const item* input::operator[] ( const std::string inval)
inline

Definition at line 49 of file input.h.

Here is the call graph for this function:

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
invalA reference to the variable that will recieve the internal value of the item
nameThe name of the item being retrieved
callerThe item receiving the variable

Definition at line 86 of file input.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
void input::retrieve ( T &  inval,
const std::string name,
item caller,
T &&  stdval 
)
inline

Adds an optional value that will be placed in inval if the item does not exist

Parameters
stdvalThe value that inval is set to if the passed item does not exist

Definition at line 111 of file input.h.

Here is the call graph for this function:

template<class T >
void input::retrieve ( T &  inval,
const std::string name,
item caller,
const T &  stdval 
)
inline

Definition at line 121 of file input.h.

Here is the call graph for this function:

template<class T >
void input::retrieve_notrack ( T &  inval,
const std::string name 
)
inline

Retrieves a value without tracking the caller. This is not reccomended since it prevents variable changes from being broadcasted to the caller

See Also
input::retrieve

Definition at line 139 of file input.h.

Here is the call graph for this function:

template<class T >
void input::retrieve_notrack ( T &  inval,
const std::string name,
T &&  stdval 
)
inline

Non-tracking retrieve with standard value

See Also
input::retrieve

Definition at line 147 of file input.h.

Here is the call graph for this function:

template<class T >
void input::retrieve_notrack ( T &  inval,
const std::string name,
const T &  stdval 
)
inline

Non-tracking retrieve with standard value

See Also
input::retrieve

Definition at line 156 of file input.h.

Here is the call graph for this function:

Friends And Related Function Documentation

void eval_lisp ( std::string  in_cmd,
input inv 
)
friend

Member Data Documentation

std::map<std::string, item_wrapper>* input::invals
private

Points to the actual map of input values.

Definition at line 36 of file input.h.

std::map<std::string, item_wrapper> input::re_directions
private

Re-directs an input value to a locally defined item.

Definition at line 39 of file input.h.

std::map<std::string, std::string> input::re_mappings
private

Re-directs one name to another.

Definition at line 42 of file input.h.


The documentation for this class was generated from the following files: