Essentia
2.1-beta6-dev
|
#include <streamconnector.h>
Public Member Functions | |
StreamConnector () | |
virtual | ~StreamConnector () |
virtual int | available () const =0 |
bool | acquire () |
virtual bool | acquire (int n)=0 |
void | release () |
virtual void | release (int n)=0 |
virtual int | acquireSize () const |
virtual int | releaseSize () const |
virtual void | setAcquireSize (int n) |
virtual void | setReleaseSize (int n) |
virtual void | reset ()=0 |
Protected Attributes | |
int | _acquireSize |
int | _releaseSize |
This class represents a stream connector (end-point), which is the basic interface for both Sinks and Sources. It provides methods for querying how many tokens are available, acquire & release them. It can be used both for input and output, as it only describes the data that flows in a stream, without any indication of the direction in which it flows.
|
inline |
|
inlinevirtual |
|
inline |
Acquire (consume) the default number of tokens.
References StreamConnector::_acquireSize, and StreamConnector::acquire().
Referenced by StreamConnector::acquire(), Sink< TokenType >::acquire(), SinkProxyBase::acquire(), Source< TokenType >::acquire(), SourceProxyBase::acquire(), and SourceBase::push().
|
pure virtual |
Acquire (consume) the requested number of tokens.
Implemented in SourceProxyBase, Source< TokenType >, Source< Real >, SinkProxyBase, Sink< TokenType >, Sink< T >, Sink< std::vector< Real > >, and Sink< Real >.
|
inlinevirtual |
Returns the default number of tokens to be acquired.
Reimplemented in SourceProxyBase, and SinkProxyBase.
References StreamConnector::_acquireSize.
Referenced by SinkProxyBase::acquireSize(), SourceProxyBase::acquireSize(), and essentia::streaming::connect().
|
pure virtual |
Returns how many tokens are available in the stream.
Implemented in SourceProxy< TokenType >, Source< TokenType >, Source< Real >, SinkProxy< TokenType >, Sink< TokenType >, Sink< T >, Sink< std::vector< Real > >, and Sink< Real >.
Referenced by Sink< TokenType >::available().
|
inline |
Release (produce) the default number of tokens.
References StreamConnector::_releaseSize, and StreamConnector::release().
Referenced by SourceBase::push(), StreamConnector::release(), Sink< TokenType >::release(), SinkProxyBase::release(), Source< TokenType >::release(), and SourceProxyBase::release().
|
pure virtual |
Release (produce) the requested number of tokens.
Implemented in SourceProxyBase, Source< TokenType >, Source< Real >, SinkProxyBase, Sink< TokenType >, Sink< T >, Sink< std::vector< Real > >, and Sink< Real >.
|
inlinevirtual |
Returns the default number of tokens to be released.
Reimplemented in SourceProxyBase, and SinkProxyBase.
References StreamConnector::_releaseSize.
Referenced by SinkProxyBase::releaseSize(), and SourceProxyBase::releaseSize().
|
pure virtual |
Resets the state of this StreamConnector
Implemented in SourceProxy< TokenType >, Source< TokenType >, Source< Real >, SinkProxy< TokenType >, Sink< TokenType >, Sink< T >, Sink< std::vector< Real > >, and Sink< Real >.
Referenced by SourceProxy< TokenType >::reset().
|
inlinevirtual |
Set the default number of tokens to be acquired.
References StreamConnector::_acquireSize.
Referenced by essentia::streaming::connect().
|
inlinevirtual |
Set the default number of tokens to be released.
References StreamConnector::_releaseSize.
Referenced by essentia::streaming::connect().
|
protected |
Referenced by StreamConnector::acquire(), StreamConnector::acquireSize(), and StreamConnector::setAcquireSize().
|
protected |
Referenced by StreamConnector::release(), StreamConnector::releaseSize(), and StreamConnector::setReleaseSize().