SoapySDR  0.7.1-g5838bc91
Vendor and platform neutral SDR interface library
ConverterRegistry.hpp
Go to the documentation of this file.
1 
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 
21 namespace SoapySDR
22 {
34  {
35  public:
42  typedef void (*ConverterFunction)(const void *, void *, const size_t, const double);
43 
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 
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 }
std::map< std::string, TargetFormatConverters > FormatConverters
Definition: ConverterRegistry.hpp:69
Definition: ConverterRegistry.hpp:33
std::map< FunctionPriority, ConverterFunction > TargetFormatConverterPriority
Definition: ConverterRegistry.hpp:57
FunctionPriority
Definition: ConverterRegistry.hpp:47
Definition: ConverterPrimitives.hpp:14
#define SOAPY_SDR_API
Definition: Config.h:41
std::map< std::string, TargetFormatConverterPriority > TargetFormatConverters
Definition: ConverterRegistry.hpp:63