Loading...
Searching...
No Matches
ConverterRegistry.hpp
Go to the documentation of this file.
#pragma once
#include <SoapySDR/Config.hpp>
#include <SoapySDR/Logger.hpp>
#include <SoapySDR/Formats.hpp>
#include <utility>
#include <vector>
#include <map>
#include <string>
namespace SoapySDR
{
class SOAPY_SDR_API ConverterRegistry
{
public:
typedef void (*ConverterFunction)(const void *, void *, const size_t, const double);
enum FunctionPriority{
GENERIC = 0,
VECTORIZED = 3,
CUSTOM = 5
};
typedef std::map<FunctionPriority, ConverterFunction> TargetFormatConverterPriority;
typedef std::map<std::string, TargetFormatConverterPriority> TargetFormatConverters;
typedef std::map<std::string, TargetFormatConverters> FormatConverters;
ConverterRegistry(const std::string &sourceFormat, const std::string &targetFormat, const FunctionPriority &priority, ConverterFunction converter);
static std::vector<std::string> listTargetFormats(const std::string &sourceFormat);
static std::vector<std::string> listSourceFormats(const std::string &targetFormat);
static std::vector<FunctionPriority> listPriorities(const std::string &sourceFormat, const std::string &targetFormat);
static ConverterFunction getFunction(const std::string &sourceFormat, const std::string &targetFormat);
static ConverterFunction getFunction(const std::string &sourceFormat, const std::string &targetFormat, const FunctionPriority &priority);
static std::vector<std::string> listAvailableSourceFormats(void);
};
}
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