sdr::AutoCast< Scalar > Class Template Reference
Data handling nodes.

This class performs some automatic casts to a certain buffer type (if possible) specified by the template argument. More...

`#include <autocast.hh>`

Inheritance diagram for sdr::AutoCast< Scalar >:

## Public Member Functions

| AutoCast ()
| Constructor. More...
virtual void | config (const Config &src_cfg)
| Configures the auto cast node. More...
virtual void | handleBuffer (const RawBuffer &buffer, bool allow_overwrite)
| Needs to be implemented by any sub-type to process the received data. 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...

## Static Protected Member Functions

static size_t | _identity (const RawBuffer &in, const RawBuffer &out)
| Performs no cast at all. More...
static size_t | _uint8_int8 (const RawBuffer &in, const RawBuffer &out)
| uint8_t -> int8_t
static size_t | _uint16_int8 (const RawBuffer &in, const RawBuffer &out)
| uint16 -> int8
static size_t | _int16_int8 (const RawBuffer &in, const RawBuffer &out)
| int16 -> int8
static size_t | _uint8_cint8 (const RawBuffer &in, const RawBuffer &out)
| uint8 -> complex int8. More...
static size_t | _int8_cint8 (const RawBuffer &in, const RawBuffer &out)
| int8 -> complex int8. More...
static size_t | _uint16_cint8 (const RawBuffer &in, const RawBuffer &out)
| uint16 -> complex int 8. More...
static size_t | _int16_cint8 (const RawBuffer &in, const RawBuffer &out)
| int16 -> complex int 8. More...
static size_t | _uint8_int16 (const RawBuffer &in, const RawBuffer &out)
| uint8 -> int16. More...
static size_t | _int8_int16 (const RawBuffer &in, const RawBuffer &out)
| int8 -> int16. More...
static size_t | _uint16_int16 (const RawBuffer &in, const RawBuffer &out)
| uint16 -> int16. More...
static size_t | _uint8_cint16 (const RawBuffer &in, const RawBuffer &out)
| unsinged int8 -> complex int16. More...
static size_t | _int8_cint16 (const RawBuffer &in, const RawBuffer &out)
| int8 -> complex int16. More...
static size_t | _uint16_cint16 (const RawBuffer &in, const RawBuffer &out)
| uint16 -> complex int16. More...
static size_t | _int16_cint16 (const RawBuffer &in, const RawBuffer &out)
| int16 -> complex int16. More...

## Protected Attributes

Buffer< Scalar > | _buffer
| Output buffer. More...
size_t(* | _cast )(const RawBuffer &in, const RawBuffer &out)
| Cast function. 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::AutoCast< Scalar >

This class performs some automatic casts to a certain buffer type (if possible) specified by the template argument.

Currently only integer casts are supported.

## Constructor & Destructor Documentation

template<class Scalar >

sdr::AutoCast< Scalar >::AutoCast | ( |  | ) |

inline

Constructor.

## Member Function Documentation

template<class Scalar >

static size_t sdr::AutoCast< Scalar >::_identity | ( | const RawBuffer & | in,
|  | const RawBuffer & | out
| ) |  |

inlinestaticprotected

Performs no cast at all.

template<class Scalar >

static size_t sdr::AutoCast< Scalar >::_int16_cint16 | ( | const RawBuffer & | in,
|  | const RawBuffer & | out
| ) |  |

inlinestaticprotected

int16 -> complex int16.

template<class Scalar >

static size_t sdr::AutoCast< Scalar >::_int16_cint8 | ( | const RawBuffer & | in,
|  | const RawBuffer & | out
| ) |  |

inlinestaticprotected

int16 -> complex int 8.

template<class Scalar >

static size_t sdr::AutoCast< Scalar >::_int8_cint16 | ( | const RawBuffer & | in,
|  | const RawBuffer & | out
| ) |  |

inlinestaticprotected

int8 -> complex int16.

template<class Scalar >

static size_t sdr::AutoCast< Scalar >::_int8_cint8 | ( | const RawBuffer & | in,
|  | const RawBuffer & | out
| ) |  |

inlinestaticprotected

int8 -> complex int8.

template<class Scalar >

static size_t sdr::AutoCast< Scalar >::_int8_int16 | ( | const RawBuffer & | in,
|  | const RawBuffer & | out
| ) |  |

inlinestaticprotected

int8 -> int16.

template<class Scalar >

static size_t sdr::AutoCast< Scalar >::_uint16_cint16 | ( | const RawBuffer & | in,
|  | const RawBuffer & | out
| ) |  |

inlinestaticprotected

uint16 -> complex int16.

template<class Scalar >

static size_t sdr::AutoCast< Scalar >::_uint16_cint8 | ( | const RawBuffer & | in,
|  | const RawBuffer & | out
| ) |  |

inlinestaticprotected

uint16 -> complex int 8.

template<class Scalar >

static size_t sdr::AutoCast< Scalar >::_uint16_int16 | ( | const RawBuffer & | in,
|  | const RawBuffer & | out
| ) |  |

inlinestaticprotected

uint16 -> int16.

template<class Scalar >

static size_t sdr::AutoCast< Scalar >::_uint8_cint16 | ( | const RawBuffer & | in,
|  | const RawBuffer & | out
| ) |  |

inlinestaticprotected

unsinged int8 -> complex int16.

template<class Scalar >

static size_t sdr::AutoCast< Scalar >::_uint8_cint8 | ( | const RawBuffer & | in,
|  | const RawBuffer & | out
| ) |  |

inlinestaticprotected

uint8 -> complex int8.

template<class Scalar >

static size_t sdr::AutoCast< Scalar >::_uint8_int16 | ( | const RawBuffer & | in,
|  | const RawBuffer & | out
| ) |  |

inlinestaticprotected

uint8 -> int16.

template<class Scalar >

virtual void sdr::AutoCast< Scalar >::config | ( | const Config & | src_cfg | ) |

inlinevirtual

Configures the auto cast node.

Implements sdr::SinkBase.

template<class Scalar >

virtual void sdr::AutoCast< Scalar >::handleBuffer | ( | const RawBuffer & | buffer,
|  | bool | allow_overwrite
| ) |  |

inlinevirtual

Needs to be implemented by any sub-type to process the received data.

Implements sdr::SinkBase.

## Member Data Documentation

template<class Scalar >

Buffer<Scalar> sdr::AutoCast< Scalar >::_buffer

protected

Output buffer.

template<class Scalar >

size_t(* sdr::AutoCast< Scalar >::_cast) (const RawBuffer &in, const RawBuffer &out)

protected

Cast function.

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

- /Users/hannes/Uni/Elektronik/sdr/libsdr/src/autocast.hh