libiio
1.0
Library for interfacing with IIO devices
|
Public C++ API. More...
Namespaces | |
impl | |
Namespace of implementation details. | |
Data Structures | |
class | Attr |
C++ wrapper for the Attributes C-API. More... | |
class | Block |
C++ wrapper for the Block C-API. More... | |
class | Buffer |
C++ wrapper for the Buffer C-API. More... | |
class | Channel |
C++ wrapper for the Channel C-API. More... | |
class | ChannelsMask |
C++ wrapper for iio_channels_mask. More... | |
class | Context |
C++ wrapper for the Context C-API. More... | |
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... | |
struct | Event |
Event object. More... | |
class | EventStream |
C++ wrapper for iio_event_stream. More... | |
class | Ptr |
Special unique pointer for instances that must be destroyed. More... | |
class | Scan |
C++ wrapper for the Scan C-API. More... | |
class | Stream |
C++ wrapper for the Stream C-API. More... | |
Typedefs | |
typedef optional< cstr > | optstr |
Optional string, used for C-functions that return nullptr for "no value". | |
typedef Ptr< ChannelsMask, iio_channels_mask, iio_channels_mask_destroy > | ChannelsMaskPtr |
typedef Ptr< Block, iio_block, iio_block_destroy > | BlockPtr |
typedef Ptr< Stream, iio_stream, iio_stream_destroy > | StreamPtr |
typedef Ptr< EventStream, iio_event_stream, iio_event_stream_destroy > | EventStreamPtr |
typedef Ptr< Buffer, iio_buffer, iio_buffer_destroy > | BufferPtr |
typedef Ptr< cstr, void, free > | CstrPtr |
typedef Ptr< Context, iio_context, iio_context_destroy > | ContextPtr |
typedef Ptr< Scan, struct iio_scan, iio_scan_destroy > | ScanPtr |
Functions | |
ChannelsMaskPtr | create_channels_mask (unsigned int nb_channels) |
ContextPtr | create_context (iio_context_params *params, const char *uri) |
C++ wrapper for iio_create_context. | |
ScanPtr | scan (struct iio_context_params const *params, char const *backends) |
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" or "no object" are explicit by returning an std::optional
.In consequence all types are cheap to copy (at the cost of assigning a pointer). Copies refer to the same underlying object.
Types with Ptr at the end act like unique pointers: Their destructor destroys the object they refer to and they are not copyable (but movable).
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