Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Parameters Class Reference

Class for parameters. More...

#include <parameters.h>

Public Member Functions

 Parameters ()
 
virtual ~Parameters ()
 
void set_bool (const string &key, const bool value)
 
void set_double (const string &key, const double value)
 
void set_int (const string &key, const int value)
 
void set_string (const string &key, const string &value)
 
void set_double_vector (const string &key, const vector< double > &value)
 
void set_int_vector (const string &key, const vector< int > &value)
 
void set_string_vector (const string &key, const vector< string > &value)
 
void set_Parameters (const string &key, const Parameters &value)
 
void set_VerboseLevel (const Bridge::VerboseLevel value)
 
double get_double (const string &key) const
 
int get_int (const string &key) const
 
unsigned long get_unsigned_long (const string &key) const
 
string get_string (const string &key) const
 
bool get_bool (const string &key) const
 
vector< double > get_double_vector (const string &key) const
 
vector< int > get_int_vector (const string &key) const
 
vector< string > get_string_vector (const string &key) const
 
Parameters get_Parameters (const string &key) const
 
Parametersget_Parameters (const string &key)
 
Bridge::VerboseLevel get_VerboseLevel () const
 
Parameters lookup (const string &key) const
 
Parameterslookup (const string &key)
 
int fetch_double (const string &key, double &value) const
 
int fetch_int (const string &key, int &value) const
 
int fetch_unsigned_long (const string &key, unsigned long &value) const
 
int fetch_string (const string &key, string &value) const
 
int fetch_bool (const string &key, bool &value) const
 
int fetch_double_vector (const string &key, vector< double > &value) const
 
int fetch_int_vector (const string &key, vector< int > &value) const
 
int fetch_string_vector (const string &key, vector< string > &value) const
 
int fetch_VerboseLevel (Bridge::VerboseLevel &value) const
 
bool find_double (const string &key) const
 
bool find_int (const string &key) const
 
bool find_unsigned_long (const string &key) const
 
bool find_string (const string &key) const
 
bool find_bool (const string &key) const
 
bool find_double_vector (const string &key) const
 
bool find_int_vector (const string &key) const
 
bool find_string_vector (const string &key) const
 
bool find_Parameters (const string &key) const
 
bool is_set (const string &key) const
 
void Register_double (const string &key, const double defvalue)
 
void Register_int (const string &key, const int defvalue)
 
void Register_string (const string &key, const string &defvalue)
 
void Register_double_vector (const string &key, const vector< double > &defvalue)
 
void Register_int_vector (const string &key, const vector< int > &defvalue)
 
void Register_string_vector (const string &key, const vector< string > &defvalue)
 
void Register_Parameters (const string &key, const Parameters &defvalue)
 
void Register_Parameters (const string &key, Parameters *const defvalue)
 
void Register_Parameters (const string &key, const unique_ptr< Parameters > &defvalue)
 
void print (const string &indent="") const
 

Static Public Member Functions

template<typename T >
static string to_string (const vector< T > &v)
 

Static Public Attributes

static const std::string class_name = "Parameters"
 

Private Member Functions

double convert_to_double (const string &) const
 
vector< double > convert_to_double (const vector< string > &) const
 
int convert_to_int (const string &) const
 
vector< int > convert_to_int (const vector< string > &) const
 
bool convert_to_bool (const string &) const
 
bool convert_to_bool (int) const
 

Private Attributes

map< string, double > m_map_double
 
map< string, int > m_map_int
 
map< string, string > m_map_string
 
map< string, vector< double > > m_map_double_vector
 
map< string, vector< int > > m_map_int_vector
 
map< string, vector< string > > m_map_string_vector
 
map< string, Parametersm_map_parameters
 
Bridge::VerboseLevel m_vlevel
 

Detailed Description

Class for parameters.

Base class of Parameters. This class gives general basis of structured parameter sets. [17 Jul 2012 H.Matsufuru] fetch is modified to return int, instead of bool in the original Aoyama-san's code. [16 Jun 2013 Y.Namekawa]

Renewed to be a parameter container. [25 June 2016 T.Aoyama] Add set_bool [26 Dec 2018 Y.Namekawa]

