Essentia  2.1-beta6-dev
SinkBase Class Referenceabstract

#include <sinkbase.h>

Inheritance diagram for SinkBase:
Connector TypeProxy StreamConnector Sink< T > Sink< std::vector< Real > > Sink< Real > Sink< TokenType > SinkProxyBase SinkProxy< TokenType >

Public Member Functions

 SinkBase (Algorithm *parent=0, const std::string &name="unnamed")
 
 SinkBase (const std::string &name)
 
 ~SinkBase ()
 
const SourceBasesource () const
 
SourceBasesource ()
 
virtual void setSource (SourceBase *source)
 
ReaderID id () const
 
virtual void setId (ReaderID id)
 
virtual const void * getTokens () const =0
 
virtual const void * getFirstToken () const =0
 
- Public Member Functions inherited from Connector
 Connector (Algorithm *parent=0, const std::string &name="Unnamed")
 
 Connector (const std::string &name)
 
const Algorithmparent () const
 
Algorithmparent ()
 
void setParent (Algorithm *parent)
 
std::string parentName () const
 
std::string fullName () const
 
- Public Member Functions inherited from TypeProxy
 TypeProxy ()
 
 TypeProxy (const std::string &name)
 
virtual ~TypeProxy ()
 
const std::string & name () const
 
void setName (const std::string &name)
 
void checkType (const std::type_info &received, const std::type_info &expected) const
 
template<typename Type >
void checkType () const
 
void checkSameTypeAs (const TypeProxy &obj) const
 
void checkVectorSameTypeAs (const TypeProxy &obj) const
 
virtual const std::type_info & typeInfo () const =0
 
virtual const std::type_info & vectorTypeInfo () const =0
 
- Public Member Functions inherited from StreamConnector
 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 Member Functions

virtual void connect (SourceBase &source)
 
virtual void disconnect (SourceBase &source)
 
void attachProxy (SinkProxyBase *sproxy)
 
void detachProxy (SinkProxyBase *sproxy)
 

Protected Attributes

SourceBase_source
 
ReaderID _id
 
SinkProxyBase_sproxy
 
- Protected Attributes inherited from Connector
Algorithm_parent
 
- Protected Attributes inherited from TypeProxy
std::string _name
 
- Protected Attributes inherited from StreamConnector
int _acquireSize
 
int _releaseSize
 

Friends

class SourceBase
 
void connect (SourceBase &source, SinkBase &sink)
 
void disconnect (SourceBase &source, SinkBase &sink)
 
void attach (SinkProxyBase &proxy, SinkBase &innerSink)
 
void detach (SinkProxyBase &proxy, SinkBase &innerSink)
 

Detailed Description

This is the base class from which Sinks should derive. It defines the basic interface a Sink should provide, such as the acquire() and release() methods, and a way to get hold of one or more tokens that are waiting to be consumed. It is untyped (in the sense that it doesn't know which type are the tokens), but derives from TypeProxy and as such has functions to can do type-checking with respect to the types of the derived Sink (which is a templated class, the template being the token type). Look at the Sink implementation for more information.

Constructor & Destructor Documentation

◆ SinkBase() [1/2]

SinkBase ( Algorithm parent = 0,
const std::string &  name = "unnamed" 
)
inline

◆ SinkBase() [2/2]

SinkBase ( const std::string &  name)
inline

◆ ~SinkBase()

Member Function Documentation

◆ attachProxy()

void attachProxy ( SinkProxyBase sproxy)
protected

◆ connect()

virtual void connect ( SourceBase source)
protectedvirtual

Reimplemented in SinkProxy< TokenType >.

◆ detachProxy()

void detachProxy ( SinkProxyBase sproxy)
protected

◆ disconnect()

virtual void disconnect ( SourceBase source)
protectedvirtual

Reimplemented in SinkProxy< TokenType >.

◆ getFirstToken()

virtual const void* getFirstToken ( ) const
pure virtual

◆ getTokens()

virtual const void* getTokens ( ) const
pure virtual

◆ id()

ReaderID id ( ) const

◆ setId()

virtual void setId ( ReaderID  id)
virtual

◆ setSource()

virtual void setSource ( SourceBase source)
virtual

◆ source() [1/2]

SourceBase* source ( )
inline

References SinkBase::_source.

◆ source() [2/2]

const SourceBase* source ( ) const
inline

Friends And Related Function Documentation

◆ attach

void attach ( SinkProxyBase proxy,
SinkBase innerSink 
)
friend

◆ connect

void connect ( SourceBase source,
SinkBase sink 
)
friend

Global function used for connecting algorithms.

◆ detach

void detach ( SinkProxyBase proxy,
SinkBase innerSink 
)
friend

◆ disconnect

void disconnect ( SourceBase source,
SinkBase sink 
)
friend

Global function used for disconnecting outputs from inputs.

◆ SourceBase

friend class SourceBase
friend

Member Data Documentation

◆ _id

◆ _source

◆ _sproxy


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