Instrument Neutral Distributed Interface INDI 2.2.5
Public Member Functions | Static Public Member Functions | List of all members
INDI::HotPlugManager Class Reference

#include <hotplugmanager.h>

Public Member Functions

 HotPlugManager (const HotPlugManager &)=delete
 
HotPlugManager & operator= (const HotPlugManager &)=delete
 
void registerHandler (std::shared_ptr< HotPlugCapableDevice > handler)
 Register a HotPlugCapableDevice handler with the manager.
 
void unregisterHandler (std::shared_ptr< HotPlugCapableDevice > handler)
 Unregister a HotPlugCapableDevice handler from the manager.
 
void start (uint32_t intervalMs, bool oneShot=false)
 Starts the hot-plugging timer.
 
void stop ()
 Stops the hot-plugging timer.
 
void setNonUdevPollingDuration (int seconds)
 Set the maximum polling duration for non-udev systems (macOS, Windows).
 
void setInitialPollingDuration (int seconds)
 Set the maximum initial polling duration for systems with udev.
 

Static Public Member Functions

static HotPlugManager & getInstance ()
 Get the singleton instance of HotPlugManager.
 
static const char * getDeviceName ()
 Static name used for LOGGING purposes.
 

Detailed Description

Definition at line 39 of file hotplugmanager.h.

Constructor & Destructor Documentation

◆ HotPlugManager()

INDI::HotPlugManager::HotPlugManager ( const HotPlugManager &  )
delete

Member Function Documentation

◆ getDeviceName()

static const char * INDI::HotPlugManager::getDeviceName ( )
inlinestatic

Static name used for LOGGING purposes.

Definition at line 59 of file hotplugmanager.h.

◆ getInstance()

HotPlugManager & INDI::HotPlugManager::getInstance ( )
static

Get the singleton instance of HotPlugManager.

Returns
Reference to the HotPlugManager instance.

Definition at line 79 of file hotplugmanager.cpp.

◆ operator=()

HotPlugManager & INDI::HotPlugManager::operator= ( const HotPlugManager &  )
delete

◆ registerHandler()

void INDI::HotPlugManager::registerHandler ( std::shared_ptr< HotPlugCapableDevice >  handler)

Register a HotPlugCapableDevice handler with the manager.

Parameters
handlerA shared pointer to the HotPlugCapableDevice implementation.

Definition at line 85 of file hotplugmanager.cpp.

◆ setInitialPollingDuration()

void INDI::HotPlugManager::setInitialPollingDuration ( int  seconds)

Set the maximum initial polling duration for systems with udev.

Parameters
secondsMaximum duration in seconds. Must be between 1 and MAX_NON_UDEV_POLL_DURATION_SECONDS. -1 = use default (5 seconds).
Note
This only affects the initial polling period on systems with udev. After initial polling, event-driven monitoring is used.

Definition at line 278 of file hotplugmanager.cpp.

◆ setNonUdevPollingDuration()

void INDI::HotPlugManager::setNonUdevPollingDuration ( int  seconds)

Set the maximum polling duration for non-udev systems (macOS, Windows).

Parameters
secondsMaximum duration in seconds. 0 = unlimited polling, -1 = use default (60 seconds).
Note
This only affects systems without udev. Linux with udev uses event-driven monitoring with no time limit.

Definition at line 260 of file hotplugmanager.cpp.

◆ start()

void INDI::HotPlugManager::start ( uint32_t  intervalMs,
bool  oneShot = false 
)

Starts the hot-plugging timer.

Parameters
intervalMsThe interval in milliseconds for periodic checks.
oneShotIf true, hotplugging will stop after initial device check.

Definition at line 121 of file hotplugmanager.cpp.

◆ stop()

void INDI::HotPlugManager::stop ( )

Stops the hot-plugging timer.

Definition at line 241 of file hotplugmanager.cpp.

◆ unregisterHandler()

void INDI::HotPlugManager::unregisterHandler ( std::shared_ptr< HotPlugCapableDevice >  handler)

Unregister a HotPlugCapableDevice handler from the manager.

Parameters
handlerA shared pointer to the HotPlugCapableDevice implementation to unregister.

Definition at line 101 of file hotplugmanager.cpp.


The documentation for this class was generated from the following files: