20 #ifndef ESSENTIA_SINKPROXY_H
21 #define ESSENTIA_SINKPROXY_H
76 throw EssentiaException(
"Cannot acquire for SinkProxy ",
fullName(),
": you need to call acquire() on the Sink which is proxied by it");
89 throw EssentiaException(
"Cannot release for SinkProxy ",
fullName(),
": you need to call release() on the Sink which is proxied by it");
112 <<
"::setId(" <<
_id <<
")");
140 std::ostringstream msg;
141 msg <<
"Could not attach SinkProxy " <<
fullName() <<
" to " << sink->
fullName()
175 template <
typename TokenType>
178 template <
typename TokenType>
222 ": you need to call getTokens() on the Sink which is proxied by it");
227 ": you need to call getFirstToken() on the Sink which is proxied by it");
243 std::ostringstream msg;
244 msg <<
"Cannot attach SinkProxy " << proxy.
fullName() <<
" (type: " <<
nameOfType(proxy) <<
") to "
void checkSameTypeAs(const TypeProxy &obj) const
Definition: types.h:302
const std::string & name() const
Definition: types.h:284
Definition: streamingalgorithm.h:140
std::string fullName() const
const Algorithm * parent() const
Definition: connector.h:53
virtual int availableForRead(ReaderID id) const =0
Definition: sinkbase.h:52
ReaderID _id
Definition: sinkbase.h:55
void detachProxy(SinkProxyBase *sproxy)
SourceBase * _source
Definition: sinkbase.h:54
virtual void setSource(SourceBase *source)
virtual void setId(ReaderID id)
const SourceBase * source() const
Definition: sinkbase.h:75
void attachProxy(SinkProxyBase *sproxy)
Definition: sinkproxy.h:30
void detach(SinkBase *sink)
Definition: sinkproxy.h:150
virtual bool acquire(int n)
Definition: sinkproxy.h:75
void release()
Definition: sinkproxy.h:86
void updateProxiedSink()
Definition: sinkproxy.h:103
~SinkProxyBase()
Definition: sinkproxy.h:40
SinkProxyBase(const std::string &name)
Definition: sinkproxy.h:38
void attach(SinkBase *sink)
Definition: sinkproxy.h:132
void setSource(SourceBase *source)
Definition: sinkproxy.h:65
void setId(ReaderID id)
Definition: sinkproxy.h:60
virtual int releaseSize() const
Definition: sinkproxy.h:92
SinkProxyBase(Algorithm *parent=0, const std::string &name="unnamed")
Definition: sinkproxy.h:35
void detach()
Definition: sinkproxy.h:123
const void * buffer() const
Definition: sinkproxy.h:46
void * buffer()
Definition: sinkproxy.h:53
virtual int acquireSize() const
Definition: sinkproxy.h:79
virtual void release(int n)
Definition: sinkproxy.h:88
SinkBase * _proxiedSink
Definition: sinkproxy.h:32
void acquire()
Definition: sinkproxy.h:73
Definition: sinkproxy.h:179
void connect(SourceBase &source)
Definition: sinkproxy.h:202
virtual int available() const
Definition: sinkproxy.h:231
void disconnect(SourceBase &source)
Definition: sinkproxy.h:215
SinkProxy(const std::string &name)
Definition: sinkproxy.h:187
virtual void reset()
Definition: sinkproxy.h:235
MultiRateBuffer< TokenType > & buffer()
Definition: sinkproxy.h:197
const MultiRateBuffer< TokenType > & buffer() const
Definition: sinkproxy.h:193
virtual const void * getFirstToken() const
Definition: sinkproxy.h:225
SinkProxy(Algorithm *parent=0, const std::string &name="unnamed")
Definition: sinkproxy.h:184
virtual const void * getTokens() const
Definition: sinkproxy.h:220
Definition: sourcebase.h:52
virtual void * buffer()=0
void release()
Definition: streamconnector.h:59
bool acquire()
Definition: streamconnector.h:49
virtual int releaseSize() const
Definition: streamconnector.h:74
virtual int acquireSize() const
Definition: streamconnector.h:69
#define E_DEBUG(module, msg)
Definition: debugging.h:157
#define E_WARNING(msg)
Definition: debugging.h:164
void detach(SinkProxyBase &proxy, SinkBase &innerSink)
Definition: sinkproxy.h:257
void operator>>(SourceBase &source, DevNullConnector devnull)
Definition: devnull.h:81
void attach(SinkProxyBase &proxy, SinkBase &innerSink)
Definition: sinkproxy.h:239
Definition: algorithm.h:28
bool sameType(const std::type_info &t1, const std::type_info &t2)
Definition: types.h:260
std::string nameOfType(const std::type_info &type)
int ReaderID
Definition: types.h:344
@ EMemory
Definition: debugging.h:48
@ EConnectors
Definition: debugging.h:43
#define USE_TYPE_INFO(TokenType)
Definition: types.h:332