Class xlifepp::Parameters#
-
class Parameters#
-
Collaboration diagram for xlifepp::Parameters:
encapsulates a list of Parameter’s.
creation:
Parameter height=3; Parameters data; data << height << Parameter(4,"width") << "case 1" << 1.5;
string_t “case 1” has default name “parameter3” real_t “1.5” has default name “parameter4”
usage:
Parameter a=data("height"); // access by name, contains height Parameter c=data(4); // access by rank, contains 1.5 data(1)= 2; // replace the value 3 by 2 data("height")=2; // same effect data(height)=2; // same effect, caution here as object height is hereafter modified double x=data(4); // x contains 1.5 x=data("width"); // x contains 4
No deletion of list element is possible No algebraic operations are performed on Parameters Automatic parameter naming is a crutch for tired users, it is advised that the user manages names of parameters:
Parameter height=3; Parameter width=4; Parameter wavenumber=1.5; Parameter comment="case 1"; Parameters data; data << height << width << wavenumber << comment;
Public Functions
-
Parameters()#
-
default constructor
-
Parameters(const Parameters&)#
-
copy constructor with full copy behavior
-
template<typename T>
inline Parameters(const T &t, const string_t &nm, const Strings &snm)#
-
constructor with T type
-
template<typename T>
inline Parameters(const T &t, const string_t &nm = string_t(""), const string_t &snm = string_t(""))#
-
constructor with T type
-
Parameters(const void*, const string_t &nm = string_t(""), const string_t &snm = string_t(""))#
-
constructor with a void pointer
-
~Parameters()#
-
destructor
-
template<typename K>
inline void add(const string_t &name, const K &value)#
-
adds a parameter by its name and value
-
inline void associateVector(const string_t &un, number_t d = 3)#
-
associate to the parameters a vector
-
bool contains(const Parameter&) const#
-
check whether Parameter is in Parameters
-
bool contains(const Parameter*) const#
-
check whether Parameter is in Parameters
-
template<typename K>
inline K get(const char *name, K value)#
-
gets a parameter from a name (non const)
-
template<typename K>
inline K get(const char *name, K value) const#
-
gets a parameter from a name (const)
-
template<typename K>
inline K get(const string_t &name, K value)#
-
gets a parameter from a name (non const)
-
template<typename K>
inline K get(const string_t &name, K value) const#
-
gets a parameter from a name (const)
-
inline const Vector<real_t> &getVector(const string_t &un) const#
-
get unitary vector (“_n”,”_nx”,”_ny”,…)
-
inline const Vector<real_t> &getVector(UnitaryVector uv) const#
-
get unitary vector (_n,_nx,_ny,…)
-
Parameters &operator<<(const Parameter&)#
-
insert a parameter into list via stream
-
Parameters &operator<<(const void*)#
-
insert a void pointer into list via stream
-
Parameters &operator<<(Parameter&)#
-
insert a parameter into list via stream
-
Parameters &operator<<(Parameter*)#
-
insert a parameter into list via stream
-
Parameters &operator=(const Parameters &pars)#
-
assign operator with full copy behavior
-
void push(const Parameters&)#
-
append a list of parameters
-
int safeInt(const string_t &s, int def = 0) const#
-
special safe access to some internal int parameters, return def value if not exist
special safe access to some int parameters
Public Members
-
bool freeParams_#
-
flag to delete parameter pointers
Friends
-
friend std::ostream &operator<<(std::ostream&, const Parameters&)#
-
flux insertion (write)
-
Parameters()#