Library of Assembled Shared Sources
lass::num::lass::io::ProxyOStream Class Reference

A proxy output stream can distribute output to multiple destination streams. More...

#include <basic_ops.h>

Public Member Functions

template<typename T>
impl::ProxyOStreamLock operator<< (const T &x)
 ProxyOStreamLock proxy stream for output on 'acceptAll' and distribute input.
 

Detailed Description

A proxy output stream can distribute output to multiple destination streams.

Author
BdG
Date
2003

You can add multiple destination streams to a proxy stream, and all output to the proxy stream will be redirected to all these destinations.

You can also assign a filter to the proxy, and only messages with levels set in the filter will pass. e.g. if you set the filter of the proxy as proxy.setFilter() = 0, then only messages of warning or error levels will pass.

How do you tell what level your message has? Simple, before you use the insertor, you call the function operator on the stream with the correct level. This returns a lock on the proxy, and now you send the message to the lock (by the insertor) Wheter this message will pass or not, is determined by the lock. At the end of the lifetime of the lock, the proxy is also flushed.

proxy(Warning) << "This is a warning: " << theWarning;

In the above example, the proxy is locked in warning level, and the string and theWarning is passed to the lock. At the end, the lock flushes te proxy.

If you don't use the function operator to set the message level, the level is implicit set to ProxyOStream::Note.

OK, seriously, i have no longer any idea why we need this ... get rid of it?

Definition at line 123 of file basic_ops.h.

Member Function Documentation

◆ operator<<()

template<typename T>
impl::ProxyOStreamLock lass::num::lass::io::ProxyOStream::operator<< ( const T & x)
inline

ProxyOStreamLock proxy stream for output on 'acceptAll' and distribute input.

This command will give command to a lock, as if the message mask is acceptAll. This has the same effect as (*this)(acceptAll) << x;

Definition at line 147 of file basic_ops.h.


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