Shiokaze Framework
A research-oriented fluid solver for computer graphics
configuration Class Reference

Class that controls the settings of the program. More...

#include <configuration.h>

Inheritance diagram for configuration:
cmdparser

Classes

struct  auto_group
 Class that automates the push and pop groups. More...
 

Public Member Functions

 configuration ()
 Default constructor for configuration.
 
 configuration (std::map< std::string, std::string > dictionary)
 Constructor for configuration. More...
 
void print_variables () const
 Print the currently set parameters.
 
void print_help () const
 Print a help manual of the currently set parameters.
 
void print_splash () const
 Print splash greeting messsages.
 
void check_touched () const
 Check if all the parameters are loaded by the program. More...
 
bool is_parameter_set (std::string name) const
 Check if a parameter with the name is set via command line. More...
 
bool check_set (std::string name) const
 Check if a parameter with the name is set. More...
 
std::string get_current_group_name (bool argument_name=false) const
 Get the name of the currently focused group (or argument name). More...
 
bool stack_empty () const
 Get if the group stack is empty. More...
 
void push_group (const credit &info)
 Push the group to the top of the group stack. More...
 
void push_group (std::string name, std::string argument_name="", std::string author="", std::string address="", std::tuple< int, int, int > date=std::tuple< int, int, int >(0, 0, 0), double version=0.0)
 Push the group to the top of the group stack. More...
 
void pop_group ()
 Remove the current group from the gruop stack.
 
bool get_integer (std::string name, int &value, std::string description=std::string())
 Get the integer parameter. More...
 
void set_integer (std::string name, int value)
 Set the integer parameter. More...
 
void set_default_integer (std::string name, int value)
 Set default integer parameter. More...
 
bool get_unsigned (std::string name, unsigned &value, std::string description=std::string())
 Get the unsigned integer parameter. More...
 
void set_unsigned (std::string name, unsigned value)
 Set the unsigned integer parameter. More...
 
void set_default_unsigned (std::string name, unsigned value)
 Set default unsgined integer parameter. More...
 
bool get_bool (std::string name, bool &value, std::string description=std::string())
 Get the boolean parameter. More...
 
void set_bool (std::string name, bool value)
 Set the boolean parameter. More...
 
void set_default_bool (std::string name, bool value)
 Set default boolean parameter. More...
 
double get_double (std::string name, double &value, std::string description=std::string())
 Get the parameter of double type. More...
 
void set_double (std::string name, double value)
 Set the parameter of double type. More...
 
void set_default_double (std::string name, double value)
 Set default parameter of double type. More...
 
bool get_real (std::string name, Real &value, std::string description=std::string())
 Get the parameter of Real type. More...
 
void set_real (std::string name, Real value)
 Set the parameter of Real type. More...
 
void set_default_real (std::string name, Real value)
 Set default parameter of Real type. More...
 
bool get_vec2i (std::string name, int value[2], std::string description=std::string())
 Get the parameter of vec2i type. More...
 
void set_vec2i (std::string name, const int value[2])
 Set the parameter of vec2i type. More...
 
void set_default_vec2i (std::string name, const int value[2])
 Set default parameter of vec2i type. More...
 
bool get_vec2d (std::string name, double value[2], std::string description=std::string())
 Get the parameter of vec2d type. More...
 
void set_vec2d (std::string name, const double value[2])
 Set the parameter of vec2d type. More...
 
void set_default_vec2d (std::string name, const double value[2])
 Set default parameter of vec2d type. More...
 
bool get_vec3i (std::string name, int value[3], std::string description=std::string())
 Get the parameter of vec3i type. More...
 
void set_vec3i (std::string name, const int value[3])
 Set the parameter of vec3i type. More...
 
void set_default_vec3i (std::string name, const int value[3])
 Set default parameter of vec3i type. More...
 
bool get_vec3d (std::string name, double value[3], std::string description=std::string())
 Get the parameter of vec3d type. More...
 
void set_vec3d (std::string name, const double value[3])
 Set the parameter of vec3d type. More...
 
void set_default_vec3d (std::string name, const double value[3])
 Set default parameter of vec3d type. More...
 
bool get_vec4d (std::string name, double value[4], std::string description=std::string())
 Get the parameter of vec4d type. More...
 
void set_vec4d (std::string name, const double value[4])
 Set the parameter of vec4d type. More...
 
void set_default_vec4d (std::string name, const double value[4])
 Set default parameter of vec4d type. More...
 
