libiio
|
Public C++ API. More...
Classes | |
class | Buffer |
C++ wrapper for the Buffer C-API. More... | |
class | Channel |
C++ wrapper for the Channel C-API. More... | |
class | Context |
C++ wrapper for the Context C-API. More... | |
class | ContextInfo |
class | cstr |
Non-owning immutable null terminated string. More... | |
class | Device |
C++ wrapper for the Device C-API. More... | |
class | error |
Thrown to report errors. More... | |
class | IAttr |
Common interface for attribute access. More... | |
class | ScanBlock |
class | ScanContext |
Typedefs | |
typedef optional< cstr > | optstr |
Optional string, used for C-functions that return nullptr for "no value". | |
Functions | |
std::shared_ptr< Context > | create_from_uri (cstr uri) |
C++ wrapper for iio_create_context_from_uri. | |
std::shared_ptr< Context > | create_default_context () |
C++ wrapper for iio_create_default_context. | |
std::shared_ptr< Context > | create_local_context () |
C++ wrapper for iio_create_local_context. | |
std::shared_ptr< Context > | create_network_context (cstr host) |
C++ wrapper for iio_create_network_context. | |
std::shared_ptr< Context > | create_xml_context (cstr xml_file) |
C++ wrapper for iio_create_xml_context. | |
std::shared_ptr< Context > | create_xml_context_mem (char const *xml, size_t len) |
C++ wrapper for iio_create_xml_context_mem. | |
std::shared_ptr< ScanContext > | create_scan_context (optstr backend, int flags) |
std::shared_ptr< ScanBlock > | create_scan_block (optstr backend, int flags) |
double | value (Channel ch) |
Reads the value of a channel by using "input" or "raw" attribute and applying "scale" and "offset" if available. More... | |
Public C++ API.
This is a C++ wrapper for iio.h
It requires C++17 or C++11 with Boost (for boost::optional
).
It provides:
NULL
for "no string" are explicit by returning an std::optional
.std::shared_ptr
to it releases it) all its child objects die as well. All types have weak reference semantic and become invalid when the context gets destroyed. Lifetime is managed by std::shared_ptr
.In consequence all types are cheap to copy (at the cost of assigning a pointer and maybe an integer). Copies refer to the same underlying object.
See iiopp-enum.cpp for an example.
|
inline |
Reads the value of a channel by using "input" or "raw" attribute and applying "scale" and "offset" if available.
get_channel_value
in the example iio-monitor.c