![]() |
Thermal Camera SDK 10.0.1
SDK for Optris Thermal Cameras
|
Detects and monitors available devices. More...
#include <EnumerationManager.h>
Public Member Functions | |
OTC_SDK_API | EnumerationManager (const EnumerationManager &)=delete |
No copy constructor. | |
OTC_SDK_API EnumerationManager & | operator= (const EnumerationManager &)=delete |
No copy assignment. | |
OTC_SDK_API | EnumerationManager (EnumerationManager &&)=delete |
No move constructor. | |
OTC_SDK_API EnumerationManager & | operator= (EnumerationManager &&)=delete |
No move assignment. | |
virtual 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 void | registerDetector (const std::string &name, std::shared_ptr< EnumerationDetector > detector) |
Registers a new detector for connected devices. | |
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 () noexcept |
Returns an instance of the EnumerationManager. | |
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::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. |
|
staticnoexcept |
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 void optris::EnumerationManager::registerDetector | ( | const std::string & | name, |
std::shared_ptr< EnumerationDetector > | detector ) |
Registers a new detector for connected devices.
Existing detectors with the same name will be overriden.
[in] | name | under which to register the detector. |
[in] | detector | to register. |
OTC_SDK_API bool optris::EnumerationManager::removeClient | ( | EnumerationClient * | client | ) |
Removes the given observer/client.
[in] | client | to remove. |
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. |