Essentia  2.1-beta6-dev
Source< TokenType > Class Template Reference

#include <source.h>

Inheritance diagram for Source< TokenType >:
SourceBase Connector TypeProxy StreamConnector AbsoluteSource< TokenType >

Public Member Functions

 Source (Algorithm *parent=0)
 
 Source (const std::string &name)
 
 ~Source ()
 
const void * buffer () const
 
void * buffer ()
 
const MultiRateBuffer< TokenType > & typedBuffer () const
 
MultiRateBuffer< TokenType > & typedBuffer ()
 
virtual void setBufferType (BufferUsage::BufferUsageType type)
 
virtual BufferInfo bufferInfo () const
 
virtual void setBufferInfo (const BufferInfo &info)
 
int totalProduced () const
 
ReaderID addReader ()
 
void removeReader (ReaderID id)
 
std::vector< TokenType > & tokens ()
 
TokenType & firstToken ()
 
const TokenType & lastTokenProduced () const
 
virtual void * getTokens ()
 
virtual void * getFirstToken ()
 
void acquire ()
 
virtual bool acquire (int n)
 
void release ()
 
virtual void release (int n)
 
virtual int available () const
 
virtual void reset ()
 
- Public Member Functions inherited from SourceBase
 SourceBase (Algorithm *parent=0, const std::string &name="unnamed")
 
 SourceBase (const std::string &name)
 
 ~SourceBase ()
 
const std::vector< SinkBase * > & sinks () const
 
std::vector< SinkBase * > & sinks ()
 
bool isProxied () const
 
const std::vector< SinkBase * > & proxiedSinks () const
 
template<typename TokenType >
void push (const TokenType &value)
 
- 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
 
- Public Member Functions inherited from StreamConnector
 StreamConnector ()
 
virtual ~StreamConnector ()
 
bool acquire ()
 
void release ()
 
virtual int acquireSize () const
 
virtual int releaseSize () const
 
virtual void setAcquireSize (int n)
 
virtual void setReleaseSize (int n)
 

Protected Attributes

MultiRateBuffer< TokenType > * _buffer
 
- Protected Attributes inherited from SourceBase
std::vector< SinkBase * > _sinks
 
SourceProxyBase_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
 

Private Member Functions

virtual const std::type_info & typeInfo () const
 
virtual const std::type_info & vectorTypeInfo () const
 

Additional Inherited Members

- Protected Member Functions inherited from SourceBase
virtual void connect (SinkBase &sink)
 
virtual void disconnect (SinkBase &sink)
 
void attachProxy (SourceProxyBase *sproxy)
 
void detachProxy (SourceProxyBase *sproxy)
 

Constructor & Destructor Documentation

◆ Source() [1/2]

Source ( Algorithm parent = 0)

◆ Source() [2/2]

Source ( const std::string &  name)

◆ ~Source()

~Source ( )
inline

Member Function Documentation

◆ acquire() [1/2]

void acquire ( )
inline

◆ acquire() [2/2]

virtual bool acquire ( int  n)
inlinevirtual

Acquire (consume) the requested number of tokens.

Implements StreamConnector.

References Source< TokenType >::_buffer, and MultiRateBuffer< T >::acquireForWrite().

◆ addReader()

ReaderID addReader ( )
inlinevirtual

◆ available()

virtual int available ( ) const
inlinevirtual

Returns how many tokens are available in the stream.

Implements StreamConnector.

References Source< TokenType >::_buffer, and MultiRateBuffer< T >::availableForWrite().

◆ buffer() [1/2]

void* buffer ( )
inlinevirtual

Implements SourceBase.

References Source< TokenType >::_buffer.

◆ buffer() [2/2]

const void* buffer ( ) const
inline

◆ bufferInfo()

virtual BufferInfo bufferInfo ( ) const
inlinevirtual

◆ firstToken()

TokenType& firstToken ( )
inline

◆ getFirstToken()

virtual void* getFirstToken ( )
inlinevirtual

◆ getTokens()

virtual void* getTokens ( )
inlinevirtual

Implements SourceBase.

References Source< TokenType >::tokens().

◆ lastTokenProduced()

const TokenType& lastTokenProduced ( ) const
inline

◆ release() [1/2]

void release ( )
inline

◆ release() [2/2]

virtual void release ( int  n)
inlinevirtual

Release (produce) the requested number of tokens.

Implements StreamConnector.

References Source< TokenType >::_buffer, and MultiRateBuffer< T >::releaseForWrite().

◆ removeReader()

void removeReader ( ReaderID  id)
inlinevirtual

◆ reset()

virtual void reset ( )
inlinevirtual

Resets the state of this StreamConnector

Implements StreamConnector.

References Source< TokenType >::_buffer, and MultiRateBuffer< T >::reset().

◆ setBufferInfo()

virtual void setBufferInfo ( const BufferInfo info)
inlinevirtual

◆ setBufferType()

virtual void setBufferType ( BufferUsage::BufferUsageType  type)
inlinevirtual

◆ tokens()

std::vector<TokenType>& tokens ( )
inline

◆ totalProduced()

int totalProduced ( ) const
inlinevirtual

◆ typedBuffer() [1/2]

MultiRateBuffer<TokenType>& typedBuffer ( )
inline

◆ typedBuffer() [2/2]

const MultiRateBuffer<TokenType>& typedBuffer ( ) const
inline

◆ typeInfo()

virtual const std::type_info& typeInfo ( ) const
inlineprivatevirtual

Implements TypeProxy.

◆ vectorTypeInfo()

virtual const std::type_info& vectorTypeInfo ( ) const
inlineprivatevirtual

Implements TypeProxy.

Member Data Documentation

◆ _buffer


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