Aufgabe 2: Unterbrechungen
CopyStream Class Reference
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. More... | |
template<typename T > | |
CopyStream & | operator<< (T value) |
Generic stream operator for any data type. More... | |
template<typename T > | |
CopyStream & | operator<< (T &(*f)(T &)) |
Deal with [OutputStream] manipulator functions. More... | |
![]() | |
![]() |
Additional Inherited Members | |
![]() | |
![]() | |
![]() |
Detailed Description
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).
Constructor & Destructor Documentation
|
inline |
Constructor.
- Parameters
-
first First recipient for output passed to this object second Second recipient for output passed to this object
Member Function Documentation
template<typename T >
|
inline |
Generic stream operator for any data type.
Forwards all input to both recipients.
Uses template meta programming for a generic & short solution
- Template Parameters
-
T Type of data to be forwarded
- Parameters
-
value data to be forwarded
- Returns
- Reference to the CopyStream object allowing concatenation of operators
template<typename T >
|
inline |
Deal with [OutputStream] manipulator functions.
- Template Parameters
-
T Manipulator type
- Parameters
-
f pointer to manipulator function
- Returns
- Reference to the CopyStream object allowing concatenation of operators
The documentation for this class was generated from the following file:
- debug/copystream.h