Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
world_model::DebugHelper Class Reference

The DebugHelper class is responsible for debug output. More...

#include <debug_helper.hpp>

Public Types

enum  DebugLevel {
  PARAMETERS = 1, SERVICE_CALLS = 2, COMMON_INFORMATION = 4, FOUND_OBJECT = 8,
  VIEW_PORT = 16, COMPLETE_PATTERN = 32
}
 

Public Member Functions

unsigned int getLevel () const
 returns the debug level that is set More...
 
std::string getLevelString () const
 returns the debug levels that are set as string More...
 
void setLevels ()
 sets the allowed debug levels More...
 
void write (const char *text, const unsigned int &levels) const
 writes the text to the console if it has a level that allows it More...
 
void write (const std::string &text, const unsigned int &levels) const
 writes the text to the console if it has a level that allows it More...
 
void write (const std::ostream &text, const unsigned int &levels) const
 writes the text to the console if it has a level that allows it More...
 
void writeNoticeably (const char *text, const unsigned int &levels) const
 writes the text noticeably to the console if it has a level that allows it More...
 
void writeNoticeably (const std::string &text, const unsigned int &levels) const
 writes the text noticeably to the console if it has a level that allows it More...
 
void writeNoticeably (const std::ostream &text, const unsigned int &levels) const
 writes the text noticeably to the console if it has a level that allows it More...
 

Static Public Member Functions

static boost::shared_ptr< DebugHelpergetInstance ()
 
static void resetInstance ()
 

Private Member Functions

bool checkLevel (const unsigned int &levels) const
 checks whether the given level is allowed More...
 
 DebugHelper ()
 
std::string getDebugLevelString (const unsigned int &levels) const
 returns the name of the given DebugLevel More...
 

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. More...
 
static int parseLevels (const std::vector< std::string > &levels)
 parses the level list to the corresponding integer More...
 

Private Attributes

unsigned int mLevels
 

Static Private Attributes

static const int ALL
 
static boost::shared_ptr< DebugHelperinstancePtr
 
static const int NONE = 0
 

Detailed Description

The DebugHelper class is responsible for debug output.

Definition at line 30 of file debug_helper.hpp.

Member Enumeration Documentation

Enumerator
PARAMETERS 
SERVICE_CALLS 
COMMON_INFORMATION 
FOUND_OBJECT 
VIEW_PORT 
COMPLETE_PATTERN 

Definition at line 34 of file debug_helper.hpp.

Constructor & Destructor Documentation

world_model::DebugHelper::DebugHelper ( )
private

Definition at line 36 of file debug_helper.cpp.

Member Function Documentation

void world_model::DebugHelper::addToString ( std::string &  s,
const std::string &  add 
)
staticprivate

adds a string to a given string s. Puts a comma between them if the string s has a size bigger than 0.

Parameters
s[in,out] the string
add[in] the string to add

Definition at line 210 of file debug_helper.cpp.

bool world_model::DebugHelper::checkLevel ( const unsigned int &  levels) const
private

checks whether the given level is allowed

Parameters
levelthe level
Returns
whether the given level is allowed. true if it is allowed and false if it is not.

Definition at line 142 of file debug_helper.cpp.

std::string world_model::DebugHelper::getDebugLevelString ( const unsigned int &  levels) const
private

returns the name of the given DebugLevel

Parameters
levelthe level
Returns
the name of the given DebugLevel

Definition at line 122 of file debug_helper.cpp.

boost::shared_ptr< DebugHelper > world_model::DebugHelper::getInstance ( )
static

Definition at line 24 of file debug_helper.cpp.

unsigned int world_model::DebugHelper::getLevel ( ) const

returns the debug level that is set

Returns
the debug level that is set.

Definition at line 86 of file debug_helper.cpp.

std::string world_model::DebugHelper::getLevelString ( ) const

returns the debug levels that are set as string

Returns
the debug levels that are set as string.

Definition at line 91 of file debug_helper.cpp.

int world_model::DebugHelper::parseLevels ( const std::vector< std::string > &  levels)
staticprivate

parses the level list to the corresponding integer

Parameters
levelsthe list of level strings
Returns
the corresponding integer

Definition at line 171 of file debug_helper.cpp.

void world_model::DebugHelper::resetInstance ( )
static

Definition at line 30 of file debug_helper.cpp.

void world_model::DebugHelper::setLevels ( )

sets the allowed debug levels

Definition at line 146 of file debug_helper.cpp.

void world_model::DebugHelper::write ( const char *  text,
const unsigned int &  levels 
) const

writes the text to the console if it has a level that allows it

Parameters
textthe text
levelthe debug level of the text

Definition at line 40 of file debug_helper.cpp.

void world_model::DebugHelper::write ( const std::string &  text,
const unsigned int &  levels 
) const

writes the text to the console if it has a level that allows it

Parameters
textthe text
levelthe debug level of the text

Definition at line 47 of file debug_helper.cpp.

void world_model::DebugHelper::write ( const std::ostream &  text,
const unsigned int &  levels 
) const

writes the text to the console if it has a level that allows it

Parameters
textthe text
levelthe debug level of the text

Definition at line 53 of file debug_helper.cpp.

void world_model::DebugHelper::writeNoticeably ( const char *  text,
const unsigned int &  levels 
) const

writes the text noticeably to the console if it has a level that allows it

Parameters
textthe text
levelthe debug level of the text

Definition at line 61 of file debug_helper.cpp.

void world_model::DebugHelper::writeNoticeably ( const std::string &  text,
const unsigned int &  levels 
) const

writes the text noticeably to the console if it has a level that allows it

Parameters
textthe text
levelthe debug level of the text

Definition at line 70 of file debug_helper.cpp.

void world_model::DebugHelper::writeNoticeably ( const std::ostream &  text,
const unsigned int &  levels 
) const

writes the text noticeably to the console if it has a level that allows it

Parameters
textthe text
levelthe debug level of the text

Definition at line 77 of file debug_helper.cpp.

Member Data Documentation

const int world_model::DebugHelper::ALL
staticprivate
boost::shared_ptr< DebugHelper > world_model::DebugHelper::instancePtr
staticprivate

Definition at line 45 of file debug_helper.hpp.

unsigned int world_model::DebugHelper::mLevels
private

Definition at line 50 of file debug_helper.hpp.

const int world_model::DebugHelper::NONE = 0
staticprivate

Definition at line 48 of file debug_helper.hpp.


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


asr_world_model
Author(s): Aumann Florian, Borella Jocelyn, Hutmacher Robin, Karrenbauer Oliver, Meißner Pascal, Schleicher Ralf, Stöckle Patrick, Trautmann Jeremias
autogenerated on Thu Jan 9 2020 07:20:01