Essentia  2.1-beta6-dev
essentia::streaming Namespace Reference

Namespaces

 BufferUsage
 

Classes

class  Connector
 
class  StreamConnector
 
class  AccumulatorAlgorithm
 
class  Copy
 
class  DevNull
 
class  DiskWriter
 
class  FileOutput
 
class  PoolStorageBase
 
class  PoolStorage
 
class  PoolConnector
 
class  RingBufferInput
 
class  RingBufferOutput
 
class  RingBufferVectorOutput
 
class  VectorInput
 
class  VectorOutput
 
class  MultiRateBuffer
 
class  Window
 
class  PhantomBuffer
 
class  Source
 
class  Sink
 
class  SinkBase
 
class  SinkProxyBase
 
class  SinkProxy
 
class  AbsoluteSource
 
class  SourceBase
 
class  SourceProxyBase
 
class  SourceProxy
 
class  Algorithm
 
class  ProcessStep
 
class  ChainFrom
 
class  SingleShot
 
class  AlgorithmComposite
 
class  StreamingAlgorithmWrapper
 
class  BufferInfo
 
class  RingBufferImpl
 

Typedefs

typedef EssentiaFactory< AlgorithmAlgorithmFactory
 

Enumerations

enum  DevNullConnector { NOWHERE , DEVNULL }
 
enum  AlgorithmStatus {
  OK = 0 , CONTINUE = 0 , PASS , FINISHED ,
  NO_INPUT , NO_OUTPUT
}
 
enum  NumeralType { TOKEN , STREAM }
 

Functions

void ESSENTIA_API registerAlgorithm ()
 
void connect (SourceBase &source, DevNullConnector devnull)
 
void operator>> (SourceBase &source, DevNullConnector devnull)
 
void disconnect (SourceBase &source, DevNullConnector devnull)
 
template<typename TokenType >
void write_binary (std::ostream *_stream, const TokenType &value)
 
template<>
void write_binary< std::vector< Real > > (std::ostream *_stream, const std::vector< Real > &value)
 
void connect (SourceBase &source, Pool &pool, const std::string &descriptorName)
 
void operator>> (SourceBase &source, const PoolConnector &pc)
 
void connectSingleValue (SourceBase &source, Pool &pool, const std::string &descriptorName)
 
void disconnect (SourceBase &source, Pool &pool, const std::string &descriptorName)
 
template<typename T >
void connect (VectorInput< T > &v, SinkBase &sink)
 
template<typename T >
void operator>> (VectorInput< T > &v, SinkBase &sink)
 
template<typename T >
void connect (std::vector< T > &v, SinkBase &sink)
 
template<typename T >
void operator>> (std::vector< T > &v, SinkBase &sink)
 
template<typename TokenType , typename StorageType >
void connect (SourceBase &source, VectorOutput< TokenType, StorageType > &v)
 
template<typename TokenType , typename StorageType >
void operator>> (SourceBase &source, VectorOutput< TokenType, StorageType > &v)
 
template<typename T >
void connect (SourceBase &source, std::vector< T > &v)
 
template<typename T >
void operator>> (SourceBase &source, std::vector< T > &v)
 
void connect (SourceBase &source, SinkBase &sink)
 
void disconnect (SourceBase &source, SinkBase &sink)
 
void attach (SinkProxyBase &proxy, SinkBase &innerSink)
 
void detach (SinkProxyBase &proxy, SinkBase &innerSink)
 
void operator>> (SinkProxyBase &proxy, SinkBase &innerSink)
 
template<typename T >
const T & lastTokenProduced (const SourceBase &source)
 
void attach (SourceBase &innerSource, SourceProxyBase &proxy)
 
void detach (SourceBase &innerSource, SourceProxyBase &proxy)
 
void operator>> (SourceBase &innerSource, SourceProxyBase &proxy)
 
void operator>> (SourceBase &source, SinkBase &sink)
 
void connect (SinkBase &sink, SourceBase &source)
 
void connect (Algorithm *sourceAlgo, const std::string &sourcePort, Algorithm *sinkAlgo, const std::string &sinkPort)
 

Typedef Documentation

◆ AlgorithmFactory

Enumeration Type Documentation

◆ AlgorithmStatus

This is the return type of the Algorithm::acquireData() and Algorithm::process() methods.

It can be either one of the following values:

  • OK means that all sources and sinks could acquire enough tokens. when you return this from the process() method it means you actually managed to consume and/or produce something.
  • CONTINUE synonym with OK, means we did do something and want to continue consuming/producing.
  • PASS means that you don't want to do anything at the moment, for instance if you are waiting for the end of the stream. This can only be returned by the process() method. (implementation detail: in effect, this means the same as NO_INPUT, which is that everything that could be consumed has been consumed, but it looks semantically better in certain places, hence its existence)
  • FINISHED means that you returned something, but that you don't want to be called anymore. This can only be returned by the process() method, and should be used by those algorithms that wait for the end of the stream to output a value.
  • NO_INPUT means that there was at least one Sink for which there were not enough tokens available.
  • NO_OUTPUT means that there was at least one Source for which there were not enough tokens available (output buffer full).
Enumerator
OK 
CONTINUE 
PASS 
FINISHED 
NO_INPUT 
NO_OUTPUT 

◆ DevNullConnector

Enumerator
NOWHERE 
DEVNULL 

