TS++ library: time series library
ts::drop::DropContainer< T > Class Template Referenceabstract

#include <dropcontainer.h>

Inheritance diagram for ts::drop::DropContainer< T >:

Public Types

typedef T Tvalue
 
typedef DropContainer< Tvalue > * PDropContainer
 
typedef aff::Series< TvalueTseries
 

Public Member Functions

 DropContainer ()
 
virtual ~DropContainer ()
 
virtual void initialize (const int &n)
 initialize for n samples input More...
 
virtual void drop (const Tvalue &v)=0
 this function accepts samples More...
 
virtual PDropContainer attach (const DropContainer &c)
 
virtual const Tseries::Tcoc & container () const
 
virtual int downsampling_factor () const
 
virtual Tvalue gain () const
 

Protected Member Functions

virtual PDropContainer clone () const =0
 
virtual void initializenext (const int &n)=0
 
PDropContainer attached () const
 

Protected Attributes

PDropContainer Moutput
 

Detailed Description

template<class T>
class ts::drop::DropContainer< T >

Abstract base class

The DropContainer class is an abstract base class. It is used to collect time series samples and to decimate them on the fly. Derived classes have to be defined for this interface in oder to provide proper downsampling.

The interface works as follows (code is given only for illustration; in your application you will use different classes):

  1. Declare the required downsamplers:
  2. Combine downsamplers:
    d1.attach(d2)->attach(d3);
    d1 will pass samples to a copy of d2 which again passes its output to a copy of d3.
  3. Initizalize the linked list of downsamplers:
    d1.initialize(a.size());
    This will create a series container at the other end of the process. Initialization of the same downsampler list may be done for different numers of samples several times.
  4. Perform downsampling.
  5. Extract result through
    DUMP( d1.container() );

The full code as used in tstest.cc is as follows:

aff::Series<int> a(1,36);
for (int i=a.f(); i<=a.l(); ++i) { a(i)=i; }
d1.attach(d2)->attach(d3);
d1.initialize(a.size());
for (int i=a.f(); i<=a.l(); ++i) { d1.drop(a(i)); }
DUMP( a );
DUMP( d1.container() );

The DropContainer class sets up a linked list of pointers. It keeps track of initialized pointers and call the delete appropriately.

The total downsampling factor is returned by member function downsampling_factor() and the overall gain is provided by member function gain().

Definition at line 105 of file dropcontainer.h.


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