StuBS
|
Duplicate all data passed by the stream operator to two output streams. More...
#include <debug/copystream.h>
Public Member Functions | |
CopyStream (OutputStream *first, OutputStream *second) | |
Constructor. | |
template<typename T > | |
CopyStream & | operator<< (T value) |
Generic stream operator for any data type. | |
template<typename T > | |
CopyStream & | operator<< (T &(*f)(T &)) |
Deal with [OutputStream] manipulator functions. | |
Public Member Functions inherited from OutputStream | |
OutputStream () | |
Default constructor. Initial number system is decimal. | |
virtual | ~OutputStream () |
Destructor. | |
virtual void | flush ()=0 |
Clears the buffer. | |
OutputStream & | operator<< (char c) |
Print a single character. | |
OutputStream & | operator<< (unsigned char c) |
Print a single character. | |
OutputStream & | operator<< (const char *string) |
Printing a null-terminated string. | |
OutputStream & | operator<< (bool b) |
Print a boolean value. | |
OutputStream & | operator<< (short ival) |
Print an integral number in radix base | |
OutputStream & | operator<< (unsigned short ival) |
Print an integral number in radix base | |
OutputStream & | operator<< (int ival) |
Print an integral number in radix base | |
OutputStream & | operator<< (unsigned int ival) |
Print an integral number in radix base | |
OutputStream & | operator<< (long ival) |
Print an integral number in radix base | |
OutputStream & | operator<< (unsigned long ival) |
Print an integral number in radix base | |
OutputStream & | operator<< (long long ival) |
Print an integral number in radix base | |
OutputStream & | operator<< (unsigned long long ival) |
Print an integral number in radix base | |
OutputStream & | operator<< (const void *ptr) |
Print a pointer as hexadecimal number. | |
OutputStream & | operator<< (OutputStream &(*f)(OutputStream &)) |
Calls one of the manipulator functions. | |
Public Member Functions inherited from Stringbuffer | |
virtual | ~Stringbuffer () |
Destructor (nothing to do here) | |
Private Attributes | |
OutputStream * | first |
First recipient. | |
OutputStream * | second |
Second recipient. | |
Additional Inherited Members | |
Public Attributes inherited from OutputStream | |
int | base |
Number system used for printing integral numbers (one of 2, 8, 10, or 16) | |
Protected Member Functions inherited from Stringbuffer | |
Stringbuffer () | |
Constructor; Marks the buffer as empty. | |
void | put (char c) |
Inserts a character into the buffer. | |
Protected Attributes inherited from Stringbuffer | |
char | buffer [80] |
buffer containing characters that will be printed upon flush() | |
long unsigned | pos |
current position in the buffer | |
Duplicate all data passed by the stream operator to two output streams.
Can be used as replacement for any OutputStream – for example, forwarding the DBG output simultaneously to screen (TextStream) and serial console (SerialStream).
By using template programming, two generic methods are sufficient (which simply forward the input to both).
|
inline |
Constructor.
first | First recipient for output passed to this object |
second | Second recipient for output passed to this object |
|
inline |
Generic stream operator for any data type.
Forwards all input to both recipients.
Uses template meta programming for a generic & short solution
T | Type of data to be forwarded |
value | data to be forwarded |
|
inline |
Deal with [OutputStream] manipulator functions.
T | Manipulator type |
f | pointer to manipulator function |
|
private |
First recipient.
|
private |
Second recipient.