bool get_string (std::string name, std::string &value, std::string description=std::string())
 Get the string parameter. More...
 
void set_string (std::string name, std::string value)
 Set string parameter. More...
 
void set_default_string (std::string name, std::string value)
 Set default string parameter. More...
 
bool exist (std::string name) const
 Get if the parameter of the input name exists. More...
 
const std::map< std::string, std::string > & get_dictionary () const
 Get the dictionary of parameter. More...
 

Static Public Member Functions

static void print_bar (std::string str="")
 Print the input message surrounded by --—.
 
static void print_center (std::string str)
 Print the input message at the center of the line.
 

Detailed Description

Class that controls the settings of the program.

Constructor & Destructor Documentation

◆ configuration()

configuration::configuration ( std::map< std::string, std::string >  dictionary)

Constructor for configuration.

Parameters
[in]dictionaryList of parameters.

Member Function Documentation

◆ check_set()

bool configuration::check_set ( std::string  name) const

Check if a parameter with the name is set.

Parameters
[in]nameName of parameter.
Returns
true if all the name with parameter is set. false otherwise.

◆ check_touched()

void configuration::check_touched ( ) const

Check if all the parameters are loaded by the program.

Returns
true if all the parameters are loaded. false otherwise.

◆ exist()

bool configuration::exist ( std::string  name) const

Get if the parameter of the input name exists.

Parameters
[in]nameName of the parameter.
Returns
true if the parameter exists false otherwise.

◆ get_bool()

bool configuration::get_bool ( std::string  name,
bool &  value,
std::string  description = std::string() 
)

Get the boolean parameter.

Parameters
[in]nameName of the parameter.
[out]valueOutput value.
[in]descriptionDescription of the parameter.

◆ get_current_group_name()

std::string configuration::get_current_group_name ( bool  argument_name = false) const

Get the name of the currently focused group (or argument name).

Parameters
[in]argument_nameRequest argument name.
Returns
The name of the current group (or argument name).

◆ get_dictionary()

const std::map<std::string,std::string>& configuration::get_dictionary ( ) const
inline

Get the dictionary of parameter.

Returns
The list of parameters.

◆ get_double()

double configuration::get_double ( std::string  name,
double &  value,
std::string  description = std::string() 
)

Get the parameter of double type.

Parameters
[in]nameName of the parameter.
[out]valueOutput value.
[in]descriptionDescription of the parameter.

◆ get_integer()

bool configuration::get_integer ( std::string  name,
int &  value,
std::string  description = std::string() 
)

Get the integer parameter.

Parameters
[in]nameName of the parameter.
[out]valueOutput value.
[in]descriptionDescription of the parameter.

◆ get_real()

bool configuration::get_real ( std::string  name,
Real value,
std::string  description = std::string() 
)

Get the parameter of Real type.

Parameters
[in]nameName of the parameter.
[out]valueOutput value.
[in]descriptionDescription of the parameter.

◆ get_string()

bool configuration::get_string ( std::string  name,
std::string &  value,
std::string  description = std::string() 
)

Get the string parameter.

Parameters
[in]nameName of the parameter.
[out]valueOutput value.
[in]descriptionDescription of the parameter.

◆ get_unsigned()

bool configuration::get_unsigned ( std::string  name,
unsigned &  value,
std::string  description = std::string() 
)

Get the unsigned integer parameter.

Parameters
[in]nameName of the parameter.
[out]valueOutput value.
[in]descriptionDescription of the parameter.

◆ get_vec2d()

bool configuration::get_vec2d ( std::string  name,
double  value[2],
std::string  description = std::string() 
)

Get the parameter of vec2d type.

Parameters
[in]nameName of the parameter.
[out]valueOutput value.
[in]descriptionDescription of the parameter.

◆ get_vec2i()

bool configuration::get_vec2i ( std::string  name,
int  value[2],
std::string  description = std::string() 
)

Get the parameter of vec2i type.

Parameters
[in]nameName of the parameter.
[out]valueOutput value.
[in]descriptionDescription of the parameter.

◆ get_vec3d()

bool configuration::get_vec3d ( std::string  name,
double  value[3],
std::string  description = std::string() 
)

Get the parameter of vec3d type.

Parameters
[in]nameName of the parameter.
[out]valueOutput value.
[in]descriptionDescription of the parameter.

◆ get_vec3i()

