Imaging Control 4 C++ Library 1.2.0
|
Device enumerator. More...
Public Types | |
using | DeviceListChangedHandler = std::function< void(DeviceEnum &device_enum)> |
Function prototype for device-list-changed event handlers. | |
using | NotificationToken = void * |
Represents a registered callback. | |
Public Member Functions | |
DeviceEnum (Error &err=Error::Default()) | |
Creates a new device enumerator. | |
bool | is_valid () const noexcept |
Checks whether this device enumerator is a valid object. | |
NotificationToken | eventAddDeviceListChanged (DeviceListChangedHandler cb, Error &err=Error::Default()) |
Registers a new device-list-changed event handler. | |
bool | eventRemoveDeviceListChanged (NotificationToken token, Error &err=Error::Default()) |
Unregisters a device-list-changed event handler. | |
Static Public Member Functions | |
static std::vector< DeviceInfo > | enumDevices (Error &err=Error::Default()) |
Get a list of the devices currently attached to the system. | |
static std::vector< Interface > | enumInterfaces (Error &err=Error::Default()) |
Get a list of the interfaces present in the system. | |
Device enumerator.
To query the devices attached to or the interfaces of the system, use the static functions DeviceEnum::enumDevices and DeviceEnum::enumInterfaces.
Device enumerator instances are only useful to register an event handler listening for changes to the detected device list.
using DeviceListChangedHandler = std::function<void(DeviceEnum& device_enum)> |
Function prototype for device-list-changed event handlers.
[in] | device_enum | The device enumerator on which the event handler was registered. |
using NotificationToken = void* |
Represents a registered callback.
When a callback function is registered using DeviceEnum::eventAddDeviceListChanged, a token is returned.
The token can then be used to remove the callback using DeviceEnum::eventRemoveDeviceListChanged at a later time.
|
inline |
Creates a new device enumerator.
[out] | err | Reference to an error handler. See Error Handling for details. |
|
inlinestatic |
Get a list of the devices currently attached to the system.
[out] | err | Reference to an error handler. See Error Handling for details. |
std::vector
containing ic4::DeviceInfo objects providing information about the detected video capture devices.
|
inlinestatic |
Get a list of the interfaces present in the system.
Interfaces represent physical connections for cameras to the computer, e.g. network adapters or USB controllers.
[out] | err | Reference to an error handler. See Error Handling for details. |
std::vector
containing ic4::Interface objects providing information about the detected interfaces.
|
inline |
Registers a new device-list-changed event handler.
[in] | cb | Callback function to be called when a new device has been detected, or a device was detached. |
[out] | err | Reference to an error handler. See Error Handling for details. |
nullptr
.
|
inline |
Unregisters a device-list-changed event handler.
[in] | token | A token that was returned when registering an event handler using DeviceEnum::eventAddDeviceListChanged(). |
[out] | err | Reference to an error handler. See Error Handling for details. |
true
on success, otherwise false
.
|
inlinenoexcept |
Checks whether this device enumerator is a valid object.
If there is an error in the constructor, and function was not configured to throw on error, an invalid object is created. All member function calls will fail.
true
, if this device enumerator was constructed successfully, otherwise false
.