Marsyas  0.5.0-beta1
Public Member Functions
Accumulator Class Reference

Accumulate result of multiple ticks. More...

#include <Accumulator.h>

Inherits MarSystem.

Public Member Functions

 Accumulator (std::string name)
 Accumulator (const Accumulator &a)
bool addMarSystem (MarSystem *marsystem)
MarSystemclone () const
void myProcess (realvec &in, realvec &out)
 Processes data.
 ~Accumulator ()

Detailed Description

Accumulate result of multiple ticks.

Accumulate result of multiple tick process calls to child (i.e internal) MarSystem. Spit output only once when all the results are accumulated (either using a predefined number of processing ticks or when explicitly "flushed"). Used to change the rate of process requests.

For example, if mode is "countTicks" and nTimes is 5, then each time the Accumulator receives a tick(), it sends 5 tick()s to the MarSystems that are inside it.

Controls: - mrs_string/mode [rw] : in "countTicks" mode accumulates and outputs the result of multiple tick process calls (specified by the value in the nTimes control) to the child MarSystem. In "explicitFlush" mode, it keeps accumulating the result of multiple tick process calls to the child MarSystem until the flush control is set to true, subsequently sending the accumulated data to the output.

..........X.

So, having the graphic above in mind, supose we have an Accumulator in "explicitFlush", with a child onset detector MarSystem that at each tick, looks at its previous output and compares it to the current one, deciding if an onset existed one output ago (so, it need to look one output into the future

Definition at line 115 of file Accumulator.h.


Constructor & Destructor Documentation

Accumulator ( std::string  name)

Definition at line 25 of file Accumulator.cpp.

Accumulator ( const Accumulator a)

Definition at line 33 of file Accumulator.cpp.

Definition at line 44 of file Accumulator.cpp.


Member Function Documentation

bool addMarSystem ( MarSystem marsystem) [virtual]

Reimplemented from MarSystem.

Definition at line 77 of file Accumulator.cpp.

MarSystem * clone ( ) const [virtual]

Implements MarSystem.

Definition at line 49 of file Accumulator.cpp.

void myProcess ( realvec in,
realvec out 
) [virtual]

Processes data.

Parameters:
inInput data to read.
outOutput data to write.

Implement this method in subclass to define specific data processing.

Implements MarSystem.

Definition at line 156 of file Accumulator.cpp.


The documentation for this class was generated from the following files: