AnimatLab  2
Test
AnimatSim::DelayLine Class Reference

Implements a Delay line of float values. More...

#include <DelayLine.h>

+ Collaboration diagram for AnimatSim::DelayLine:

Public Member Functions

 DelayLine ()
 Default constructor. More...
 
virtual ~DelayLine ()
 Destructor. More...
 
void AddValue (float fltVal)
 Adds a value to the begining of the line. More...
 
void Initialize (float fltDelayTime, float fltTimeStep)
 Initializes the Delay line. More...
 
float ReadValue ()
 Reads the current value at the end of the delay line. More...
 

Protected Attributes

CStdArray< float > m_aryRingBuf
 Ring buffer of float values.
 
int m_iDelayComp
 Size of the ring buffer-1.
 
int m_iDelaySize
 Size of the ring buffer.
 
int m_iReadIdx
 The index where we read the current top value off the ring.
 
int m_iSaveIdx
 The index where the next new value will be saved in the ring.
 

Detailed Description

Implements a Delay line of float values.

This is useful in things like synaptic delays. We need to specify the size of the delay, which specifies the size of the buffer, and then we can add float values to one end. At each time step it moves down the pipe, until it finally falls out of the pipe at the end of the delay.

Author
dcofer
Date
3/24/2011

Definition at line 22 of file DelayLine.h.

Constructor & Destructor Documentation

AnimatSim::DelayLine::DelayLine ( )

Default constructor.

Author
dcofer
Date
3/24/2011

Definition at line 23 of file DelayLine.cpp.

References m_iDelayComp, m_iDelaySize, m_iReadIdx, and m_iSaveIdx.

AnimatSim::DelayLine::~DelayLine ( )
virtual

Destructor.

Author
dcofer
Date
3/24/2011

Definition at line 37 of file DelayLine.cpp.

References m_aryRingBuf, and StdUtils::Std_TraceMsg().

+ Here is the call graph for this function:

Member Function Documentation

void AnimatSim::DelayLine::AddValue ( float  fltVal)

Adds a value to the begining of the line.

This increments the delay line appropriately.

Author
dcofer
Date
3/24/2011
Parameters
fltValThe new value.

Definition at line 84 of file DelayLine.cpp.

References m_aryRingBuf, m_iDelayComp, m_iReadIdx, and m_iSaveIdx.

void AnimatSim::DelayLine::Initialize ( float  fltDelayTime,
float  fltTimeStep 
)

Initializes the Delay line.

Author
dcofer
Date
3/24/2011
Parameters
fltDelayTimeTime of the delay.
fltTimeStepThe time step duration.

Definition at line 57 of file DelayLine.cpp.

References m_aryRingBuf, m_iDelayComp, m_iDelaySize, m_iReadIdx, and m_iSaveIdx.

float AnimatSim::DelayLine::ReadValue ( )

Reads the current value at the end of the delay line.

Author
dcofer
Date
3/24/2011
Returns
The value at the end of the line.

Definition at line 107 of file DelayLine.cpp.

References m_aryRingBuf, and m_iReadIdx.


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