sdr::UnsignedToSigned Class Reference
Data handling nodes.

Performs a reinterprete cast from an unsinged value to a singed one. More...

`#include <utils.hh>`

Inheritance diagram for sdr::UnsignedToSigned:

## Public Member Functions

| UnsignedToSigned (float scale=1.0)
| Constructor with optional scaleing. More...
virtual | ~UnsignedToSigned ()
| Destructor. More...
virtual void | config (const Config &src_cfg)
| Configures the cast node. More...
virtual void | handleBuffer (const RawBuffer &buffer, bool allow_overwrite)
| Performs the cast. 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 Member Functions

void | _process_int8 (const RawBuffer &in, const RawBuffer &out)
| Performs the cast for `uint8` -> `int8`. More...
void | _process_int16 (const RawBuffer &in, const RawBuffer &out)
| Performs the cast for `uint16` -> `int16`. 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...

## Protected Attributes

void(UnsignedToSigned::* | _process )(const RawBuffer &in, const RawBuffer &out)
| Type-cast callback. More...
RawBuffer | _buffer
| The output buffer, unused if the cast can be performed in-place. More...
float | _scale
| Holds the scaleing. 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...

## Detailed Description

Performs a reinterprete cast from an unsinged value to a singed one.

## Constructor & Destructor Documentation

UnsignedToSigned::UnsignedToSigned | ( | float | scale = `1.0` | ) |

Constructor with optional scaleing.

UnsignedToSigned::~UnsignedToSigned | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

void UnsignedToSigned::_process_int16 | ( | const RawBuffer & | in,
|  | const RawBuffer & | out
| ) |  |

protected

Performs the cast for `uint16` -> `int16`.

void UnsignedToSigned::_process_int8 | ( | const RawBuffer & | in,
|  | const RawBuffer & | out
| ) |  |

protected

Performs the cast for `uint8` -> `int8`.

void UnsignedToSigned::config | ( | const Config & | src_cfg | ) |

virtual

Configures the cast node.

Implements sdr::SinkBase.

void UnsignedToSigned::handleBuffer | ( | const RawBuffer & | buffer,
|  | bool | allow_overwrite
| ) |  |

virtual

Performs the cast.

Implements sdr::SinkBase.

## Member Data Documentation

RawBuffer sdr::UnsignedToSigned::_buffer

protected

The output buffer, unused if the cast can be performed in-place.

void(UnsignedToSigned::* sdr::UnsignedToSigned::_process) (const RawBuffer &in, const RawBuffer &out)

protected

Type-cast callback.

float sdr::UnsignedToSigned::_scale

protected

Holds the scaleing.

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

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