◆ NumeralType

Enumerator
TOKEN 
STREAM 

Function Documentation

◆ attach() [1/2]

void attach ( SinkProxyBase proxy,
SinkBase innerSink 
)
inline

Referenced by operator>>().

◆ attach() [2/2]

void attach ( SourceBase innerSource,
SourceProxyBase proxy 
)
inline

◆ connect() [1/9]

void essentia::streaming::connect ( Algorithm sourceAlgo,
const std::string &  sourcePort,
Algorithm sinkAlgo,
const std::string &  sinkPort 
)

Global function used for connecting algorithms. API is not as nice as the other one, but error messages in case a connection fails are more explicit.

◆ connect() [2/9]

void essentia::streaming::connect ( SinkBase sink,
SourceBase source 
)
inline

Global function used for connecting algorithms. Same function as the previous one, but with the order of arguments reversed.

References connect().

◆ connect() [3/9]

void essentia::streaming::connect ( SourceBase source,
DevNullConnector  devnull 
)

Connect a source (eg: the output of an algorithm) to a DevNull, so the data the source outputs does not block the whole processing.

Referenced by connect(), and operator>>().

◆ connect() [4/9]

void essentia::streaming::connect ( SourceBase source,
Pool pool,
const std::string &  descriptorName 
)

Connect a source (eg: the output of an algorithm) to a Pool, and use the given name as an identifier in the Pool.

◆ connect() [5/9]

void connect ( SourceBase source,
SinkBase sink 
)

Global function used for connecting algorithms.

◆ connect() [6/9]

void essentia::streaming::connect ( SourceBase source,
std::vector< T > &  v 
)

Connect a source (eg: the output of an algorithm) to a vector that will serve as storage.

References connect(), and Algorithm::input().

◆ connect() [7/9]

void essentia::streaming::connect ( SourceBase source,
VectorOutput< TokenType, StorageType > &  v 
)

References connect(), and Algorithm::input().

◆ connect() [8/9]

void essentia::streaming::connect ( std::vector< T > &  v,
SinkBase sink 
)

◆ connect() [9/9]

◆ connectSingleValue()

void essentia::streaming::connectSingleValue ( SourceBase source,
Pool pool,
const std::string &  descriptorName 
)

Connect a source (eg: the output of an algorithm) to a Pool, and use the given name as an identifier in the Pool. Forces the use of the Pool::set method, instead of Pool::add.

◆ detach() [1/2]

◆ detach() [2/2]

void detach ( SourceBase innerSource,
SourceProxyBase proxy 
)
inline

◆ disconnect() [1/3]

void essentia::streaming::disconnect ( SourceBase source,
DevNullConnector  devnull 
)

Disconnect a source (eg: the output of an algorithm) from a DevNull.

Referenced by SinkBase::~SinkBase().

◆ disconnect() [2/3]

void essentia::streaming::disconnect ( SourceBase source,
Pool pool,
const std::string &  descriptorName 
)

Disconnect a source (eg: the output of an algorithm) from a Pool.

◆ disconnect() [3/3]

void disconnect ( SourceBase source,
SinkBase sink 
)

Global function used for disconnecting outputs from inputs.

◆ lastTokenProduced()

const T& essentia::streaming::lastTokenProduced ( const SourceBase source)

Helper function to be able to call lastTokenProduced on an un-typed SourceBase.

References Connector::fullName(), Source< TokenType >::lastTokenProduced(), and essentia::nameOfType().

◆ operator>>() [1/9]

void essentia::streaming::operator>> ( SinkProxyBase proxy,
SinkBase innerSink 
)
inline

References attach().

◆ operator>>() [2/9]

void essentia::streaming::operator>> ( SourceBase innerSource,
SourceProxyBase proxy 
)
inline

References attach().

◆ operator>>() [3/9]

void essentia::streaming::operator>> ( SourceBase source,
const PoolConnector pc 
)
inline

◆ operator>>() [4/9]

void essentia::streaming::operator>> ( SourceBase source,
DevNullConnector  devnull 
)
inline

References connect().

◆ operator>>() [5/9]

void essentia::streaming::operator>> ( SourceBase source,
SinkBase sink 
)
inline

References connect().

◆ operator>>() [6/9]

void essentia::streaming::operator>> ( SourceBase source,
std::vector< T > &  v 
)

References connect().

◆ operator>>() [7/9]

void essentia::streaming::operator>> ( SourceBase source,
VectorOutput< TokenType, StorageType > &  v 
)

References connect().

◆ operator>>() [8/9]

void essentia::streaming::operator>> ( std::vector< T > &  v,
SinkBase sink 
)

References connect().

◆ operator>>() [9/9]

void essentia::streaming::operator>> ( VectorInput< T > &  v,
SinkBase sink 
)

References connect().

◆ registerAlgorithm()

void ESSENTIA_API essentia::streaming::registerAlgorithm ( )

This function registers the algorithms in the factory. The waf build script dynamically generates the contents of the file essentia_algorithms_reg.cpp which implements this function.

◆ write_binary()

void essentia::streaming::write_binary ( std::ostream *  _stream,
const TokenType &  value 
)
inline

◆ write_binary< std::vector< Real > >()

void essentia::streaming::write_binary< std::vector< Real > > ( std::ostream *  _stream,
const std::vector< Real > &  value 
)
inline