SoapySDR: ConverterRegistry.hpp Source File

| SoapySDR 0.8.1-ARCH Vendor and platform neutral SDR interface library

Loading...
Searching...
No Matches
ConverterRegistry.hpp
Go to the documentation of this file.
1
11
12#pragma once
13#include <SoapySDR/Config.hpp>
14#include <SoapySDR/Logger.hpp>
15#include <SoapySDR/Formats.hpp>
16#include <utility>
17#include <vector>
18#include <map>
19#include <string>
20
21namespace SoapySDR
22{
33 class SOAPY_SDR_API ConverterRegistry
34 {
35 public:
42 typedef void (*ConverterFunction)(const void *, void *, const size_t, const double);
43
47 enum FunctionPriority{
48 GENERIC = 0,
49 VECTORIZED = 3,
50 CUSTOM = 5
51 };
52
57 typedef std::map<FunctionPriority, ConverterFunction> TargetFormatConverterPriority;
58
63 typedef std::map<std::string, TargetFormatConverterPriority> TargetFormatConverters;
64
69 typedef std::map<std::string, TargetFormatConverters> FormatConverters;
70
81 ConverterRegistry(const std::string &sourceFormat, const std::string &targetFormat, const FunctionPriority &priority, ConverterFunction converter);
82
90 static std::vector<std::string> listTargetFormats(const std::string &sourceFormat);
91
99 static std::vector<std::string> listSourceFormats(const std::string &targetFormat);
100
107 static std::vector<FunctionPriority> listPriorities(const std::string &sourceFormat, const std::string &targetFormat);
108
116 static ConverterFunction getFunction(const std::string &sourceFormat, const std::string &targetFormat);
117
121
122 static ConverterFunction getFunction(const std::string &sourceFormat, const std::string &targetFormat, const FunctionPriority &priority);
123
127 static std::vector<std::string> listAvailableSourceFormats(void);
128
129 };
130
131}
SOAPY_SDR_API
#define SOAPY_SDR_API
Definition Config.h:41
Config.hpp
Formats.hpp
Logger.hpp
SoapySDR::ConverterRegistry::getFunction
static ConverterFunction getFunction(const std::string &sourceFormat, const std::string &targetFormat, const FunctionPriority &priority)
SoapySDR::ConverterRegistry::listAvailableSourceFormats
static std::vector< std::string > listAvailableSourceFormats(void)
SoapySDR::ConverterRegistry::ConverterFunction
void(* ConverterFunction)(const void *, void *, const size_t, const double)
Definition ConverterRegistry.hpp:42
SoapySDR::ConverterRegistry::listPriorities
static std::vector< FunctionPriority > listPriorities(const std::string &sourceFormat, const std::string &targetFormat)
SoapySDR::ConverterRegistry::listTargetFormats
static std::vector< std::string > listTargetFormats(const std::string &sourceFormat)
SoapySDR::ConverterRegistry::FormatConverters
std::map< std::string, TargetFormatConverters > FormatConverters
Definition ConverterRegistry.hpp:69
SoapySDR::ConverterRegistry::TargetFormatConverters
std::map< std::string, TargetFormatConverterPriority > TargetFormatConverters
Definition ConverterRegistry.hpp:63
SoapySDR::ConverterRegistry::FunctionPriority
FunctionPriority
Definition ConverterRegistry.hpp:47
SoapySDR::ConverterRegistry::VECTORIZED
@ VECTORIZED
Vectorized operations such as SIMD.
Definition ConverterRegistry.hpp:49
SoapySDR::ConverterRegistry::CUSTOM
@ CUSTOM
Custom user re-implementation. Max priority.
Definition ConverterRegistry.hpp:50
SoapySDR::ConverterRegistry::GENERIC
@ GENERIC
Usual C for-loops, shifts, multiplies, etc. Min priority.
Definition ConverterRegistry.hpp:48
SoapySDR::ConverterRegistry::TargetFormatConverterPriority
std::map< FunctionPriority, ConverterFunction > TargetFormatConverterPriority
Definition ConverterRegistry.hpp:57
SoapySDR::ConverterRegistry::ConverterRegistry
ConverterRegistry(const std::string &sourceFormat, const std::string &targetFormat, const FunctionPriority &priority, ConverterFunction converter)
SoapySDR::ConverterRegistry::listSourceFormats
static std::vector< std::string > listSourceFormats(const std::string &targetFormat)
SoapySDR::ConverterRegistry::getFunction
static ConverterFunction getFunction(const std::string &sourceFormat, const std::string &targetFormat)
SoapySDR
Definition ConverterPrimitives.hpp:15