Definition at line 46 of file parameters.h.

Constructor & Destructor Documentation

Parameters::Parameters ( )

Definition at line 22 of file parameters.cpp.

virtual Parameters::~Parameters ( )
inlinevirtual

Definition at line 53 of file parameters.h.

Member Function Documentation

bool Parameters::convert_to_bool ( const string &  value) const
private

Definition at line 148 of file parameters.cpp.

bool Parameters::convert_to_bool ( int  value) const
private

Definition at line 168 of file parameters.cpp.

double Parameters::convert_to_double ( const string &  value) const
private

Definition at line 66 of file parameters.cpp.

vector< double > Parameters::convert_to_double ( const vector< string > &  value) const
private

Definition at line 72 of file parameters.cpp.

int Parameters::convert_to_int ( const string &  value) const
private

Definition at line 119 of file parameters.cpp.

vector< int > Parameters::convert_to_int ( const vector< string > &  value) const
private

Definition at line 132 of file parameters.cpp.

int Parameters::fetch_bool ( const string &  key,
bool &  value 
) const

Definition at line 391 of file parameters.cpp.

int Parameters::fetch_double ( const string &  key,
double &  value 
) const

Definition at line 327 of file parameters.cpp.

int Parameters::fetch_double_vector ( const string &  key,
vector< double > &  value 
) const

Definition at line 410 of file parameters.cpp.

int Parameters::fetch_int ( const string &  key,
int &  value 
) const

Definition at line 346 of file parameters.cpp.

int Parameters::fetch_int_vector ( const string &  key,
vector< int > &  value 
) const

Definition at line 429 of file parameters.cpp.

int Parameters::fetch_string ( const string &  key,
string &  value 
) const

Definition at line 378 of file parameters.cpp.

int Parameters::fetch_string_vector ( const string &  key,
vector< string > &  value 
) const

Definition at line 448 of file parameters.cpp.

int Parameters::fetch_unsigned_long ( const string &  key,
unsigned long &  value 
) const

Definition at line 365 of file parameters.cpp.

int Parameters::fetch_VerboseLevel ( Bridge::VerboseLevel value) const

Definition at line 461 of file parameters.cpp.

bool Parameters::find_bool ( const string &  key) const

Definition at line 513 of file parameters.cpp.

bool Parameters::find_double ( const string &  key) const

Definition at line 497 of file parameters.cpp.

bool Parameters::find_double_vector ( const string &  key) const

Definition at line 516 of file parameters.cpp.

bool Parameters::find_int ( const string &  key) const

Definition at line 500 of file parameters.cpp.

bool Parameters::find_int_vector ( const string &  key) const

Definition at line 519 of file parameters.cpp.

bool Parameters::find_Parameters ( const string &  key) const

Definition at line 525 of file parameters.cpp.

bool Parameters::find_string ( const string &  key) const

Definition at line 510 of file parameters.cpp.

bool Parameters::find_string_vector ( const string &  key) const

Definition at line 522 of file parameters.cpp.

bool Parameters::find_unsigned_long ( const string &  key) const

Definition at line 503 of file parameters.cpp.

bool Parameters::get_bool ( const string &  key) const

Definition at line 233 of file parameters.cpp.

double Parameters::get_double ( const string &  key) const

Definition at line 175 of file parameters.cpp.

vector< double > Parameters::get_double_vector ( const string &  key) const

Definition at line 250 of file parameters.cpp.

int Parameters::get_int ( const string &  key) const

Definition at line 192 of file parameters.cpp.

vector< int > Parameters::get_int_vector ( const string &  key) const

Definition at line 267 of file parameters.cpp.

Parameters Parameters::get_Parameters ( const string &  key) const

Definition at line 296 of file parameters.cpp.

Parameters & Parameters::get_Parameters ( const string &  key)

Definition at line 308 of file parameters.cpp.

string Parameters::get_string ( const string &  key) const

Definition at line 221 of file parameters.cpp.

vector< string > Parameters::get_string_vector ( const string &  key) const

Definition at line 284 of file parameters.cpp.

unsigned long Parameters::get_unsigned_long ( const string &  key) const

Definition at line 209 of file parameters.cpp.

Bridge::VerboseLevel Parameters::get_VerboseLevel ( ) const

Definition at line 320 of file parameters.cpp.

bool Parameters::is_set ( const string &  key) const

Definition at line 528 of file parameters.cpp.

Parameters Parameters::lookup ( const string &  key) const
inline

Definition at line 79 of file parameters.h.

Parameters& Parameters::lookup ( const string &  key)
inline

Definition at line 80 of file parameters.h.

void Parameters::print ( const string &  indent = "") const

Definition at line 544 of file parameters.cpp.

void Parameters::Register_double ( const string &  key,
const double  defvalue 
)

Definition at line 469 of file parameters.cpp.

void Parameters::Register_double_vector ( const string &  key,
const vector< double > &  defvalue 
)

Definition at line 478 of file parameters.cpp.

void Parameters::Register_int ( const string &  key,
const int  defvalue 
)

Definition at line 472 of file parameters.cpp.

void Parameters::Register_int_vector ( const string &  key,
const vector< int > &  defvalue 
)

Definition at line 481 of file parameters.cpp.

void Parameters::Register_Parameters ( const string &  key,
const Parameters defvalue 
)

Definition at line 487 of file parameters.cpp.

void Parameters::Register_Parameters ( const string &  key,
Parameters *const  defvalue 
)

Definition at line 490 of file parameters.cpp.

void Parameters::Register_Parameters ( const string &  key,
const unique_ptr< Parameters > &  defvalue 
)

Definition at line 493 of file parameters.cpp.

void Parameters::Register_string ( const string &  key,
const string &  defvalue 
)

Definition at line 475 of file parameters.cpp.

void Parameters::Register_string_vector ( const string &  key,
const vector< string > &  defvalue 
)

Definition at line 484 of file parameters.cpp.

void Parameters::set_bool ( const string &  key,
const bool  value 
)

Definition at line 30 of file parameters.cpp.

void Parameters::set_double ( const string &  key,
const double  value 
)

Definition at line 33 of file parameters.cpp.

void Parameters::set_double_vector ( const string &  key,
const vector< double > &  value 
)

Definition at line 42 of file parameters.cpp.

void Parameters::set_int ( const string &  key,
const int  value 
)

Definition at line 36 of file parameters.cpp.

void Parameters::set_int_vector ( const string &  key,
const vector< int > &  value 
)

Definition at line 45 of file parameters.cpp.

void Parameters::set_Parameters ( const string &  key,
const Parameters value 
)

Definition at line 51 of file parameters.cpp.

void Parameters::set_string ( const string &  key,
const string &  value 
)

Definition at line 39 of file parameters.cpp.

void Parameters::set_string_vector ( const string &  key,
const vector< string > &  value 
)

Definition at line 48 of file parameters.cpp.

void Parameters::set_VerboseLevel ( const Bridge::VerboseLevel  value)

Definition at line 54 of file parameters.cpp.

template<typename T >
static string Parameters::to_string ( const vector< T > &  v)
inlinestatic

Definition at line 145 of file parameters.h.

Member Data Documentation

const std::string Parameters::class_name = "Parameters"
static

Definition at line 49 of file parameters.h.

map<string, double> Parameters::m_map_double
private

Definition at line 117 of file parameters.h.

map<string, vector<double> > Parameters::m_map_double_vector
private

Definition at line 121 of file parameters.h.

map<string, int> Parameters::m_map_int
private

Definition at line 118 of file parameters.h.

map<string, vector<int> > Parameters::m_map_int_vector
private

Definition at line 122 of file parameters.h.

map<string, Parameters> Parameters::m_map_parameters
private

Definition at line 125 of file parameters.h.

map<string, string> Parameters::m_map_string
private

Definition at line 119 of file parameters.h.

map<string, vector<string> > Parameters::m_map_string_vector
private

Definition at line 123 of file parameters.h.

Bridge::VerboseLevel Parameters::m_vlevel
private

Definition at line 127 of file parameters.h.


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