The DebugHelper class is responsible for debug output. More...
#include <DebugHelper.hpp>
Public Types | |
enum | DebugLevel { PARAMETERS = 1, RATING = 2, ROBOT_MODEL = 4, MAP = 8, IK_RATING = 16 } |
Public Member Functions | |
unsigned int | getLevel () |
returns the debug level that is set | |
std::string | getLevelString () |
returns the debug levels that are set as string | |
void | setLevels (std::string levelsStr) |
sets levels from the given string | |
void | setLevels () |
sets the allowed debug levels | |
void | write (const char *text, DebugLevel level) |
writes the text to the console if it has a level that allows it | |
void | write (const std::string &text, DebugLevel level) |
writes the text to the console if it has a level that allows it | |
void | write (const std::ostream &text, DebugLevel level) |
writes the text to the console if it has a level that allows it | |
void | writeNoticeably (const char *text, DebugLevel level) |
writes the text noticeably to the console if it has a level that allows it | |
void | writeNoticeably (const std::string &text, DebugLevel level) |
writes the text noticeably to the console if it has a level that allows it | |
void | writeNoticeably (const std::ostream &text, DebugLevel level) |
writes the text noticeably to the console if it has a level that allows it | |
Static Public Member Functions | |
static boost::shared_ptr < DebugHelper > | getInstance () |
Private Member Functions | |
bool | checkLevel (DebugLevel level) |
checks whether the given level is allowed | |
DebugHelper () | |
Static Private Member Functions | |
static void | addToString (std::string &s, const std::string &add) |
adds a string to a given string s. Puts a comma between them if the string s has a size bigger than 0. | |
static int | parseLevels (std::vector< std::string > levels) |
parses the level list to the corresponding integer | |
Private Attributes | |
unsigned int | mLevels |
ros::NodeHandle | mNodeHandle |
Static Private Attributes | |
static const int | ALL |
static boost::shared_ptr < DebugHelper > | instancePtr |
static const int | NONE = 0 |
The DebugHelper class is responsible for debug output.
Definition at line 32 of file DebugHelper.hpp.
Definition at line 36 of file DebugHelper.hpp.
robot_model_services::DebugHelper::DebugHelper | ( | ) | [private] |
Definition at line 35 of file DebugHelper.cpp.
void robot_model_services::DebugHelper::addToString | ( | std::string & | s, |
const std::string & | add | ||
) | [static, private] |
adds a string to a given string s. Puts a comma between them if the string s has a size bigger than 0.
s | [in,out] the string |
add | [in] the string to add |
Definition at line 177 of file DebugHelper.cpp.
bool robot_model_services::DebugHelper::checkLevel | ( | DebugLevel | level | ) | [private] |
checks whether the given level is allowed
level | the level |
Definition at line 118 of file DebugHelper.cpp.
boost::shared_ptr< DebugHelper > robot_model_services::DebugHelper::getInstance | ( | ) | [static] |
Definition at line 29 of file DebugHelper.cpp.
unsigned int robot_model_services::DebugHelper::getLevel | ( | ) |
returns the debug level that is set
Definition at line 86 of file DebugHelper.cpp.
std::string robot_model_services::DebugHelper::getLevelString | ( | ) |
returns the debug levels that are set as string
Definition at line 91 of file DebugHelper.cpp.
int robot_model_services::DebugHelper::parseLevels | ( | std::vector< std::string > | levels | ) | [static, private] |
parses the level list to the corresponding integer
levels | the list of level strings |
Definition at line 140 of file DebugHelper.cpp.
void robot_model_services::DebugHelper::setLevels | ( | std::string | levelsStr | ) |
sets levels from the given string
levelsStr | the string, comma seperated list of levels, which may contain [] braces |
Definition at line 128 of file DebugHelper.cpp.
sets the allowed debug levels
Definition at line 122 of file DebugHelper.cpp.
void robot_model_services::DebugHelper::write | ( | const char * | text, |
DebugHelper::DebugLevel | level | ||
) |
writes the text to the console if it has a level that allows it
text | the text |
level | the debug level of the text |
Definition at line 40 of file DebugHelper.cpp.
void robot_model_services::DebugHelper::write | ( | const std::string & | text, |
DebugLevel | level | ||
) |
writes the text to the console if it has a level that allows it
text | the text |
level | the debug level of the text |
Definition at line 47 of file DebugHelper.cpp.
void robot_model_services::DebugHelper::write | ( | const std::ostream & | text, |
DebugLevel | level | ||
) |
writes the text to the console if it has a level that allows it
text | the text |
level | the debug level of the text |
Definition at line 53 of file DebugHelper.cpp.
void robot_model_services::DebugHelper::writeNoticeably | ( | const char * | text, |
DebugHelper::DebugLevel | level | ||
) |
writes the text noticeably to the console if it has a level that allows it
text | the text |
level | the debug level of the text |
Definition at line 61 of file DebugHelper.cpp.
void robot_model_services::DebugHelper::writeNoticeably | ( | const std::string & | text, |
DebugHelper::DebugLevel | level | ||
) |
writes the text noticeably to the console if it has a level that allows it
text | the text |
level | the debug level of the text |
Definition at line 70 of file DebugHelper.cpp.
void robot_model_services::DebugHelper::writeNoticeably | ( | const std::ostream & | text, |
DebugHelper::DebugLevel | level | ||
) |
writes the text noticeably to the console if it has a level that allows it
text | the text |
level | the debug level of the text |
Definition at line 77 of file DebugHelper.cpp.
const int robot_model_services::DebugHelper::ALL [static, private] |
PARAMETERS + RATING + ROBOT_MODEL + MAP + IK_RATING
Definition at line 47 of file DebugHelper.hpp.
boost::shared_ptr< DebugHelper > robot_model_services::DebugHelper::instancePtr [static, private] |
Definition at line 46 of file DebugHelper.hpp.
unsigned int robot_model_services::DebugHelper::mLevels [private] |
Definition at line 52 of file DebugHelper.hpp.
Definition at line 51 of file DebugHelper.hpp.
const int robot_model_services::DebugHelper::NONE = 0 [static, private] |
Definition at line 49 of file DebugHelper.hpp.