GNU Radio Manual and C++ API Reference  3.10.1.0
The Free & Open Software Radio Ecosystem
iio_types.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2021 Josh Morman
4  *
5  * SPDX-License-Identifier: GPL-3.0-or-later
6  *
7  */
8 
9 #ifndef _INCLUDED_IIO_TYPES_H
10 #define _INCLUDED_IIO_TYPES_H
11 
12 #include <gnuradio/iio/api.h>
13 #include <boost/tokenizer.hpp>
14 #include <charconv>
15 #include <string>
16 #include <variant>
17 #include <vector>
18 
19 namespace gr {
20 namespace iio {
21 
22 enum class data_type_t { DOUBLE = 0, FLOAT = 1, LONGLONG = 2, INT = 3, UINT8 = 4 };
23 
24 enum class attr_type_t {
25  CHANNEL = 0,
26  DEVICE = 1,
27  DEVICE_BUFFER = 2,
28  DEVICE_DEBUG = 3,
30 };
31 
32 typedef std::variant<long long unsigned int, long unsigned int, int, double, std::string>
34 
35 #define tokenizer(inp, sep) \
36  boost::tokenizer<boost::char_separator<char>>(inp, boost::char_separator<char>(sep))
37 
38 class IIO_API iio_param_t : public std::pair<std::string, std::string>
39 {
40 public:
41  iio_param_t(const std::string& key, iio_param_value_t value);
42  iio_param_t(const std::string& kvpair);
44 
45  static std::string to_string(iio_param_value_t value);
46 };
47 
48 typedef std::vector<iio_param_t> iio_param_vec_t;
49 
50 } // namespace iio
51 } // namespace gr
52 
53 #endif
Definition: iio_types.h:39
iio_param_t(const std::string &kvpair)
static std::string to_string(iio_param_value_t value)
iio_param_t(const std::string &key, iio_param_value_t value)
~iio_param_t()
Definition: iio_types.h:43
#define IIO_API
Definition: gr-iio/include/gnuradio/iio/api.h:18
std::vector< iio_param_t > iio_param_vec_t
Definition: iio_types.h:48
data_type_t
Definition: iio_types.h:22
std::variant< long long unsigned int, long unsigned int, int, double, std::string > iio_param_value_t
Definition: iio_types.h:33
attr_type_t
Definition: iio_types.h:24
GNU Radio logging wrapper.
Definition: basic_block.h:29