Essentia  2.1-beta6-dev
StreamConnector Class Referenceabstract

#include <streamconnector.h>

Inheritance diagram for StreamConnector:
Connector SinkBase SourceBase Sink< T > Sink< std::vector< Real > > Sink< Real > Sink< TokenType > SinkProxyBase Source< Real > Source< TokenType > SourceProxyBase

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ StreamConnector()

StreamConnector ( )
inline

◆ ~StreamConnector()

virtual ~StreamConnector ( )
inlinevirtual

Member Function Documentation

◆ acquire() [1/2]

◆ acquire() [2/2]

virtual bool acquire ( int  n)
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 >.

◆ acquireSize()

virtual int acquireSize ( ) const
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().

◆ available()

virtual int available ( ) const
pure virtual

◆ release() [1/2]

◆ release() [2/2]

virtual void release ( int  n)
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 >.

◆ releaseSize()

virtual int releaseSize ( ) const
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().

◆ reset()

◆ setAcquireSize()

virtual void setAcquireSize ( int  n)
inlinevirtual

Set the default number of tokens to be acquired.

References StreamConnector::_acquireSize.

Referenced by essentia::streaming::connect().

◆ setReleaseSize()

virtual void setReleaseSize ( int  n)
inlinevirtual

Set the default number of tokens to be released.

References StreamConnector::_releaseSize.

Referenced by essentia::streaming::connect().

Member Data Documentation

◆ _acquireSize

◆ _releaseSize


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