asl::ParametersManager Class Reference
Utilities

`#include <aslParametersManager.h>`

Inheritance diagram for asl::ParametersManager:
[legend]
Collaboration diagram for asl::ParametersManager:
[legend]

## 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 ()
| 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)
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...

## Detailed Description

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.

## Constructor & Destructor Documentation

## ParametersManager() [1/2]

asl::ParametersManager::ParametersManager | ( |  | ) |

## ~ParametersManager() [1/2]

asl::ParametersManager::~ParametersManager | ( |  | ) |

## ParametersManager() [2/2]

asl::ParametersManager::ParametersManager | ( |  | ) |

## ~ParametersManager() [2/2]

asl::ParametersManager::~ParametersManager | ( |  | ) |

## Member Function Documentation

## add() [1/6]

template<typename T >

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.

## add() [2/6]

template<typename T >

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.

## add() [3/6]

template<typename T >

void asl::ParametersManager::add | ( | UValue< T > | parameter,
|  | const char * | key,
|  | const char * | description,
|  | const char * | units
| ) |  |

Adds a Parameter to ParametersManager.

## add() [4/6]

template<typename T >

void asl::ParametersManager::add | ( | UValue< T > | parameter,
|  | const char * | key,
|  | const char * | description,
|  | const char * | units
| ) |  |

Adds a Parameter to ParametersManager.

## add() [5/6]

template<typename T >

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.

## add() [6/6]

template<typename T >

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.

## addPrefix() [1/2]

template<typename T >

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

## addPrefix() [2/2]

template<typename T >

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

## enable() [1/2]

void asl::ParametersManager::enable | ( |  | ) |

Enables parameter loader.

## enable() [2/2]

void asl::ParametersManager::enable | ( |  | ) |

Enables parameter loader.

## getDir() [1/2]

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)

Examples
  acousticWaves.cc, cubeGravity.cc, cubeIncompressibleGravity.cc, cubePoroelasticGravity.cc, jumpingBox.cc, multiphase_flow.cc, pitot_tube_ice.cc, poroelastic.cc, surfaceFlux.cc, testSMDiff.cc, testSMDiff3C.cc, testSMPhi.cc, and testSMPhiBV.cc.

## getDir() [2/2]

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)

## load() [1/2]

void asl::ParametersManager::load | ( | std::string | paramFile | ) |

Loads all previously declared parameters from parameters file `paramFile`

## load() [2/2]

void asl::ParametersManager::load | ( | std::string | paramFile | ) |

Loads all previously declared parameters from parameters file `paramFile`

## populateMaps() [1/2]

void asl::ParametersManager::populateMaps | ( | boost::program_options::variables_map & | vm | ) |

protected

## populateMaps() [2/2]

void asl::ParametersManager::populateMaps | ( | boost::program_options::variables_map & | vm | ) |

protected

## writeParametersFile() [1/2]

void asl::ParametersManager::writeParametersFile | ( | const std::string | fileName | ) |

protected

Wrties all parameters and their default values (if available) to the file `fileName`

## writeParametersFile() [2/2]

void asl::ParametersManager::writeParametersFile | ( | const std::string | fileName | ) |

protected

Wrties all parameters and their default values (if available) to the file `fileName`

## Member Data Documentation

## current

static ParametersManager * asl::ParametersManager::current

static

Definition at line 134 of file aslParametersManager.h.

## parametersFileDirectory

std::string asl::ParametersManager::parametersFileDirectory

protected

Definition at line 138 of file aslParametersManager.h.

## parametersFileStr

std::string asl::ParametersManager::parametersFileStr

protected

Content of the parameters file.

Definition at line 148 of file aslParametersManager.h.

## parametersOptions

boost::program_options::options_description asl::ParametersManager::parametersOptions

protected

Definition at line 137 of file aslParametersManager.h.

## prefixes

std::vector< std::shared_ptr< PrefixStore > > asl::ParametersManager::prefixes

protected

Accomodates prefixes (defined by attached "*" wildcard) using PrefixStore class

Definition at line 141 of file aslParametersManager.h.

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

- /build/asl-1Fw6fH/asl-0.1.7/debian/tmp/usr/include/ASL/utilities/aslParametersManager.h