sdr::Source Class Reference

Generic source class. More...

`#include <node.hh>`

Inheritance diagram for sdr::Source:

## 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:

- /Users/hannes/Uni/Elektronik/sdr/libsdr/src/node.hh
- /Users/hannes/Uni/Elektronik/sdr/libsdr/src/node.cc