dxd - dynax driver framework 3.0.1d223
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::redirect::indent::streambuf Class Reference

a stream's distributor: over the stream's own buffer while a sink is joined, the stream's own restored once the last one left - every write to each sink, a line's start prefixed by the writing thread's indent, a line sink given each line whole. Every distributor joins the stream's own buffer: the stream stays where it was, indented - a sink wanting the stream for itself leaves it (leave(*origin)). std::cout, std::clog and std::cerr get theirs at their first indent level or sink. A buffer joined twice is written once. Joining and leaving take the lock the writes take (io_mutex). More...

#include <dx_redirect.h>

Inheritance diagram for dx::redirect::indent::streambuf:
Collaboration diagram for dx::redirect::indent::streambuf:

Public Member Functions

void join (std::streambuf &buffer, bool line=false)
void leave (std::streambuf &buffer)
virtual streambuf & operator<< (size_t size)
virtual streambuf & operator>> (const std::string &indent)
 streambuf (std::ostream &ostream, const std::string &dflt=indent::dflt::pattern)
 ~streambuf () override

Static Public Member Functions

static streambuf & of (std::ostream &ostream)
 the stream's distributor: the one there is, or one kept for the process
static bool standard (const std::ostream &ostream)
 std::cout, std::clog or std::cerr: the streams living for the process, which an indent level gives a distributor

Public Attributes

std::string dflt
std::streambuf *const origin
 the stream's own buffer: stdout's, stderr's - std::clog's is stderr's too, there is no stdlog

Protected Member Functions

int_type overflow (int_type ch=traits_type::eof()) override
int sync () override
std::streamsize xsputn (const char *data, std::streamsize count) override

Friends

class join

Detailed Description

a stream's distributor: over the stream's own buffer while a sink is joined, the stream's own restored once the last one left - every write to each sink, a line's start prefixed by the writing thread's indent, a line sink given each line whole. Every distributor joins the stream's own buffer: the stream stays where it was, indented - a sink wanting the stream for itself leaves it (leave(*origin)). std::cout, std::clog and std::cerr get theirs at their first indent level or sink. A buffer joined twice is written once. Joining and leaving take the lock the writes take (io_mutex).

Constructor & Destructor Documentation

◆ streambuf()

dx::redirect::indent::streambuf::streambuf ( std::ostream & ostream,
const std::string & dflt = indent::dflt::pattern )
inline
Here is the caller graph for this function:

◆ ~streambuf()

dx::redirect::indent::streambuf::~streambuf ( )
inlineoverride

Member Function Documentation

◆ join()

void dx::redirect::indent::streambuf::join ( std::streambuf & buffer,
bool line = false )
inline
Here is the call graph for this function:

◆ leave()

void dx::redirect::indent::streambuf::leave ( std::streambuf & buffer)
inline

◆ of()

streambuf & dx::redirect::indent::streambuf::of ( std::ostream & ostream)
inlinestatic

the stream's distributor: the one there is, or one kept for the process

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator<<()

virtual streambuf & dx::redirect::indent::streambuf::operator<< ( size_t size)
inlinevirtual
Here is the call graph for this function:

◆ operator>>()

virtual streambuf & dx::redirect::indent::streambuf::operator>> ( const std::string & indent)
inlinevirtual
Here is the call graph for this function:

◆ overflow()

int_type dx::redirect::indent::streambuf::overflow ( int_type ch = traits_type::eof())
inlineoverrideprotected
Here is the call graph for this function:

◆ standard()

bool dx::redirect::indent::streambuf::standard ( const std::ostream & ostream)
inlinestatic

std::cout, std::clog or std::cerr: the streams living for the process, which an indent level gives a distributor

Here is the caller graph for this function:

◆ sync()

int dx::redirect::indent::streambuf::sync ( )
inlineoverrideprotected

◆ xsputn()

std::streamsize dx::redirect::indent::streambuf::xsputn ( const char * data,
std::streamsize count )
inlineoverrideprotected
Here is the caller graph for this function:

◆ join

friend class join
friend

Member Data Documentation

◆ dflt

std::string dx::redirect::indent::streambuf::dflt

◆ origin

std::streambuf* const dx::redirect::indent::streambuf::origin

the stream's own buffer: stdout's, stderr's - std::clog's is stderr's too, there is no stdlog


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

(c) copyright 2009 dynamic acoustics e.U. generated on

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.