Sierra Toolkit Version of the Day
stk::diag::Writer Class Reference

Class Writer implements a runtime selectable diagnostic output writer to aid in the development and diagnostics of massively parallel applications. More...

#include <Writer.hpp>

List of all members.

Public Types

enum  Flags {
  DISABLED = 0x00,
  ENABLED = 0x01
}
 Enumeration Flags. More...

Public Member Functions

 Writer (std::streambuf *streambuf, PrintMask print_mask=static_cast< PrintMask >(LOG_MEMBERS), Flags flags=static_cast< Flags >(ENABLED))
 Creates a new Writer instance with the specified print mask and output flags.
 ~Writer ()
 Destroys a Writer instance.
std::ostream & getStream ()
 Member function getStream returns the output stream.
WritersetFlags (int flags)
 Member function setFlags sets the flags bitmask which describes the output line prefix content.
int getFlags ()
 Member function getFlags returns the flags bitmask.
int getDepth () const
WriterrestoreDepth (int depth)
WritersetPrintMask (PrintMask mask=0)
 Member function setPrintMask sets the print output mask.
WritersetPrintMask (const char *mask_string)
 Member function setPrintMask sets the print output mask.
WritersetLineMask (PrintMask line_mask)
 Member function setLineMask sets the line mask of this line.
Writerm (PrintMask line_mask)
 Member function m sets the line mask of this line.
Writerw (bool on, PrintMask line_mask)
 Member function m sets the line mask of this line.
Writert (PrintMask line_mask=0)
 Member function t sets the line mask of this line to line_make bitwise or'ed with LOG_TRACE.
PrintMask getPrintMask ()
 Member function getLineMask returns the current line mask.
bool isEnabled ()
 Member function isEnabled returns true if the ENABLED bit is set in the flags bitmask.
bool isLoggable (PrintMask line_mask)
 Member function isLoggable returns true if any corresponding bit in the line mask matches a bit in the print mask, except LOG_TRACE which also requires isTracing() to be true.
bool shouldPrint ()
 Member function shouldPrint returns true if the line should print.
bool shouldPrint (PrintMask line_mask)
 Member function shouldPrint returns true if the line should print.
bool shouldTrace (int line_mask)
 Member function shouldTrace returns true if any corresponding bit in the line mask matches a bit in the print mask, except LOG_TRACE which also requires isTracing() to be true.
Writerdflush ()
 Member function dflush flushes the output stream.
Writerdendl ()
 Member function dendl is a manipulator which sets the output stream to a new line.
Writerpush ()
 Member function push is a manipulator which increases the line mask depth by one.
Writerpop ()
 Member function pop is a manipulator which decreases the line mask depth by one, but not less than zero(0).
WriterresetLineMask ()
 Member function pop is a manipulator which decreases the line mask depth by one, but not less than zero(0).
Writeroperator<< (Writer &(*f)(Writer &))
 Member function operator<< is the manipulator instantiation function.
Writeroperator<< (std::ios_base &(*f)(std::ios_base &))
 Member function operator<< passes the ios_base manipulator function to the output stream.
Writeroperator<< (std::ostream &(*f)(std::ostream &))
 Member function operator<< passes the iostream manipulator function to the output stream.
int incTraceDepth ()
 Member function incTraceDepth increments the tracing count.
int decTraceDepth ()
 Member function decTraceDepth decrements the tracing count.
bool isTracing ()
 Member function isTracing returns true of the trace depth is greater than zero. The value of -1 is initially stored in the depth as a flag that the trace counters have never been called. (This may be and obsolete requirement).
bool isTraceable ()
 Member function isTraceable returns true if currently tracing or tracing is enabled.

Detailed Description

Class Writer implements a runtime selectable diagnostic output writer to aid in the development and diagnostics of massively parallel applications.

Definition at line 49 of file Writer.hpp.


Member Enumeration Documentation

Enumeration Flags.

  • DISABLED disables Writer output
  • ENABLED enabled Writer output

Definition at line 60 of file Writer.hpp.


Constructor & Destructor Documentation

stk::diag::Writer::Writer ( std::streambuf *  streambuf,
PrintMask  print_mask = static_cast<PrintMask>(LOG_MEMBERS),
Flags  flags = static_cast<Flags>(ENABLED) 
) [explicit]

Creates a new Writer instance with the specified print mask and output flags.

Parameters:
print_maska PrintMask value of the print mask to apply to this writer.
flagsa Flags value of the selected output flags.

Definition at line 34 of file Writer.cpp.


Member Function Documentation

std::ostream& stk::diag::Writer::getStream ( ) [inline]

Member function getStream returns the output stream.

Returns:
a std::ostream reference to the output stream.

Definition at line 210 of file Writer.hpp.

Writer& stk::diag::Writer::setFlags ( int  flags) [inline]

Member function setFlags sets the flags bitmask which describes the output line prefix content.

Parameters:
flagsan int of the bitmask of flags.
Returns:
a Writer reference to this object

Definition at line 222 of file Writer.hpp.

int stk::diag::Writer::getFlags ( ) [inline]

Member function getFlags returns the flags bitmask.

Returns:
an int of the flags bitmask.

Definition at line 232 of file Writer.hpp.

Writer& stk::diag::Writer::setPrintMask ( PrintMask  mask = 0) [inline]

Member function setPrintMask sets the print output mask.

Parameters:
maskan PrintMask value of the new print mask.
Returns:
a Writer reference to this diagnostic writer.

Definition at line 255 of file Writer.hpp.

Writer& stk::diag::Writer::setPrintMask ( const char *  mask_string)

Member function setPrintMask sets the print output mask.

Parameters:
mask_stringan PrintMask value of the new print mask.
Returns:
a Writer reference to this diagnostic writer.
Writer& stk::diag::Writer::setLineMask ( PrintMask  line_mask) [inline]

