20 #ifndef ESSENTIA_STREAMING_COPY_H
21 #define ESSENTIA_STREAMING_COPY_H
28 template <
typename TokenType>
37 static int _copyId = 0;
41 int copyId = _copyId++;
42 std::ostringstream
name;
43 name <<
"Copy<" <<
nameOfType(
typeid(TokenType)) <<
">[" << copyId <<
"]";
53 int nframes = std::min(
_framesIn.available(),
54 _framesIn.buffer().bufferInfo().maxContiguousElements);
55 nframes = std::max(nframes, 1);
57 EXEC_DEBUG(
"Consuming " << nframes <<
" tokens");
60 EXEC_DEBUG(
"Could not consume because not enough input tokens");
65 EXEC_DEBUG(
"Could not consume because not enough output 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)
void declareOutput(SourceBase &source, const std::string &name, const std::string &desc)
Copy()
Definition: copy.h:35
AlgorithmStatus process()
Definition: copy.h:52
void declareParameters()
Definition: copy.h:50
Source< TokenType > _framesOut
Definition: copy.h:32
Sink< TokenType > _framesIn
Definition: copy.h:31
#define E_DEBUG(module, msg)
Definition: debugging.h:157
#define EXEC_DEBUG(msg)
Definition: debugging.h:161
AlgorithmStatus
Definition: streamingalgorithm.h:106
@ OK
Definition: streamingalgorithm.h:107
@ NO_INPUT
Definition: streamingalgorithm.h:111
@ NO_OUTPUT
Definition: streamingalgorithm.h:112
Definition: algorithm.h:28
void fastcopy(T *dest, const T *src, int n)
Definition: essentiautil.h:180
std::string nameOfType(const std::type_info &type)
@ EFactory
Definition: debugging.h:44