LifeV
|
I use standard constructor/destructors. More...
#include <Switch.hpp>
Public typedefs | |
typedef std::map< std::string, bool >::iterator | iterator_Type |
typedef std::map< std::string, bool >::const_iterator | iteratorConst_Type |
Public methods | |
bool | set (std::string const &a) |
It sets the switch It does NOT create a new switch (use create); Returns true if the switch s existed. More... | |
bool | set (const char *a) |
bool | unset (std::string const &a) |
It unsets the switch. More... | |
bool | unset (const char *a) |
bool | toggle (std::string const &a) |
It toggles the switch Returns true if the switch s existed. More... | |
bool | toggle (const char *a) |
void | create (std::string const &a, bool status=false) |
Creates a switch (default is OFF) It sets the switch if it is there. More... | |
void | create (const char *a, bool status=false) |
std::ostream & | showMe (bool verbose=false, std::ostream &out=std::cout) const |
bool | test (std::string const &a) const |
bool | test (const char *a) const |
std::pair< bool, bool > | status (std::string const &a) const |
std::pair< bool, bool > | status (const char *a) const |
I use standard constructor/destructors.
A better Switches class
Definition at line 50 of file Switch.hpp.
typedef std::map<std::string, bool>::iterator iterator_Type |
Definition at line 56 of file Switch.hpp.
typedef std::map<std::string, bool>::const_iterator iteratorConst_Type |
Definition at line 57 of file Switch.hpp.
bool set | ( | std::string const & | a | ) |
It sets the switch It does NOT create a new switch (use create); Returns true if the switch s existed.
Definition at line 46 of file Switch.cpp.
bool set | ( | const char * | a | ) |
Definition at line 61 of file Switch.cpp.
bool unset | ( | std::string const & | a | ) |
It unsets the switch.
It does NOT create a new switch (use create) Returns true if the switch s existed
Definition at line 68 of file Switch.cpp.
bool unset | ( | const char * | a | ) |
Definition at line 83 of file Switch.cpp.
bool toggle | ( | std::string const & | a | ) |
It toggles the switch Returns true if the switch s existed.
Definition at line 90 of file Switch.cpp.
bool toggle | ( | const char * | a | ) |
Definition at line 105 of file Switch.cpp.
void create | ( | std::string const & | a, |
bool | status = false |
||
) |
Creates a switch (default is OFF) It sets the switch if it is there.
Definition at line 112 of file Switch.cpp.
void create | ( | const char * | a, |
bool | status = false |
||
) |
std::ostream & showMe | ( | bool | verbose = false , |
std::ostream & | out = std::cout |
||
) | const |
bool test | ( | std::string const & | a | ) | const |
Returns the status of the switch: true-> set false-> unset or non existent. It does not distinguish between not existent and unset switches: use status if you want the full information
Definition at line 155 of file Switch.cpp.
bool test | ( | const char * | a | ) | const |
std::pair< bool, bool > status | ( | std::string const & | a | ) | const |
Returns a std::pair of bools : the first refers to the existence in the list of switches, the second on the status (true or false) If the first bool is false also the second is false
Definition at line 133 of file Switch.cpp.
std::pair< bool, bool > status | ( | const char * | a | ) | const |
Definition at line 147 of file Switch.cpp.