20 #ifndef ESSENTIA_DEVNULL_H
21 #define ESSENTIA_DEVNULL_H
23 #include "../streamingalgorithm.h"
28 template <
typename TokenType>
36 static int _devnullId = 0;
40 int devnullId = _devnullId++;
41 std::ostringstream
name;
42 name <<
"DevNull<" <<
nameOfType(
typeid(TokenType)) <<
">[" << devnullId <<
"]";
51 int nframes = std::min(
_frames.available(),
52 _frames.buffer().bufferInfo().maxContiguousElements);
53 nframes = std::max(nframes, 1);
55 EXEC_DEBUG(
"Consuming " << nframes <<
" tokens");
57 if (!
_frames.acquire(nframes)) {
58 EXEC_DEBUG(
"Could not consume because not enough input tokens");
void setName(const std::string &name)
Definition: configurable.h:53
std::string _name
Definition: configurable.h:171
const std::string & name() const
Definition: configurable.h:48
Definition: threading.h:95
Definition: threading.h:80
Definition: streamingalgorithm.h:140
void declareInput(SinkBase &sink, const std::string &name, const std::string &desc)
DevNull()
Definition: devnull.h:34
AlgorithmStatus process()
Definition: devnull.h:50
void declareParameters()
Definition: devnull.h:48
Sink< TokenType > _frames
Definition: devnull.h:31
Definition: sourcebase.h:52
#define E_DEBUG(module, msg)
Definition: debugging.h:157
#define EXEC_DEBUG(msg)
Definition: debugging.h:161
void disconnect(SourceBase &source, DevNullConnector devnull)
void operator>>(SourceBase &source, DevNullConnector devnull)
Definition: devnull.h:81
DevNullConnector
Definition: devnull.h:70
@ NOWHERE
Definition: devnull.h:71
@ DEVNULL
Definition: devnull.h:72
void connect(SourceBase &source, DevNullConnector devnull)
AlgorithmStatus
Definition: streamingalgorithm.h:106
@ OK
Definition: streamingalgorithm.h:107
@ NO_INPUT
Definition: streamingalgorithm.h:111
Definition: algorithm.h:28
std::string nameOfType(const std::type_info &type)
@ EFactory
Definition: debugging.h:44