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

Namespaces

 BufferUsage
 

Classes

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

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]

◆ attach() [2/2]

◆ connect() [1/9]

void connect ( SourceBase source,
SinkBase sink 
)

Global function used for connecting algorithms.

◆ 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(), and disconnect().

◆ connect() [3/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.

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

◆ connect() [4/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 PoolStorage< TokenType, StorageType >::addToPool(), connect(), and operator>>().

◆ connect() [5/9]

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

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

◆ 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,
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() [8/9]

◆ connect() [9/9]

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

◆ 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.

Referenced by operator>>().

◆ detach() [1/2]

◆ detach() [2/2]

◆ disconnect() [1/3]

void disconnect ( SourceBase source,
SinkBase sink 
)

Global function used for disconnecting outputs from inputs.

◆ disconnect() [2/3]

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

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

Referenced by connect(), operator>>(), and SinkBase::~SinkBase().

◆ disconnect() [3/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.

◆ 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(), and essentia::nameOfType().

◆ operator>>() [1/9]

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

References connect().

◆ operator>>() [2/9]

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

References connect(), and disconnect().

Referenced by PoolConnector::PoolConnector().

◆ operator>>() [3/9]

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

References connect().

◆ operator>>() [4/9]

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

References connect().

◆ operator>>() [5/9]

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

◆ operator>>() [6/9]

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

References connect().

◆ operator>>() [7/9]

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

References connect().

◆ operator>>() [8/9]

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

◆ operator>>() [9/9]

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

◆ 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