Gazebo Common

API Reference

5.7.0

String buffer for the base logger. More...

#include <Console.hh>

Public Member Functions

 Buffer (LogType _type, const int _color, const int _verbosity)
 Constructor. More...
 
virtual ~Buffer ()
 Destructor. More...
 
int sync () override
 Sync the stream (output the string buffer contents). More...
 
std::streamsize xsputn (const char *_char, std::streamsize _count) override
 Writes _count characters to the string buffer. More...
 
- Public Member Functions inherited from stringbuf
stringbuf (T... args)
 
eback (T... args)
 
egptr (T... args)
 
epptr (T... args)
 
gbump (T... args)
 
getloc (T... args)
 
gptr (T... args)
 
imbue (T... args)
 
in_avail (T... args)
 
operator= (T... args)
 
overflow (T... args)
 
pbackfail (T... args)
 
pbase (T... args)
 
pbump (T... args)
 
pptr (T... args)
 
pubimbue (T... args)
 
pubseekoff (T... args)
 
pubseekpos (T... args)
 
pubsetbuf (T... args)
 
pubsync (T... args)
 
sbumpc (T... args)
 
seekoff (T... args)
 
seekpos (T... args)
 
setbuf (T... args)
 
setg (T... args)
 
setp (T... args)
 
sgetc (T... args)
 
sgetn (T... args)
 
showmanyc (T... args)
 
snextc (T... args)
 
sputbackc (T... args)
 
sputc (T... args)
 
sputn (T... args)
 
str (T... args)
 
sungetc (T... args)
 
swap (T... args)
 
sync (T... args)
 
uflow (T... args)
 
underflow (T... args)
 
xsgetn (T... args)
 
xsputn (T... args)
 

Public Attributes

int color
 ANSI color code using Select Graphic Rendition parameters (SGR). See http://en.wikipedia.org/wiki/ANSI_escape_code#Colors. More...
 
std::mutex syncMutex
 Mutex to synchronize writes to the string buffer and the output stream. More...
 
LogType type
 Destination type for the messages. More...
 
int verbosity
 Level of verbosity. More...
 

Detailed Description

String buffer for the base logger.

Constructor & Destructor Documentation

◆ Buffer()

Buffer ( LogType  _type,
const int  _color,
const int  _verbosity 
)

Constructor.

Parameters
[in]_typeOutput destination type (STDOUT, or STDERR)
[in]_colorColor of the output stream.
[in]_verbosityVerbosity level.

◆ ~Buffer()

virtual ~Buffer ( )
virtual

Destructor.

Member Function Documentation

◆ sync()

int sync ( )
override

Sync the stream (output the string buffer contents).

Returns
Return 0 on success.

◆ xsputn()

std::streamsize xsputn ( const char *  _char,
std::streamsize  _count 
)
override

Writes _count characters to the string buffer.

Parameters
[in]_charInput rharacter array.
[in]_countNumber of characters in array.
Returns
The number of characters successfully written.

Member Data Documentation

◆ color

int color

ANSI color code using Select Graphic Rendition parameters (SGR). See http://en.wikipedia.org/wiki/ANSI_escape_code#Colors.

◆ syncMutex

std::mutex syncMutex

Mutex to synchronize writes to the string buffer and the output stream.

◆ type

LogType type

Destination type for the messages.

◆ verbosity

int verbosity

Level of verbosity.


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