linbox
MessageClass Class Reference

#include <commentator.h>

Public Member Functions

 MessageClass (const Commentator &comm, const char *msg_class, std::ostream &stream, unsigned long max_depth=1, unsigned long max_level=2)
 
 MessageClass (const MessageClass &message_class)
 
void setMaxDepth (long depth)
 
void setMaxDetailLevel (long level)
 
void setPrintParameters (unsigned long depth, unsigned long level, const char *fn)
 
bool isPrinted (unsigned long depth, unsigned long level, const char *fn=(const char *) 0)
 

Friends

class Commentator
 

Detailed Description

Message class object. This object encapsulates the configuration of a given message class

Constructor & Destructor Documentation

◆ MessageClass() [1/2]

MessageClass ( const Commentator & comm,
const char * msg_class,
std::ostream & stream,
unsigned long max_depth = 1,
unsigned long max_level = 2 )

Constructor.

Constructs a new MessageClass object with the given type, outputing to the given stream. All other parameters are set to factory defaults.

Parameters
commCommentator for this message class
msg_className of message class
streamOutput stream to which to send messages of this class
max_depthDefault maximal recursion depth at which to print messages of this class (default 2)
max_levelDefault maximal detail level at which to print messages of this class (default 1)

◆ MessageClass() [2/2]

MessageClass ( const MessageClass & message_class)
inline

Copy constructor.

Member Function Documentation

◆ setMaxDepth()

void setMaxDepth ( long depth)

Set maximum message depth. Sets the maximum activity depth, as defined by Commentator::start and Commentator::stop, at which messages of this class will be printed.

Parameters
depthMaximum depth at which to print messages; set to -1 to print messages at any depth and 0 to disable entirely

◆ setMaxDetailLevel()

void setMaxDetailLevel ( long level)

Set maximum detail level. Sets the maximum detail level at which to print messages

Parameters
levelMaximum detail level at which to print messages; set to -1 to print messages at all levels and 0 to disable entirely

◆ setPrintParameters()

void setPrintParameters ( unsigned long depth,
unsigned long level,
const char * fn )

Precise control over printing. Specifies that all messages up to the given depth and the given activity level should be printed

Parameters
depthMaximum depth at which to print
levelMaximum detail level at which to print
fnFully qualified name of the function for which this is valid; may be 0, in which case this is valid for everything

◆ isPrinted()

bool isPrinted ( unsigned long depth,
unsigned long level,
const char * fn = (const char *) 0 )

Determine whether a given message will be printed when of this message class.

Parameters
depthActivity depty of the message
levelDetail level of the message
fnFully qualified function name (0 if not applicable; default 0)
Returns
true if a message of the given characteristics is printed

Friends And Related Symbol Documentation

◆ Commentator

friend class Commentator
friend

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