Essentia
2.1-beta6-dev
|
#include <sourcebase.h>
Public Member Functions | |
SourceBase (Algorithm *parent=0, const std::string &name="unnamed") | |
SourceBase (const std::string &name) | |
~SourceBase () | |
virtual void * | buffer ()=0 |
virtual int | totalProduced () const =0 |
const std::vector< SinkBase * > & | sinks () const |
std::vector< SinkBase * > & | sinks () |
virtual void * | getTokens ()=0 |
virtual void * | getFirstToken ()=0 |
bool | isProxied () const |
const std::vector< SinkBase * > & | proxiedSinks () const |
template<typename TokenType > | |
void | push (const TokenType &value) |
virtual void | setBufferType (BufferUsage::BufferUsageType type)=0 |
virtual BufferInfo | bufferInfo () const =0 |
virtual void | setBufferInfo (const BufferInfo &info)=0 |
Public Member Functions inherited from Connector | |
Connector (Algorithm *parent=0, const std::string &name="Unnamed") | |
Connector (const std::string &name) | |
const Algorithm * | parent () const |
Algorithm * | parent () |
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 (SinkBase &sink) |
virtual void | disconnect (SinkBase &sink) |
virtual ReaderID | addReader ()=0 |
virtual void | removeReader (ReaderID id)=0 |
void | attachProxy (SourceProxyBase *sproxy) |
void | detachProxy (SourceProxyBase *sproxy) |
Protected Attributes | |
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 |
Friends | |
class | SourceProxyBase |
template<typename T > | |
class | SourceProxy |
template<typename T > | |
class | SinkProxy |
void | connect (SourceBase &source, SinkBase &sink) |
void | disconnect (SourceBase &source, SinkBase &sink) |
void | attach (SourceBase &innerSource, SourceProxyBase &proxy) |
void | detach (SourceBase &innerSource, SourceProxyBase &proxy) |
This is the base class from which Sources should derive. It defines the basic interface a Source 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 that 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 Source implementation for more information.
|
inline |
|
inline |
~SourceBase | ( | ) |
|
protectedpure virtual |
Implemented in SourceProxy< TokenType >, AbsoluteSource< TokenType >, Source< TokenType >, and Source< Real >.
|
protected |
|
pure virtual |
Implemented in SourceProxyBase, Source< TokenType >, and Source< Real >.
Referenced by Sink< TokenType >::buffer(), SinkProxyBase::buffer(), and SourceProxyBase::buffer().
|
pure virtual |
Implemented in SourceProxyBase, Source< TokenType >, and Source< Real >.
Referenced by SourceProxyBase::bufferInfo().
|
protectedvirtual |
Reimplemented in SourceProxyBase.
Referenced by SourceProxyBase::connect().
|
protected |
|
protectedvirtual |
Reimplemented in SourceProxyBase.
Referenced by SourceProxyBase::disconnect().
|
pure virtual |
Implemented in SourceProxy< TokenType >, Source< TokenType >, and Source< Real >.
Referenced by SourceBase::push(), and OutputBase::setSourceFirstToken().
|
pure virtual |
Implemented in SourceProxy< TokenType >, Source< TokenType >, and Source< Real >.
Referenced by OutputBase::setSourceTokens().
|
inline |
References SourceBase::_sproxy.
const std::vector<SinkBase*>& proxiedSinks | ( | ) | const |
Return the list of sinks that are connected through a proxy. Make sure to call isProxied() before.
|
inline |
|
protectedpure virtual |
Implemented in SourceProxy< TokenType >, Source< TokenType >, and Source< Real >.
|
pure virtual |
Implemented in SourceProxyBase, Source< TokenType >, and Source< Real >.
Referenced by SourceProxyBase::setBufferInfo().
|
pure virtual |
Implemented in SourceProxyBase, Source< TokenType >, and Source< Real >.
Referenced by SourceProxyBase::setBufferType().
|
inline |
References SourceBase::_sinks.
|
inline |
References SourceBase::_sinks.
|
pure virtual |
Implemented in SourceProxy< TokenType >, Source< TokenType >, and Source< Real >.
Referenced by SourceProxy< TokenType >::totalProduced().
|
friend |
|
friend |
Global function used for connecting algorithms.
|
friend |
|
friend |
Global function used for disconnecting outputs from inputs.
|
friend |
|
friend |
|
friend |
|
protected |
Referenced by SourceProxy< TokenType >::addReader(), and SourceBase::sinks().
|
protected |
Referenced by SourceBase::isProxied().