![]() |
Thermal Camera SDK 11.4.10
SDK for Optris Thermal Cameras
|
Detects and monitors available devices. More...
#include <EnumerationManager.h>

Public Member Functions | |
| EnumerationManager (const EnumerationManager &)=delete | |
| No copy constructor. | |
| EnumerationManager & | operator= (const EnumerationManager &)=delete |
| No copy assignment. | |
| EnumerationManager (EnumerationManager &&)=delete | |
| No move constructor. | |
| EnumerationManager & | operator= (EnumerationManager &&)=delete |
| No move assignment. | |
| OTC_SDK_API | ~EnumerationManager () |
| Destructor. | |
| OTC_SDK_API std::vector< DeviceInfo > | getDetectedDevices (int seconds=0) |
| Returns information about the currently detected devices. | |
| OTC_SDK_API void | addClient (EnumerationClient *client) |
| Adds an observer/client that will be updated if a device detection status changes. | |
| OTC_SDK_API bool | removeClient (EnumerationClient *client) |
| Removes the given observer/client. | |
| OTC_SDK_API void | run () |
| Runs the connection event detection continuously. | |
| OTC_SDK_API bool | runAsync () |
| Runs the connection event detection continuously in a dedicated thread. | |
| OTC_SDK_API void | stopRunning () |
| Stops the continuous connection event detection. | |
| OTC_SDK_API bool | isRunning () const noexcept |
| Returns whether the connection event detection is running. | |
| OTC_SDK_API void | setDetectionPeriod (int period) noexcept |
| Sets the minimum period in milliseconds for a single connection event detection run. | |
| OTC_SDK_API int | getDetectionPeriod () const noexcept |
| Returns the minimum period in milliseconds for a single connection event detection run. | |
| OTC_SDK_API std::string | addUsbDetector () |
| Adds a detector for USB devices. | |
| OTC_SDK_API bool | removeUsbDetector () |
| Removes the detector for USB devices. | |
| OTC_SDK_API std::string | addEthernetDetector (const std::string &networkAddress) |
| Adds a detector for Ethernet devices in the specified network. | |
| OTC_SDK_API bool | removeEthernetDetector (const std::string &networkAddress) |
| Remove the Ethernet detector for the specified network. | |
| OTC_SDK_API std::string | addEthernetDetector (const IpAddress &networkAddress, int cidr) |
| Adds a detector for Ethernet devices in the specified network. | |
| OTC_SDK_API bool | removeEthernetDetector (const IpAddress &networkAddress, int cidr) |
| Remove the Ethernet detector for the specified network. | |
| OTC_SDK_API std::string | addDetector (const std::string &name, std::shared_ptr< EnumerationDetector > detector) |
| Adds a new detector for connected devices. | |
| OTC_SDK_API bool | removeDetector (const std::string &name) |
| Removes the detector with the given name. | |
| OTC_SDK_API void | clearDetectors () |
| Clears all added detectors. | |
| OTC_SDK_API std::vector< std::string > | getDetectorNames () |
| Returns the names of all added detectors. | |
| OTC_SDK_API std::shared_ptr< EnumerationDetector > | getDetector (const std::string &name) |
| Return the detector registered under the given name. | |
Static Public Member Functions | |
| static OTC_SDK_API EnumerationManager & | getInstance () |
| Returns an instance of the EnumerationManager. | |
Friends | |
| class | DeviceClaimService |
Detects and monitors available devices.
It detects devices that the SDK can potentially connect to.
This class is implemented with the help of the Singleton design pattern. As a consequence, you have to use the EnumerationManager::getInstance() method to interact with it.
Furthermore, allows the registration of observers aka. EnumerationClient that want be informed if the detection status of a device changes.
| OTC_SDK_API void optris::EnumerationManager::addClient | ( | EnumerationClient * | client | ) |
Adds an observer/client that will be updated if a device detection status changes.
| [in] | client | callback client. |
| OTC_SDK_API std::string optris::EnumerationManager::addDetector | ( | const std::string & | name, |
| std::shared_ptr< EnumerationDetector > | detector | ||
| ) |
Adds a new detector for connected devices.
| [in] | name | under which to register the detector. If an empty string is provided, no detector will be added. |
| [in] | detector | to register. |
| OTC_SDK_API std::string optris::EnumerationManager::addEthernetDetector | ( | const IpAddress & | networkAddress, |
| int | cidr | ||
| ) |
Adds a detector for Ethernet devices in the specified network.
| [in] | networkAddress | IP address of the network. Its host portion will be ignored. |
| [in] | cidr | number of bits that constitute the network portion of the provided IP address. It is a shorthand for the subnet mask. Its value, typically, equals the number of 1 bits in the subnet mask. |
| OTC_SDK_API std::string optris::EnumerationManager::addEthernetDetector | ( | const std::string & | networkAddress | ) |
Adds a detector for Ethernet devices in the specified network.
| [in] | networkAddress | in CIDR notation: a.b.c.d/cider with a.b.c.d as the network IP address and cidr as the number of bits that constitute the network portion of the IP address. It is a shorthand for the subnet mask. Its value, typically, equals the number of 1 bits in the subnet mask. |
| OTC_SDK_API std::string optris::EnumerationManager::addUsbDetector | ( | ) |
Adds a detector for USB devices.
| OTC_SDK_API std::vector< DeviceInfo > optris::EnumerationManager::getDetectedDevices | ( | int | seconds = 0 | ) |
Returns information about the currently detected devices.
| [in] | seconds | < 0 the method waits indefintfly for the first detection pass to complete. == 0 the method will not wait. > 0 the method waits the given amount of seconds for th first detection pass to complete. |
|
inlinenoexcept |
Returns the minimum period in milliseconds for a single connection event detection run.
| OTC_SDK_API std::shared_ptr< EnumerationDetector > optris::EnumerationManager::getDetector | ( | const std::string & | name | ) |
Return the detector registered under the given name.
| [in] | name | of the desired detector. |
| OTC_SDK_API std::vector< std::string > optris::EnumerationManager::getDetectorNames | ( | ) |
Returns the names of all added detectors.
|
static |
Returns an instance of the EnumerationManager.
Only one instance per program is available (Singleton).
|
noexcept |
Returns whether the connection event detection is running.
| OTC_SDK_API bool optris::EnumerationManager::removeClient | ( | EnumerationClient * | client | ) |
Removes the given observer/client.
| [in] | client | to remove. |
| OTC_SDK_API bool optris::EnumerationManager::removeDetector | ( | const std::string & | name | ) |
Removes the detector with the given name.
| [in] | name | of the detector to remove. |
| OTC_SDK_API bool optris::EnumerationManager::removeEthernetDetector | ( | const IpAddress & | networkAddress, |
| int | cidr | ||
| ) |
Remove the Ethernet detector for the specified network.
| [in] | networkAddress | IP address of the network. Its host portion will be ignored. |
| [in] | cidr | number of bits that constitute the network portion of the provided IP address. It is a shorthand for the subnet mask. Its value, typically, equals the number of 1 bits in the subnet mask. |
| OTC_SDK_API bool optris::EnumerationManager::removeEthernetDetector | ( | const std::string & | networkAddress | ) |
Remove the Ethernet detector for the specified network.
| [in] | networkAddress | in CIDR notation: a.b.c.d/cider with a.b.c.d as the network IP address and cidr as the number of bits that constitute the network portion of the IP address. It is a shorthand for the subnet mask. Its value, typically, equals the number of 1 bits in the subnet mask. |
| OTC_SDK_API bool optris::EnumerationManager::removeUsbDetector | ( | ) |
Removes the detector for USB devices.
| OTC_SDK_API void optris::EnumerationManager::run | ( | ) |
Runs the connection event detection continuously.
This method blocks until stopRunning() is called from a different thread or until the program terminates.
| OTC_SDK_API bool optris::EnumerationManager::runAsync | ( | ) |
Runs the connection event detection continuously in a dedicated thread.
This method runs until stopRunning() is called from a different thread or until the program terminates.
|
inlinenoexcept |
Sets the minimum period in milliseconds for a single connection event detection run.
| [in] | period | in milliseconds to set. |
| OTC_SDK_API void optris::EnumerationManager::stopRunning | ( | ) |
Stops the continuous connection event detection.
This does not clear the list of currently detected devices.