![]() |
IDS peak genericC++
v1.4.3
|
Encapsulates the GenTL functions associated with a GenTL Device module's ID. More...
#include <peak/device/peak_device_descriptor.hpp>
Public Types | |
| using | InformationChangedCallback = std::function< void(const std::vector< DeviceInformationRole > &changedRoles)> |
| using | InformationChangedCallbackHandle = InformationChangedCallback * |
| using | DeviceOpenedCallback = std::function< void(const std::shared_ptr< core::Device > &openedDevice)> |
| using | DeviceOpenedCallbackHandle = DeviceOpenedCallback * |
Public Member Functions | |
| DeviceDescriptor ()=delete | |
| ~DeviceDescriptor () override | |
| DeviceDescriptor (const DeviceDescriptor &other)=delete | |
| DeviceDescriptor & | operator= (const DeviceDescriptor &other)=delete |
| DeviceDescriptor (DeviceDescriptor &&other)=delete | |
| DeviceDescriptor & | operator= (DeviceDescriptor &&other)=delete |
| std::string | Key () const |
| Returns the unique key. More... | |
| RawInformation | Info (int32_t infoCommand) const |
| Delivers information based on the given GenTL info command. More... | |
| std::string | DisplayName () const |
| Returns the display name. More... | |
| std::string | VendorName () const |
| Returns the vendor name. More... | |
| std::string | ModelName () const |
| Returns the model name. More... | |
| std::string | Version () const |
| Returns the version. More... | |
| std::string | TLType () const |
| Returns the TL (transport layer) type. More... | |
| std::string | UserDefinedName () const |
| Returns the user defined name. More... | |
| std::string | SerialNumber () const |
| Returns the serial number. More... | |
| DeviceAccessStatus | AccessStatus () const |
| Returns the access status. More... | |
| uint64_t | TimestampTickFrequency () const |
| Returns the timestamp tick frequency. More... | |
| std::shared_ptr< Interface > | ParentInterface () const |
| Returns the parent interface. More... | |
Open the device | |
| bool | IsOpenable (DeviceAccessType accessType=DeviceAccessType::Exclusive) const |
| Checks whether the device can be opened with a specific access type. More... | |
| std::shared_ptr< Device > | OpenDevice (DeviceAccessType accessType) |
| Opens the Device. More... | |
| std::shared_ptr< Device > | OpenedDevice () const |
| Returns the Device that was opened with this DeviceDescriptor. More... | |
| DeviceOpenedCallbackHandle | RegisterDeviceOpenedCallback (const DeviceOpenedCallback &callback) |
| Registers a callback for signaling when the Device is opened with this DeviceDescriptor. More... | |
| void | UnregisterDeviceOpenedCallback (DeviceOpenedCallbackHandle callbackHandle) |
| Unregisters a device opened callback. More... | |
Device Information Monitoring | |
| uint64_t | MonitoringUpdateInterval () const |
| Returns the monitoring update interval. More... | |
| void | SetMonitoringUpdateInterval (uint64_t monitoringUpdateInterval_ms) |
| Sets the monitoring update interval. More... | |
| bool | IsInformationRoleMonitored (DeviceInformationRole informationRole) const |
| Checks whether the given information role is monitored. More... | |
| void | AddInformationRoleToMonitoring (DeviceInformationRole informationRole) |
| Adds the given information role to the monitoring. More... | |
| void | RemoveInformationRoleFromMonitoring (DeviceInformationRole informationRole) |
| Removes the given information role from the monitoring. More... | |
| InformationChangedCallbackHandle | RegisterInformationChangedCallback (const InformationChangedCallback &callback) |
| Registers a callback for signaling changed information. More... | |
| void | UnregisterInformationChangedCallback (InformationChangedCallbackHandle callbackHandle) |
| Unregisters an information changed callback. More... | |
Public Member Functions inherited from peak::core::ModuleDescriptor | |
| ModuleDescriptor ()=default | |
| virtual | ~ModuleDescriptor ()=default |
| ModuleDescriptor (const ModuleDescriptor &other)=delete | |
| ModuleDescriptor & | operator= (const ModuleDescriptor &other)=delete |
| ModuleDescriptor (ModuleDescriptor &&other)=delete | |
| ModuleDescriptor & | operator= (ModuleDescriptor &&other)=delete |
| std::string | ID () const |
| Returns the ID of the described module. More... | |
Friends | |
| class | FirmwareUpdater |
Additional Inherited Members |
Encapsulates the GenTL functions associated with a GenTL Device module's ID.
This class allows to query information about a GenTL Device module without opening it. Furthermore, it enables you to open this GenTL Device module.
When you try to open a device with an access mode that is not allowed, a BadAccessException is thrown. To avoid that, ask the device if the desired access mode is available with IsOpenable(). By default, IsOpenable asks for the highest access mode, DeviceAccessType::Exclusive:
With this group of methods, you can conveniently monitor for changes of information about the device.
Register a callback using RegisterInformationChangedCallback() and configure which information you want to monitor with AddInformationRoleToMonitoring() and RemoveInformationRoleFromMonitoring().
By default, the following DeviceInformationRoles are monitored:
| using peak::core::DeviceDescriptor::DeviceOpenedCallback = std::function<void(const std::shared_ptr<core::Device>& openedDevice)> |
The type of device opened callbacks.
The type of device opened callback handles.
| using peak::core::DeviceDescriptor::InformationChangedCallback = std::function<void(const std::vector<DeviceInformationRole>& changedRoles)> |
The type of changed callbacks.
The type of changed callback handles.
|
delete |
|
inlineoverride |
|
delete |
|
delete |
|
inline |
Returns the access status.
| NotFoundException | Device could not be found. |
| InternalErrorException | An internal error has occurred. |
|
inline |
Adds the given information role to the monitoring.
| [in] | informationRole | The information role to add to the monitoring. |
| InternalErrorException | An internal error has occurred. |
|
inline |
Returns the display name.
| NotFoundException | Device could not be found. |
| InternalErrorException | An internal error has occurred. |
|
inline |
Delivers information based on the given GenTL info command.
| [in] | infoCommand | The GenTL info command. |
This function can be used to query information going beyond the predefined info functions, based on the GenTL info commands of the corresponding module.
Example (error handling is omitted):
| InternalErrorException | An internal error has occurred. |
|
inline |
Checks whether the given information role is monitored.
| [in] | informationRole | The information role to check. |
| InternalErrorException | An internal error has occurred. |
|
inline |
Checks whether the device can be opened with a specific access type.
If the device can be opened with a higher access type, it can also be opened with a lower access type.
| [in] | accessType | The access type to check. |
| InternalErrorException | An internal error has occurred. |
|
inline |
Returns the unique key.
The returned key is unique even across different producer libraries.
| InternalErrorException | An internal error has occurred. |
|
inline |
Returns the model name.
| NotFoundException | Device could not be found. |
| InternalErrorException | An internal error has occurred. |
|
inline |
Returns the monitoring update interval.
| InternalErrorException | An internal error has occurred. |
|
inline |
Opens the Device.
| [in] | accessType | The access type the device should be opened for. |
| NotFoundException | Device could not be found. |
| BadAccessException | Access denied |
| InternalErrorException | An internal error has occurred. |
|
inline |
Returns the Device that was opened with this DeviceDescriptor.
| BadAccessException | Device is not open |
|
delete |
|
delete |
|
inline |
Returns the parent interface.
| NotFoundException | Device could not be found. |
| InternalErrorException | An internal error has occurred. |
|
inline |
Registers a callback for signaling when the Device is opened with this DeviceDescriptor.
Pass the callback handle returned by this function to UnregisterDeviceOpenedCallback() to unregister the callback.
| [in] | callback | The callback to call when the Device is opened. |
| InternalErrorException | An internal error has occurred. |
|
inline |
Registers a callback for signaling changed information.
This function registers a callback which gets called every time information have changed. Pass the callback handle returned by this function to UnregisterInformationChangedCallback() to unregister the callback.
| [in] | callback | The callback to call if information have changed. |
| InternalErrorException | An internal error has occurred. |
|
inline |
Removes the given information role from the monitoring.
| [in] | informationRole | The information role to remove from the monitoring. |
| InternalErrorException | An internal error has occurred. |
|
inline |
Returns the serial number.
| NotFoundException | Device could not be found. |
| InternalErrorException | An internal error has occurred. |
|
inline |
Sets the monitoring update interval.
| [in] | monitoringUpdateInterval_ms | The monitoring update interval to set in milliseconds. |
| InternalErrorException | An internal error has occurred. |
|
inline |
Returns the timestamp tick frequency.
| NotFoundException | Device could not be found. |
| InternalErrorException | An internal error has occurred. |
|
inline |
Returns the TL (transport layer) type.
| InternalErrorException | An internal error has occurred. |
|
inline |
Unregisters a device opened callback.
This function unregisters a device opened callback by taking its handle.
| [in] | callbackHandle | The handle of the callback to unregister. |
| InternalErrorException | An internal error has occurred. |
|
inline |
Unregisters an information changed callback.
This function unregisters an information changed callback by taking its handle.
| [in] | callbackHandle | The handle of the callback to unregister. |
| InternalErrorException | An internal error has occurred. |
|
inline |
Returns the user defined name.
| NotFoundException | Device could not be found. |
| InternalErrorException | An internal error has occurred. |
|
inline |
Returns the vendor name.
| NotFoundException | Device could not be found. |
| InternalErrorException | An internal error has occurred. |
|
inline |
Returns the version.
| NotFoundException | Device could not be found. |
| InternalErrorException | An internal error has occurred. |
|
friend |