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

Interleaves several input streams. More...

#include <combine.hh>

Inheritance diagram for sdr::Interleave< Scalar >:
sdr::Combine< Scalar > sdr::Source

Public Member Functions

 Interleave (size_t N)
 Constructor. More...
 
Sink< Scalar > * sink (size_t i)
 Retunrs the i-th sink. More...
 
virtual void config (const Config &cfg)
 Configures the interleave node. More...
 
virtual void process (std::vector< RingBuffer< Scalar > > &buffers, size_t N)
 Processes the data from all sinks. More...
 
- Public Member Functions inherited from sdr::Combine< Scalar >
 Combine (size_t N)
 Constructor,
N specifies the number of sinks. More...
 
virtual ~Combine ()
 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 _N
 The number of sinks. More...
 
Buffer< Scalar > _buffer
 The putput buffer. More...
 
- Protected Attributes inherited from sdr::Combine< Scalar >
std::vector< RingBuffer< Scalar > > _buffers
 The ring buffers of all combine sinks. More...
 
std::vector< CombineSink< Scalar > * > _sinks
 The combine sinks. More...
 
Config _config
 The output configuration. 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::Combine< Scalar >
void notifyConfig (size_t idx, const Config &cfg)
 Unifies the configuration of all sinks. More...
 
void notifyData (size_t idx)
 Determines the minimum amount of data that is available on all ring buffers. More...
 
- 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::Interleave< Scalar >

Interleaves several input streams.

Constructor & Destructor Documentation

template<class Scalar >
sdr::Interleave< Scalar >::Interleave ( size_t  N)
inline

Constructor.

Member Function Documentation

template<class Scalar >
virtual void sdr::Interleave< Scalar >::config ( const Config cfg)
inlinevirtual

Configures the interleave node.

Implements sdr::Combine< Scalar >.

template<class Scalar >
virtual void sdr::Interleave< Scalar >::process ( std::vector< RingBuffer< Scalar > > &  buffers,
size_t  N 
)
inlinevirtual

Processes the data from all sinks.

Implements sdr::Combine< Scalar >.

template<class Scalar >
Sink<Scalar>* sdr::Interleave< Scalar >::sink ( size_t  i)
inline

Retunrs the i-th sink.

Member Data Documentation

template<class Scalar >
Buffer<Scalar> sdr::Interleave< Scalar >::_buffer
protected

The putput buffer.

template<class Scalar >
size_t sdr::Interleave< Scalar >::_N
protected

The number of sinks.


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