traits.hh
#ifndef __SDR_TRAITS_HH__
#define __SDR_TRAITS_HH__
#include <inttypes.h>
#include <complex>
#include "node.hh"
namespace sdr {
template <class Scalar> class Traits;
template <>
class Traits<uint8_t> {
public:
typedef uint8_t Scalar;
typedef uint8_t RScalar;
typedef uint16_t SScalar;
const static float scale;
const static size_t shift;
const static Config::Type scalarId = Config::Type_u8;
};
template <>
class Traits< std::complex<uint8_t> > {
public:
typedef std::complex<uint8_t> Scalar;
typedef uint8_t RScalar;
typedef std::complex<uint16_t> SScalar;
const static float scale;
const static size_t shift;
const static Config::Type scalarId = Config::Type_cu8;
};
template <>
class Traits<int8_t> {
public:
typedef int8_t Scalar;
typedef int8_t RScalar;
typedef int16_t SScalar;
const static float scale;
const static size_t shift;
const static Config::Type scalarId = Config::Type_s8;
};
template <>
class Traits< std::complex<int8_t> > {
public:
typedef std::complex<int8_t> Scalar;
typedef int8_t RScalar;
typedef std::complex<int16_t> SScalar;
const static float scale;
const static size_t shift;
const static Config::Type scalarId = Config::Type_cs8;
};
template <>
class Traits<uint16_t> {
public:
typedef uint16_t Scalar;
typedef uint16_t RScalar;
typedef uint32_t SScalar;
const static float scale;
const static size_t shift;
const static Config::Type scalarId = Config::Type_u16;
};
template <>
class Traits< std::complex<uint16_t> > {
public:
typedef std::complex<uint16_t> Scalar;
typedef uint16_t RScalar;
typedef std::complex<uint32_t> SScalar;
const static float scale;
const static size_t shift;
const static Config::Type scalarId = Config::Type_cu16;
};
template <>
class Traits<int16_t> {
public:
typedef int16_t Scalar;
typedef int16_t RScalar;
typedef int32_t SScalar;
const static float scale;
const static size_t shift;
const static Config::Type scalarId = Config::Type_s16;
};
template <>
class Traits< std::complex<int16_t> > {
public:
typedef std::complex<int16_t> Scalar;
typedef int16_t RScalar;
typedef std::complex<int32_t> SScalar;
const static float scale;
const static size_t shift;
const static Config::Type scalarId = Config::Type_cs16;
};
template <>
class Traits<float> {
public:
typedef float Scalar;
typedef float RScalar;
typedef float SScalar;
const static float scale;
const static size_t shift;
const static Config::Type scalarId = Config::Type_f32;
};
template <>
class Traits< std::complex<float> > {
public:
typedef std::complex<float> Scalar;
typedef float RScalar;
typedef std::complex<float> SScalar;
const static float scale;
const static size_t shift;
const static Config::Type scalarId = Config::Type_cf32;
};
template <>
class Traits<double> {
public:
typedef double Scalar;
typedef double RScalar;
typedef double SScalar;
const static float scale;
const static size_t shift;
const static Config::Type scalarId = Config::Type_f64;
};
template <>
class Traits< std::complex<double> > {
public:
typedef std::complex<double> Scalar;
typedef double RScalar;
typedef std::complex<double> SScalar;
const static float scale;
const static size_t shift;
const static Config::Type scalarId = Config::Type_cf64;
};
}
#endif
sdr::Traits< std::complex< uint16_t > >::scale
static const float scale
The scaleing factor from floating point to integer.
Definition: traits.hh:123
sdr::Config::Type_cf32
Complex (aka I/Q) type of 32bit floats aka. std::complex<float>.
Definition: node.hh:51
sdr::Traits< std::complex< int8_t > >::RScalar
int8_t RScalar
The real scalar type.
Definition: traits.hh:83
sdr::Traits< uint16_t >::Scalar
uint16_t Scalar
The scalar type.
Definition: traits.hh:99
sdr::Traits< std::complex< uint16_t > >::SScalar
std::complex< uint32_t > SScalar
The compute scalar type.
Definition: traits.hh:121
sdr::Traits< int16_t >::RScalar
int16_t RScalar
The real scalar type.
Definition: traits.hh:137
sdr::Traits< uint16_t >::RScalar
uint16_t RScalar
The real scalar type.
Definition: traits.hh:101
sdr::Config::Type_s16
Real signed 16b ints.
Definition: node.hh:44
sdr::Traits< std::complex< float > >::shift
static const size_t shift
The scaleing factor from floating point to integer expressed as 2^exp.
Definition: traits.hh:197
sdr::Traits< float >::SScalar
float SScalar
The compute scalar type.
Definition: traits.hh:175
sdr::Traits< std::complex< double > >::Scalar
std::complex< double > Scalar
The scalar type.
Definition: traits.hh:225
sdr::Config::Type_cu16
Complex (aka I/Q) type of unsigned 16b ints.
Definition: node.hh:49
sdr
Definition: autocast.hh:8
sdr::Traits< double >::Scalar
double Scalar
The scalar type.
Definition: traits.hh:207
sdr::Traits< std::complex< double > >::shift
static const size_t shift
The scaleing factor from floating point to integer expressed as 2^exp.
Definition: traits.hh:233
sdr::Config::Type_s8
Real signed 8b ints.
Definition: node.hh:42
sdr::Traits< uint16_t >::SScalar
uint32_t SScalar
The compute scalar type.
Definition: traits.hh:103
std
Definition: operators.hh:9
sdr::Traits< std::complex< double > >::RScalar
double RScalar
The real scalar type.
Definition: traits.hh:227
sdr::Traits< uint16_t >::shift
static const size_t shift
The scaleing factor from floating point to integer expressed as 2^exp.
Definition: traits.hh:107
sdr::Config::Type_u8
Real unsigned 8b ints.
Definition: node.hh:41
sdr::Traits< std::complex< int16_t > >::scale
static const float scale
The scaleing factor from floating point to integer.
Definition: traits.hh:159
sdr::Traits< std::complex< uint16_t > >::shift
static const size_t shift
The scaleing factor from floating point to integer expressed as 2^exp.
Definition: traits.hh:125
sdr::Traits< std::complex< uint8_t > >::scale
static const float scale
The scaleing factor from floating point to integer.
Definition: traits.hh:51
sdr::Traits< int16_t >::Scalar
int16_t Scalar
The scalar type.
Definition: traits.hh:135
sdr::Traits< std::complex< int16_t > >::RScalar
int16_t RScalar
The real Scalar type.
Definition: traits.hh:155
sdr::Traits< int16_t >::scale
static const float scale
The scaleing factor from floating point to integer.
Definition: traits.hh:141
sdr::Traits< std::complex< int16_t > >::SScalar
std::complex< int32_t > SScalar
The compute scalar type.
Definition: traits.hh:157
sdr::Traits< std::complex< int16_t > >::shift
static const size_t shift
The scaleing factor from floating point to integer expressed as 2^exp.
Definition: traits.hh:161
sdr::Config::Type_f64
Real 64b floats aka. "double".
Definition: node.hh:46
sdr::Traits< std::complex< int8_t > >::scale
static const float scale
The scaleing factor from floating point to integer.
Definition: traits.hh:87
sdr::Config::Type_u16
Real unsigned 16b ints.
Definition: node.hh:43
sdr::Traits< float >::shift
static const size_t shift
The scaleing factor from floating point to integer expressed as 2^exp.
Definition: traits.hh:179
sdr::Traits< float >::Scalar
float Scalar
The Scalar type.
Definition: traits.hh:171
sdr::Traits< std::complex< uint8_t > >::RScalar
uint8_t RScalar
The real scalar type.
Definition: traits.hh:47
sdr::Traits< double >::SScalar
double SScalar
The compute scalar type.
Definition: traits.hh:211
sdr::Traits< std::complex< double > >::SScalar
std::complex< double > SScalar
The compute (super) scalar type.
Definition: traits.hh:229
sdr::Traits< std::complex< uint16_t > >::RScalar
uint16_t RScalar
The real scalar type.
Definition: traits.hh:119
sdr::Traits< int8_t >::RScalar
int8_t RScalar
The real scalar type.
Definition: traits.hh:65
sdr::Traits< std::complex< float > >::Scalar
std::complex< float > Scalar
The scalar type.
Definition: traits.hh:189
sdr::Traits< uint8_t >::RScalar
uint8_t RScalar
The real scalar type.
Definition: traits.hh:29
sdr::Traits< std::complex< int8_t > >::shift
static const size_t shift
The scaleing factor from floating point to integer expressed as 2^exp.
Definition: traits.hh:89
sdr::Traits< uint8_t >::SScalar
uint16_t SScalar
The compute scalar type.
Definition: traits.hh:31
sdr::Traits< int8_t >::SScalar
int16_t SScalar
The compute scalar type.
Definition: traits.hh:67
sdr::Traits< uint8_t >::Scalar
uint8_t Scalar
The scalar type.
Definition: traits.hh:27
sdr::Traits< int8_t >::shift
static const size_t shift
The scaleing factor from floating point to integer expressed as 2^exp.
Definition: traits.hh:71
sdr::Traits< std::complex< float > >::SScalar
std::complex< float > SScalar
The compute scalar type.
Definition: traits.hh:193
sdr::Traits< std::complex< int8_t > >::Scalar
std::complex< int8_t > Scalar
The scalar type.
Definition: traits.hh:81
sdr::Traits< int16_t >::SScalar
int32_t SScalar
The compute scalar type.
Definition: traits.hh:139
sdr::Traits< uint8_t >::scale
static const float scale
The scaleing factor from floating point to integer.
Definition: traits.hh:33
sdr::Config::Type_f32
Real 32b floats aka. "float".
Definition: node.hh:45
sdr::Traits< std::complex< uint16_t > >::Scalar
std::complex< uint16_t > Scalar
The scalar type.
Definition: traits.hh:117
sdr::Traits< double >::scale
static const float scale
The scaleing factor from floating point to integer.
Definition: traits.hh:213
sdr::Traits< int16_t >::shift
static const size_t shift
The scaleing factor from floating point to integer expressed as 2^exp.
Definition: traits.hh:143
sdr::Traits< std::complex< int8_t > >::SScalar
std::complex< int16_t > SScalar
The compute scalar type.
Definition: traits.hh:85
sdr::Config::Type
Type
The type IDs.
Definition: node.hh:39
sdr::Traits< std::complex< double > >::scale
static const float scale
The scaleing factor from floating point to integer.
Definition: traits.hh:231
sdr::Traits< std::complex< int16_t > >::Scalar
std::complex< int16_t > Scalar
The scalar type.
Definition: traits.hh:153
sdr::Config::Type_cs8
Complex (aka I/Q) type of signed 8b ints.
Definition: node.hh:48
sdr::Traits< std::complex< uint8_t > >::SScalar
std::complex< uint16_t > SScalar
The compute scalar type.
Definition: traits.hh:49
sdr::Traits< std::complex< uint8_t > >::Scalar
std::complex< uint8_t > Scalar
The scalar type.
Definition: traits.hh:45
sdr::Traits< std::complex< float > >::scale
static const float scale
The scaleing factor from floating point to integer.
Definition: traits.hh:195
sdr::Traits< float >::scale
static const float scale
The scaleing factor from floating point to integer.
Definition: traits.hh:177
sdr::Traits< uint16_t >::scale
static const float scale
The scaleing factor from floating point to integer.
Definition: traits.hh:105
sdr::Traits< std::complex< uint8_t > >::shift
static const size_t shift
The scaleing factor from floating point to integer expressed as 2^exp.
Definition: traits.hh:53
sdr::Config::Type_cs16
Complex (aka I/Q) type of signed 16b ints.
Definition: node.hh:50
sdr::Config::Type_cu8
Complex (aka I/Q) type of unsigned 8b ints.
Definition: node.hh:47
sdr::Traits< std::complex< float > >::RScalar
float RScalar
The real scalar type.
Definition: traits.hh:191
sdr::Traits
Forward declaration of type tratis template.
Definition: traits.hh:20
sdr::Traits< int8_t >::Scalar
int8_t Scalar
The scalar type.
Definition: traits.hh:63
sdr::Traits< double >::shift
static const size_t shift
The scaleing factor from floating point to integer expressed as 2^exp.
Definition: traits.hh:215
sdr::Traits< float >::RScalar
float RScalar
The real scalar type.
Definition: traits.hh:173
sdr::Traits< int8_t >::scale
static const float scale
The scaleing factor from floating point to integer.
Definition: traits.hh:69
sdr::Traits< uint8_t >::shift
static const size_t shift
Shift from Scalar to SScalar.
Definition: traits.hh:35
sdr::Traits< double >::RScalar
double RScalar
The real scalar type.
Definition: traits.hh:209
sdr::Config::Type_cf64
Complex (aka I/Q) type of 64bit floats aka. std::complex<double>.
Definition: node.hh:52