ASL
0.1.7
Advanced Simulation Library
|
#include <aslParametersManager.h>
Public Member Functions | |
ParametersManager () | |
~ParametersManager () | |
void | enable () |
Enables parameter loader. More... | |
template<typename T > | |
void | add (UValue< T > parameter, const char *key, const char *description, const char *units) |
Adds a Parameter to ParametersManager. More... | |
template<typename T > | |
void | add (UValue< std::map< std::string, T >> parameter, const char *key, const char *description, const char *units) |
Adds a group of parameters with common prefix to ParametersManager. More... | |
template<typename T > | |
void | add (UValue< T > parameter, T defaultValue, const char *key, const char *description, const char *units) |
Adds a Parameter with a default value to ParametersManager. More... | |
template<typename T > | |
void | addPrefix (const std::string prefix, std::shared_ptr< std::map< std::string, T >> destinationMap) |
void | load (std::string paramFile) |
std::string | getDir () |
Static Public Attributes | |
static ParametersManager * | current |
Protected Member Functions | |
void | populateMaps (boost::program_options::variables_map &vm) |
void | writeParametersFile (const std::string fileName) |
Protected Attributes | |
boost::program_options::options_description | parametersOptions |
std::string | parametersFileDirectory |
std::vector< std::shared_ptr< PrefixStore > > | prefixes |
std::string | parametersFileStr |
Content of the parameters file. More... | |
This class automatically accomodates newly created Parameters and then can load them from a parameters file. It has to be declared before declaring all the parameters it will manage!
Definition at line 97 of file aslParametersManager.h.
asl::ParametersManager::ParametersManager | ( | ) |
asl::ParametersManager::~ParametersManager | ( | ) |
void asl::ParametersManager::add | ( | UValue< T > | parameter, |
const char * | key, | ||
const char * | description, | ||
const char * | units | ||
) |
Adds a Parameter to ParametersManager.
void asl::ParametersManager::add | ( | UValue< std::map< std::string, T >> | parameter, |
const char * | key, | ||
const char * | description, | ||
const char * | units | ||
) |
Adds a group of parameters with common prefix to ParametersManager.
void asl::ParametersManager::add | ( | UValue< T > | parameter, |
T | defaultValue, | ||
const char * | key, | ||
const char * | description, | ||
const char * | units | ||
) |
Adds a Parameter with a default value to ParametersManager.
void asl::ParametersManager::addPrefix | ( | const std::string | prefix, |
std::shared_ptr< std::map< std::string, T >> | destinationMap | ||
) |
Adds prefix and the pointer on the respective Parameter's destinationMap
void asl::ParametersManager::enable | ( | ) |
Enables parameter loader.
std::string asl::ParametersManager::getDir | ( | ) |
Get the parameters file directory (absolute, with ending slash). It is convenient to write simulation results output together with its respective parameters file into the same directory (whose name might reflect the specifics of the parameters used)
void asl::ParametersManager::load | ( | std::string | paramFile | ) |
Loads all previously declared parameters from parameters file paramFile
|
protected |
|
protected |
Wrties all parameters and their default values (if available) to the file fileName
|
static |
Definition at line 134 of file aslParametersManager.h.
|
protected |
Definition at line 138 of file aslParametersManager.h.
|
protected |
Content of the parameters file.
Definition at line 148 of file aslParametersManager.h.
|
protected |
Definition at line 137 of file aslParametersManager.h.
|
protected |
Accomodates prefixes (defined by attached "*" wildcard) using PrefixStore class
Definition at line 141 of file aslParametersManager.h.