bool configuration::get_vec3i ( std::string  name,
int  value[3],
std::string  description = std::string() 
)

Get the parameter of vec3i type.

Parameters
[in]nameName of the parameter.
[out]valueOutput value.
[in]descriptionDescription of the parameter.

◆ get_vec4d()

bool configuration::get_vec4d ( std::string  name,
double  value[4],
std::string  description = std::string() 
)

Get the parameter of vec4d type.

Parameters
[in]nameName of the parameter.
[out]valueOutput value.
[in]descriptionDescription of the parameter.

◆ is_parameter_set()

bool configuration::is_parameter_set ( std::string  name) const

Check if a parameter with the name is set via command line.

Parameters
[in]nameName of parameter.
Returns
true if all the name with parameter is set. false otherwise.

◆ push_group() [1/2]

void configuration::push_group ( const credit info)

Push the group to the top of the group stack.

Parameters
[in]infoAn instance of credit from which group information is extracted.

◆ push_group() [2/2]

void configuration::push_group ( std::string  name,
std::string  argument_name = "",
std::string  author = "",
std::string  address = "",
std::tuple< int, int, int >  date = std::tuple< int, int, int >(0, 0, 0),
double  version = 0.0 
)

Push the group to the top of the group stack.

Parameters
[in]nameName of the group.
[in]argument_nameArgument name of the group.
[in]authorAuthor of the corresponding group.
[in]addressEmail address of the corresponding group.
[in]dateDate of the corresponding group.
[in]versionVersion of the group.

◆ set_bool()

void configuration::set_bool ( std::string  name,
bool  value 
)

Set the boolean parameter.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_default_bool()

void configuration::set_default_bool ( std::string  name,
bool  value 
)

Set default boolean parameter.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_default_double()

void configuration::set_default_double ( std::string  name,
double  value 
)

Set default parameter of double type.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_default_integer()

void configuration::set_default_integer ( std::string  name,
int  value 
)

Set default integer parameter.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_default_real()

void configuration::set_default_real ( std::string  name,
Real  value 
)

Set default parameter of Real type.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_default_string()

void configuration::set_default_string ( std::string  name,
std::string  value 
)

Set default string parameter.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_default_unsigned()

void configuration::set_default_unsigned ( std::string  name,
unsigned  value 
)

Set default unsgined integer parameter.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_default_vec2d()

void configuration::set_default_vec2d ( std::string  name,
const double  value[2] 
)

Set default parameter of vec2d type.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_default_vec2i()

void configuration::set_default_vec2i ( std::string  name,
const int  value[2] 
)

Set default parameter of vec2i type.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_default_vec3d()

void configuration::set_default_vec3d ( std::string  name,
const double  value[3] 
)

Set default parameter of vec3d type.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_default_vec3i()

void configuration::set_default_vec3i ( std::string  name,
const int  value[3] 
)

Set default parameter of vec3i type.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_default_vec4d()

void configuration::set_default_vec4d ( std::string  name,
const double  value[4] 
)

Set default parameter of vec4d type.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_double()

void configuration::set_double ( std::string  name,
double  value 
)

Set the parameter of double type.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_integer()

void configuration::set_integer ( std::string  name,
int  value 
)

Set the integer parameter.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_real()

void configuration::set_real ( std::string  name,
Real  value 
)

Set the parameter of Real type.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_string()

void configuration::set_string ( std::string  name,
std::string  value 
)

Set string parameter.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_unsigned()

void configuration::set_unsigned ( std::string  name,
unsigned  value 
)

Set the unsigned integer parameter.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_vec2d()

void configuration::set_vec2d ( std::string  name,
const double  value[2] 
)

Set the parameter of vec2d type.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_vec2i()

void configuration::set_vec2i ( std::string  name,
const int  value[2] 
)

Set the parameter of vec2i type.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_vec3d()

void configuration::set_vec3d ( std::string  name,
const double  value[3] 
)

Set the parameter of vec3d type.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_vec3i()

void configuration::set_vec3i ( std::string  name,
const int  value[3] 
)

Set the parameter of vec3i type.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ set_vec4d()

void configuration::set_vec4d ( std::string  name,
const double  value[4] 
)

Set the parameter of vec4d type.

Parameters
[in]nameName of the parameter.
[in]valueValue to set.

◆ stack_empty()

bool configuration::stack_empty ( ) const
inline

Get if the group stack is empty.

Returns
true if the stack is empty. false otherwise.

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