|
Motion Master 6.0.0-alpha.86
Next-generation motion control software
|
One device, plus the set that keeps it alive. More...
#include <device_manager.h>
Public Member Functions | |
| DeviceHandle ()=default | |
| DeviceHandle (std::shared_ptr< DeviceSet > set, Device *device) | |
| operator bool () const | |
| Whether a device was found. | |
| Device & | operator* () const |
| Device * | operator-> () const |
| Device * | get () const |
The device, or nullptr. For a caller that must pass it on as a pointer. | |
One device, plus the set that keeps it alive.
What DeviceManager::deviceAt hands back. The handle is the lifetime: while you hold it, the Device it names stays constructed and its parameter map stays put, whatever scan or reset do meanwhile. A bare deviceSet()->find(pos) would dangle the moment the temporary set pointer died, which is the mistake this type exists to make unwritable.
Falsy when the position resolved to no device. Dereferencing then is undefined, exactly as for a null pointer.
|
default |
|
inline |
The device, or nullptr. For a caller that must pass it on as a pointer.
|
inlineexplicit |
Whether a device was found.
|
inline |
|
inline |