![]() |
EduArt Sensor Ring Library 4.0.0
|
Typed wrapper over a vector of device pointers. More...
#include <Group.hpp>
Classes | |
| class | iterator |
| class | const_iterator |
| Const dereferencing iterator so range-for over a const Group<T> yields const T&. More... | |
Public Member Functions | |
| Group (std::vector< T * > devices) | |
| T & | operator[] (std::size_t i) |
| Access device by index (returns reference). | |
| const T & | operator[] (std::size_t i) const |
| std::size_t | size () const |
| Number of devices in this group. | |
| bool | empty () const |
| Whether the group is empty. | |
| std::vector< T * > | get () const |
| Get the underlying vector of device pointers. | |
| iterator | begin () |
| Begin iterator (mutable). | |
| iterator | end () |
| Past-the-end iterator (mutable). | |
| const_iterator | begin () const |
| Begin iterator (const). | |
| const_iterator | end () const |
| Past-the-end iterator (const). | |
| template<typename U = T, typename = typename U::MeasurementType> | |
| subscription::Subscription | subscribe (std::function< void(const typename U::MeasurementType &)> callback) |
| Subscribe to all devices in the group. | |
| template<typename U = T, typename = typename U::MeasurementType> | |
| subscription::Subscription | subscribeAll (std::function< void(const std::vector< typename U::MeasurementType > &)> callback) |
| Subscribe to all devices in the group with synchronized frame delivery. | |
Typed wrapper over a vector of device pointers.
Provides iteration (range-for yields T&) and a subscribe() method that subscribes to all devices in the group at once. Returned Subscription manages all individual subscriptions and cancels them collectively.
| T | Device interface type (DepthSensor, ThermalSensor, Light, …). |
|
inline |
Subscribe to all devices in the group.
Returns a single Subscription that manages all individual subscriptions. When cancelled or destroyed, all subscriptions are cancelled.
Only available when T defines a MeasurementType alias (e.g. DepthSensor, ThermalSensor).
| [in] | callback | Invoked for each measurement from each device. |
|
inline |
Subscribe to all devices in the group with synchronized frame delivery.
The callback is invoked once per complete frame — i.e. only after every device in the group has produced a new measurement. The callback receives a vector containing exactly one measurement per device (ordered by device index). The effective callback rate equals the rate of the slowest device in the group.
Only available when T defines a MeasurementType alias (e.g. DepthSensor, ThermalSensor).
| [in] | callback | Invoked with a complete frame (one measurement per device, ordered by index). |