Main class for IBSimu. More...
#include <ibsimu.hpp>
Public Member Functions | |
IBSimu () | |
Default constructor. More... | |
~IBSimu () | |
Default destructor. More... | |
std::ostream & | set_message_output (std::ostream &os) |
Set message output to stream os. More... | |
std::ostream & | set_message_output (const std::string &filename) |
Set message output to file filename. More... | |
std::ostream & | message (message_type_e type, int32_t level) |
Print message output. More... | |
std::ostream & | message (int32_t level) |
void | flush (bool finishlines=true) |
void | inc_indent (void) |
Increase message indentation. More... | |
void | dec_indent (void) |
Decrease message indentation. More... | |
bool | output_is_cout () |
Return if message output file is stdout. More... | |
void | set_message_threshold (message_type_e type, int32_t level) |
Set message threshold level. More... | |
int32_t | get_message_threshold (message_type_e type) |
Get message threshold level. More... | |
void | set_thread_count (uint32_t threadcount) |
Set the number of threads used for calculation. More... | |
uint32_t | get_thread_count (void) |
Get the number of threads used for calculation. More... | |
void | set_rng_type (rng_type_e type) |
Set the random number generator to use. More... | |
rng_type_e | get_rng_type (void) |
Get the random number generator type. More... | |
void | halt (void) |
Halt execution. More... | |
Detailed Description
Main class for IBSimu.
Used to store global settings. One instance of the class is initialized globally with the name ibsimu.
Constructor & Destructor Documentation
IBSimu::IBSimu | ( | ) |
Default constructor.
IBSimu::~IBSimu | ( | ) |
Default destructor.
Member Function Documentation
void IBSimu::dec_indent | ( | void | ) |
Decrease message indentation.
int32_t IBSimu::get_message_threshold | ( | message_type_e | type | ) |
Get message threshold level.
Values less than or equal to zero mean no output will be printed.
|
inline |
Get the random number generator type.
|
inline |
Get the number of threads used for calculation.
void IBSimu::halt | ( | void | ) |
Halt execution.
This function is called by the error handler in case of SIGTERM.
void IBSimu::inc_indent | ( | void | ) |
Increase message indentation.
std::ostream & IBSimu::message | ( | message_type_e | type, |
int32_t | level | ||
) |
Print message output.
Returns a reference to stream for output type and importance level. If level is larger than threshold the function returns a reference to nullstream and nothing will be printed.
bool IBSimu::output_is_cout | ( | ) |
Return if message output file is stdout.
std::ostream & IBSimu::set_message_output | ( | std::ostream & | os | ) |
Set message output to stream os.
Returns a reference to the old stream or nullstream if previous output file was a file opened by IBSimu.
std::ostream & IBSimu::set_message_output | ( | const std::string & | filename | ) |
Set message output to file filename.
Returns a reference to the old output stream or nullstream if previous output file was a file opened by IBSimu. If output stream is redefined after using this function, the file will be automatically closed. The file will also be closed when the IBSimu object is destructed.
void IBSimu::set_message_threshold | ( | message_type_e | type, |
int32_t | level | ||
) |
Set message threshold level.
Only messages with level lower than or equal to the threshold will be printed. A value of 1 is used for standard amount of output. Value of 2 for extended amount of output. Message threshold for MSG_VERBOSE defaults to 0 (no output), MSG_ERROR and MSG_WARNING default to 1. For enabling the debug messages, the library has to be compiled with debugging enabled.
void IBSimu::set_rng_type | ( | rng_type_e | type | ) |
Set the random number generator to use.
The default rng type RNG_SOBOL is a quasi random number generator based on use of Sobol sequence. This setting affects particle distribution definitions.
void IBSimu::set_thread_count | ( | uint32_t | threadcount | ) |
Set the number of threads used for calculation.
The documentation for this class was generated from the following files: