LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
UTIL::LCWarning Class Reference

Utility class to show warnings in LCIO. More...

#include <LCWarning.h>

Classes

struct  _warning_cfg_struct
 

Public Member Functions

void registerWarning (const std::string &id, const std::string &txt, int max=10)
 register a new warning More...
 
void printWarning (const std::string &id)
 print the warning text associated to the given id More...
 

Static Public Member Functions

static LCWarninggetInstance ()
 

Private Member Functions

 LCWarning (std::ostream &outstream=std::cerr)
 
 ~LCWarning ()
 
 LCWarning (const LCWarning &)
 
LCWarningoperator= (const LCWarning &)
 

Private Attributes

std::map< std::string,
_warning_cfg_struct
_warning_cfg {}
 
std::map< std::string,
_warning_cfg_struct >
::iterator 
_warning_cfg_it {}
 
std::ostream_outstream
 

Static Private Attributes

static LCWarninginstance
 

Detailed Description

Utility class to show warnings in LCIO.

The maximum amount of warnings printed is configurable and per default set to 10.

Warnings are shown one last time when application ends.

Author
engels
Version

Definition at line 20 of file LCWarning.h.

Constructor & Destructor Documentation

UTIL::LCWarning::LCWarning ( std::ostream outstream = std::cerr)
private

Definition at line 12 of file LCWarning.cc.

References registerWarning().

UTIL::LCWarning::~LCWarning ( )
private

Definition at line 148 of file LCWarning.cc.

References _outstream, _warning_cfg, _warning_cfg_it, and std::endl().

UTIL::LCWarning::LCWarning ( const LCWarning )
private

Member Function Documentation

LCWarning & UTIL::LCWarning::getInstance ( )
static

Definition at line 171 of file LCWarning.cc.

References instance.

LCWarning& UTIL::LCWarning::operator= ( const LCWarning )
private
void UTIL::LCWarning::printWarning ( const std::string id)

print the warning text associated to the given id

Definition at line 117 of file LCWarning.cc.

References _outstream, _warning_cfg, and std::endl().

void UTIL::LCWarning::registerWarning ( const std::string id,
const std::string txt,
int  max = 10 
)

register a new warning

id = "a_unique_string_to_identify_the_warning" txt = "the world will end tomorrow, leave the room immediately and go get some fun ;)" max = the maximum amount of times to display the warning

Definition at line 102 of file LCWarning.cc.

References _warning_cfg.

Referenced by LCWarning().

Member Data Documentation

std::ostream& UTIL::LCWarning::_outstream
private

Definition at line 53 of file LCWarning.h.

Referenced by printWarning(), and ~LCWarning().

std::map< std::string, _warning_cfg_struct > UTIL::LCWarning::_warning_cfg {}
private

Definition at line 51 of file LCWarning.h.

Referenced by printWarning(), registerWarning(), and ~LCWarning().

std::map< std::string, _warning_cfg_struct >::iterator UTIL::LCWarning::_warning_cfg_it {}
private

Definition at line 52 of file LCWarning.h.

Referenced by ~LCWarning().

LCWarning& UTIL::LCWarning::instance
staticprivate

Definition at line 42 of file LCWarning.h.

Referenced by getInstance().


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