20 #ifndef ESSENTIA_VECTORINPUT_H
21 #define ESSENTIA_VECTORINPUT_H
23 #include "../streamingalgorithm.h"
29 template <
typename TokenType,
int acquireSize = 1>
57 template <
typename Array>
60 _inputVector =
new std::vector<TokenType>(arrayToVector<TokenType>(inputArray));
75 std::vector<TokenType>* inputVector =
new std::vector<TokenType>();
76 inputVector->resize(
input.dim1());
78 for (
int i=0; i<
input.dim1(); ++i) {
79 (*inputVector)[i].resize(
input.dim2());
80 for (
int j=0; j<
input.dim2(); ++j) {
81 (*inputVector)[i][j] =
input[i][j];
140 _output.setAcquireSize(howmuch);
141 _output.setReleaseSize(howmuch);
155 TokenType* dest = (TokenType*)
_output.getFirstToken();
156 const TokenType* src = &((*_inputVector)[
_idx]);
157 int howmuch =
_output.acquireSize();
171 template <
typename T>
185 template <
typename T>
192 template <
typename T>
207 template <
typename T>
void setName(const std::string &name)
Definition: configurable.h:53
Definition: streamingalgorithm.h:140
SourceBase & output(const std::string &name)
AlgorithmStatus acquireData()
SinkBase & input(const std::string &name)
void declareOutput(SourceBase &source, const std::string &name, const std::string &desc)
Definition: sinkbase.h:52
Definition: sourcebase.h:52
virtual void setReleaseSize(int n)
Definition: streamconnector.h:84
virtual void setAcquireSize(int n)
Definition: streamconnector.h:79
virtual int acquireSize() const
Definition: streamconnector.h:69
#define EXEC_DEBUG(msg)
Definition: debugging.h:161
void operator>>(SourceBase &source, DevNullConnector devnull)
Definition: devnull.h:81
void connect(SourceBase &source, DevNullConnector devnull)
AlgorithmStatus
Definition: streamingalgorithm.h:106
@ PASS
Definition: streamingalgorithm.h:109
@ 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