Class CTraceFifoStreamBuffer#
Defined in File trace_fifo.h
Nested Relationships#
Nested Types#
Inheritance Relationships#
Base Types#
public CTraceFifoWriter
(Class CTraceFifoWriter)public std::stringbuf
Class Documentation#
-
class CTraceFifoStreamBuffer : public CTraceFifoWriter, public std::stringbuf#
Trace fifo stream buffer object.
Remark
This implementation works for applications within the scope of the C++ library source compilation into one binary unit. This is due to the templated nature of the C++ library allowing very little reuse of compiled code across binary units. This means, that although interception will work in one unit (e.g. executable or static/shared library), it might not intercept messages from another unit.
Public Functions
-
CTraceFifoStreamBuffer(uint32_t uiInstanceID = 1000u, size_t nSize = 16384)#
Constructor.
- Parameters:
uiInstanceID – [in] The instance ID to use for sending/monitoring the messages.
nSize – [in] Default size of the fifo.
-
virtual ~CTraceFifoStreamBuffer() override#
Destructor.
-
void InterceptStream(std::ostream &rstream)#
Assign this buffer to a stream object. Any message will be streamed to both the original stream as well as the trace fifo.
Remark
Removal of this assignment is done automatically during destruction of this class.
- Attention
The stream object needs to stay in scope until the assignment is removed or this class is destroyed.
- Attention
Works for text only.
- Parameters:
rstream – [in] Reference to the stream to intercept the communication for.
-
void RevertInterception(std::ostream &rstream)#
Remove the interception of a stream.
- Parameters:
rstream – [in] Reference to the stream to revert the interception for.
-
virtual void Close() override#
Cancel any running task and close an open fifo. Override of CTraceFifoBase::Close.
-
int sync()#
Synchronizes the buffers with the associated character sequence.
- Returns:
Returns 0 if successful; -1 if not.
-
CTraceFifoStreamBuffer(uint32_t uiInstanceID = 1000u, size_t nSize = 16384)#