libsdr  0.1.0
A simple SDR library
Public Member Functions | Protected Attributes | List of all members
sdr::BufferNode< Scalar > Class Template Reference

A simple buffering node, that ensures a fixed buffer size. More...

#include <buffernode.hh>

Inheritance diagram for sdr::BufferNode< Scalar >:
sdr::Sink< Scalar > sdr::Source sdr::SinkBase

Public Member Functions

 BufferNode (size_t bufferSize)
 Constructs a new buffer node. More...
 
virtual void config (const Config &src_cfg)
 Configures the buffer node. More...
 
virtual void process (const Buffer< Scalar > &buffer, bool allow_overwrite)
 Process the incomming data. More...
 
- Public Member Functions inherited from sdr::Sink< Scalar >
 Sink ()
 Constructor. More...
 
virtual ~Sink ()
 Drestructor. More...
 
virtual void handleBuffer (const RawBuffer &buffer, bool allow_overwrite)
 Re-implemented from SinkBase. More...
 
- Public Member Functions inherited from sdr::SinkBase
 SinkBase ()
 Constructor. More...
 
virtual ~SinkBase ()
 Destructor. More...
 
- Public Member Functions inherited from sdr::Source
 Source ()
 Constructor. More...
 
virtual ~Source ()
 Destructor. More...
 
virtual void send (const RawBuffer &buffer, bool allow_overwrite=false)
 Sends the given buffer to all connected sinks. More...
 
void connect (SinkBase *sink, bool direct=false)
 Connect this source to a sink. More...
 
void disconnect (SinkBase *sink)
 Disconnect a sink again. More...
 
virtual void setConfig (const Config &config)
 Stores the configuration and propergates it if the configuration has been changed. More...
 
virtual double sampleRate () const
 Returns the configured sample rate or 0 otherwise. More...
 
virtual Config::Type type () const
 Returns the configured source type or Config::Type_UNDEFINED otherwise. More...
 
template<class T >
void addEOS (T *instance, void(T::*function)())
 Adds a callback to the end-of-stream signal of the source. More...
 

Protected Attributes

size_t _bufferSize
 The desired buffer size. More...
 
BufferSet< Scalar > _bufferSet
 A set of output buffers. More...
 
Buffer< Scalar > _temp
 An intermediate buffer to hold left-over samples from the previous buffers. More...
 
size_t _samplesLeft
 Number of samples left. More...
 
- Protected Attributes inherited from sdr::Source
Config _config
 Holds the source configuration, this can be updated by calling setConfig. More...
 
std::map< SinkBase *, bool > _sinks
 The connected sinks. More...
 
std::list< DelegateInterface * > _eos
 The connected EOS singal handlers. More...
 

Additional Inherited Members

- Protected Member Functions inherited from sdr::Source
void signalEOS ()
 Signals the EOS. More...
 
void propagateConfig (const Config &config)
 Propagates the given configuration to all connected sinks. More...
 

Detailed Description

template<class Scalar>
class sdr::BufferNode< Scalar >

A simple buffering node, that ensures a fixed buffer size.

This node is useful, expecially in front of a node that performs a FFT transform, which requires a certain buffer size.

Constructor & Destructor Documentation

template<class Scalar>
sdr::BufferNode< Scalar >::BufferNode ( size_t  bufferSize)
inline

Constructs a new buffer node.

Parameters
bufferSizeSpecifies the desired size of the output buffers.

Member Function Documentation

template<class Scalar>
virtual void sdr::BufferNode< Scalar >::config ( const Config src_cfg)
inlinevirtual

Configures the buffer node.

Implements sdr::SinkBase.

template<class Scalar>
virtual void sdr::BufferNode< Scalar >::process ( const Buffer< Scalar > &  buffer,
bool  allow_overwrite 
)
inlinevirtual

Process the incomming data.

Implements sdr::Sink< Scalar >.

Member Data Documentation

template<class Scalar>
BufferSet<Scalar> sdr::BufferNode< Scalar >::_bufferSet
protected

A set of output buffers.

template<class Scalar>
size_t sdr::BufferNode< Scalar >::_bufferSize
protected

The desired buffer size.

template<class Scalar>
size_t sdr::BufferNode< Scalar >::_samplesLeft
protected

Number of samples left.

template<class Scalar>
Buffer<Scalar> sdr::BufferNode< Scalar >::_temp
protected

An intermediate buffer to hold left-over samples from the previous buffers.


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