Essentia  2.1-beta5-dev
StreamConnector Class Referenceabstract

#include <streamconnector.h>

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

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

◆ 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 VectorInput< TokenType, acquireSize >::process(), SinkProxyBase::releaseSize(), and SourceProxyBase::releaseSize().

◆ reset()

◆ setAcquireSize()

◆ setReleaseSize()

Member Data Documentation

◆ _acquireSize

◆ _releaseSize


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