Member function setLineMask sets the line mask of this line.

Parameters:
line_maskan PrintMask of the mask for this line.
Returns:
a Writer reference to this diagnostic writer.

Definition at line 280 of file Writer.hpp.

Writer& stk::diag::Writer::m ( PrintMask  line_mask) [inline]

Member function m sets the line mask of this line.

Parameters:
line_maskan PrintMask of the mask for this line.
Returns:
a Writer reference to this object.

Definition at line 294 of file Writer.hpp.

Writer& stk::diag::Writer::w ( bool  on,
PrintMask  line_mask 
) [inline]

Member function m sets the line mask of this line.

Parameters:
line_maskan PrintMask of the mask for this line.
Returns:
a Writer reference to this object.

Definition at line 308 of file Writer.hpp.

Writer& stk::diag::Writer::t ( PrintMask  line_mask = 0) [inline]

Member function t sets the line mask of this line to line_make bitwise or'ed with LOG_TRACE.

Parameters:
line_maskan PrintMask of the mask for this line.
Returns:
a Writer reference to this object.

Definition at line 323 of file Writer.hpp.

PrintMask stk::diag::Writer::getPrintMask ( ) [inline]

Member function getLineMask returns the current line mask.

Returns:
an int value of the current line mask.

Definition at line 334 of file Writer.hpp.

bool stk::diag::Writer::isEnabled ( ) [inline]

Member function isEnabled returns true if the ENABLED bit is set in the flags bitmask.

Returns:
a bool of true if the ENABLED bit is set in the flags bitmask.

Definition at line 345 of file Writer.hpp.

bool stk::diag::Writer::isLoggable ( PrintMask  line_mask) [inline]

Member function isLoggable returns true if any corresponding bit in the line mask matches a bit in the print mask, except LOG_TRACE which also requires isTracing() to be true.

Returns:
a bool of true if any corresponding bit in the line mask matches a bit inthe print mask.

Definition at line 356 of file Writer.hpp.

bool stk::diag::Writer::shouldPrint ( ) [inline]

Member function shouldPrint returns true if the line should print.

Returns:
a bool of true if this line should be printed.

Definition at line 369 of file Writer.hpp.

bool stk::diag::Writer::shouldPrint ( PrintMask  line_mask) [inline]

Member function shouldPrint returns true if the line should print.

Parameters:
line_maska PrintMask value of the line mask.
Returns:
a bool of true if this line should be printed.

Definition at line 380 of file Writer.hpp.

bool stk::diag::Writer::shouldTrace ( int  line_mask) [inline]

Member function shouldTrace returns true if any corresponding bit in the line mask matches a bit in the print mask, except LOG_TRACE which also requires isTracing() to be true.

Returns:
a bool of true if any corresponding bit in the line mask matches a bit in the print mask.

Definition at line 392 of file Writer.hpp.

Writer & stk::diag::Writer::dflush ( )

Member function dflush flushes the output stream.

Returns:
a Writer reference to this object

Definition at line 56 of file Writer.cpp.

Writer & stk::diag::Writer::dendl ( )

Member function dendl is a manipulator which sets the output stream to a new line.

The std::endl manipulator is sent to the output stream.

Returns:
a Writer reference to this object

Definition at line 70 of file Writer.cpp.

Writer & stk::diag::Writer::push ( )

Member function push is a manipulator which increases the line mask depth by one.

Returns:
a Writer reference to this object

Definition at line 86 of file Writer.cpp.

Writer & stk::diag::Writer::pop ( )

Member function pop is a manipulator which decreases the line mask depth by one, but not less than zero(0).

Returns:
a Writer reference to this object

Definition at line 102 of file Writer.cpp.

Writer & stk::diag::Writer::resetLineMask ( )

Member function pop is a manipulator which decreases the line mask depth by one, but not less than zero(0).

Returns:
a Writer reference to this object

Definition at line 118 of file Writer.cpp.

Writer & stk::diag::Writer::operator<< ( Writer &(*)(Writer &)  f)

Member function operator<< is the manipulator instantiation function.

Returns:
a Writer reference to this object

Definition at line 131 of file Writer.cpp.

Writer & stk::diag::Writer::operator<< ( std::ios_base &(*)(std::ios_base &)  f)

Member function operator<< passes the ios_base manipulator function to the output stream.

Returns:
a Writer reference to this object

Definition at line 137 of file Writer.cpp.

Writer & stk::diag::Writer::operator<< ( std::ostream &(*)(std::ostream &)  f)

Member function operator<< passes the iostream manipulator function to the output stream.

Returns:
a Writer reference to this object

Definition at line 147 of file Writer.cpp.

int stk::diag::Writer::incTraceDepth ( ) [inline]

Member function incTraceDepth increments the tracing count.

Returns:
an int value of the new tracing count.

Definition at line 467 of file Writer.hpp.

int stk::diag::Writer::decTraceDepth ( ) [inline]

Member function decTraceDepth decrements the tracing count.

Returns:
an int value of the new tracing count.

Definition at line 476 of file Writer.hpp.

bool stk::diag::Writer::isTracing ( ) [inline]

Member function isTracing returns true of the trace depth is greater than zero. The value of -1 is initially stored in the depth as a flag that the trace counters have never been called. (This may be and obsolete requirement).

Returns:
a bool value of true of the trace depth is greater than zero

Definition at line 488 of file Writer.hpp.

bool stk::diag::Writer::isTraceable ( ) [inline]

Member function isTraceable returns true if currently tracing or tracing is enabled.

Returns:
a bool of true if tracing is enabled and active, or if tracing is disabled.

Definition at line 500 of file Writer.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends