libsdr  0.1.0
A simple SDR library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
sdr::Source Class Reference

Generic source class. More...

#include <node.hh>

Inheritance diagram for sdr::Source:
sdr::BufferNode< std::complex< Scalar > > sdr::FIRFilter< Scalar, FIRBandPassCoeffs > sdr::FIRFilter< Scalar, FIRBandStopCoeffs > sdr::FIRFilter< Scalar, FIRHighPassCoeffs > sdr::FIRFilter< Scalar, FIRLowPassCoeffs > sdr::AGC< Scalar > sdr::AMDemod< Scalar > sdr::ASKDetector< Scalar > sdr::AutoCast< Scalar > sdr::AX25 sdr::BaseBand< Scalar > sdr::Baudot sdr::BitStream sdr::BlockingSource sdr::BPSK31< Scalar > sdr::BufferNode< Scalar > sdr::Cast< iScalar, oScalar > sdr::FilterSink< Scalar > sdr::FilterSource< Scalar > sdr::FIRFilter< Scalar, FilterCoeffs > sdr::FMDeemph< Scalar > sdr::FMDemod< iScalar, oScalar > sdr::FreqShift< Scalar > sdr::FSKDetector sdr::GWNSource< Scalar > sdr::InpolSubSampler< iScalar, oScalar > sdr::Interleave< Scalar > sdr::IQBalance< Scalar > sdr::IQBaseBand< Scalar > sdr::IQSigGen< Scalar > sdr::PortSource< Scalar > sdr::Proxy sdr::RealImagPart< Scalar > sdr::RTLSource sdr::Scale< Scalar > sdr::SigGen< Scalar > sdr::SignedToUnsigned sdr::StreamSource< Scalar > sdr::SubSample< Scalar > sdr::ToComplex< iScalar, oScalar > sdr::UnsignedToSigned sdr::USBDemod< Scalar > sdr::Varicode sdr::WavSource

Public Member Functions

 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 Member Functions

void signalEOS ()
 Signals the EOS. More...
 
void propagateConfig (const Config &config)
 Propagates the given configuration to all connected sinks. More...
 

Protected Attributes

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...
 

Detailed Description

Generic source class.

Constructor & Destructor Documentation

Source::Source ( )

Constructor.

Source::~Source ( )
virtual

Destructor.

Member Function Documentation

template<class T >
void sdr::Source::addEOS ( T *  instance,
void(T::*)()  function 
)
inline

Adds a callback to the end-of-stream signal of the source.

void Source::connect ( SinkBase sink,
bool  direct = false 
)

Connect this source to a sink.

void Source::disconnect ( SinkBase sink)

Disconnect a sink again.

void Source::propagateConfig ( const Config config)
protected

Propagates the given configuration to all connected sinks.

double Source::sampleRate ( ) const
virtual

Returns the configured sample rate or 0 otherwise.

Reimplemented in sdr::RTLSource.

void Source::send ( const RawBuffer buffer,
bool  allow_overwrite = false 
)
virtual

Sends the given buffer to all connected sinks.

void Source::setConfig ( const Config config)
virtual

Stores the configuration and propergates it if the configuration has been changed.

void Source::signalEOS ( )
protected

Signals the EOS.

Config::Type Source::type ( ) const
virtual

Returns the configured source type or Config::Type_UNDEFINED otherwise.

Member Data Documentation

Config sdr::Source::_config
protected

Holds the source configuration, this can be updated by calling setConfig.

std::list<DelegateInterface *> sdr::Source::_eos
protected

The connected EOS singal handlers.

std::map<SinkBase *, bool> sdr::Source::_sinks
protected

The connected sinks.


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