From c3b1b16d11880bee2eecade9b86a904cce590e7c Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Sat, 12 Jul 2025 23:04:59 -0500 Subject: [PATCH] Clean up comment formatting in ResourceManager.h --- ResourceManager.h | 147 ++++++++++++++++++++++++---------------------- 1 file changed, 78 insertions(+), 69 deletions(-) diff --git a/ResourceManager.h b/ResourceManager.h index 528432cc..619c6e73 100644 --- a/ResourceManager.h +++ b/ResourceManager.h @@ -93,9 +93,9 @@ typedef struct uint8_t dimm_type; } I2CDIMMDeviceDetectorBlock; -/*-------------------------------------------------------------------------*\ -| Define a macro for QT lupdate to parse | -\*-------------------------------------------------------------------------*/ +/*---------------------------------------------------------*\ +| Define a macro for QT lupdate to parse | +\*---------------------------------------------------------*/ #define QT_TRANSLATE_NOOP(scope, x) x extern const char* I2C_ERR_WIN; @@ -205,88 +205,90 @@ private: void RunInBackgroundThread(std::function); void BackgroundThreadFunction(); - /*-------------------------------------------------------------------------------------*\ - | Functions that must be run in the background thread | - | These are not related to STL coroutines, yet this name is the most convenient | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | Functions that must be run in the background thread | + | These are not related to STL coroutines, yet this | + | name is the most convenient | + \*-----------------------------------------------------*/ void InitCoroutine(); void DetectDevicesCoroutine(); void HidExitCoroutine(); - /*-------------------------------------------------------------------------------------*\ - | Static pointer to shared instance of ResourceManager | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | Static pointer to shared instance of ResourceManager | + \*-----------------------------------------------------*/ static ResourceManager* instance; - /*-------------------------------------------------------------------------------------*\ - | Auto connection permitting flag | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | Auto connection permitting flag | + \*-----------------------------------------------------*/ bool tryAutoConnect; - /*-------------------------------------------------------------------------------------*\ - | Detection enabled flag | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | Detection enabled flag | + \*-----------------------------------------------------*/ bool detection_enabled; - /*-------------------------------------------------------------------------------------*\ - | Auto connection active flag | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | Auto connection active flag | + \*-----------------------------------------------------*/ bool auto_connection_active; - /*-------------------------------------------------------------------------------------*\ - | Auto connection client pointer | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | Auto connection client pointer | + \*-----------------------------------------------------*/ NetworkClient * auto_connection_client; - /*-------------------------------------------------------------------------------------*\ - | Auto connection permitting flag | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | Auto connection permitting flag | + \*-----------------------------------------------------*/ bool start_server; - /*-------------------------------------------------------------------------------------*\ - | Auto connection permitting flag | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | Auto connection permitting flag | + \*-----------------------------------------------------*/ bool apply_post_options; - /*-------------------------------------------------------------------------------------*\ - | Initialization completion flag | - \*-------------------------------------------------------------------------------------*/ + + /*-----------------------------------------------------*\ + | Initialization completion flag | + \*-----------------------------------------------------*/ std::atomic init_finished; - /*-------------------------------------------------------------------------------------*\ - | Profile Manager | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | Profile Manager | + \*-----------------------------------------------------*/ ProfileManager* profile_manager; - /*-------------------------------------------------------------------------------------*\ - | Settings Manager | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | Settings Manager | + \*-----------------------------------------------------*/ SettingsManager* settings_manager; - /*-------------------------------------------------------------------------------------*\ - | I2C/SMBus Interfaces | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | I2C/SMBus Interfaces | + \*-----------------------------------------------------*/ std::vector busses; - /*-------------------------------------------------------------------------------------*\ - | RGBControllers | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | RGBControllers | + \*-----------------------------------------------------*/ std::vector rgb_controllers_sizes; std::vector rgb_controllers_hw; std::vector rgb_controllers; - /*-------------------------------------------------------------------------------------*\ - | Network Server | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | Network Server | + \*-----------------------------------------------------*/ NetworkServer* server; - /*-------------------------------------------------------------------------------------*\ - | Network Clients | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | Network Clients | + \*-----------------------------------------------------*/ std::vector clients; - /*-------------------------------------------------------------------------------------*\ - | Detectors | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | Detectors | + \*-----------------------------------------------------*/ std::vector device_detectors; std::vector device_detector_strings; std::vector i2c_bus_detectors; @@ -302,14 +304,18 @@ private: bool dynamic_detectors_processed; - /*-------------------------------------------------------------------------------------*\ - | Detection Thread and Detection State | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | Detection Thread and Detection State | + \*-----------------------------------------------------*/ std::thread * DetectDevicesThread; std::mutex DetectDeviceMutex; std::function ScheduledBackgroundFunction; std::mutex BackgroundThreadStateMutex; - std::condition_variable BackgroundFunctionStartTrigger; // NOTE: wakes up the background detection thread + + /*-----------------------------------------------------*\ + | NOTE: wakes up the background detection thread | + \*-----------------------------------------------------*/ + std::condition_variable BackgroundFunctionStartTrigger; std::atomic background_thread_running; std::atomic detection_is_required; @@ -318,22 +324,22 @@ private: std::vector detection_size_entry_used; const char* detection_string; - /*-------------------------------------------------------------------------------------*\ - | Client Info Changed Callback | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | Client Info Changed Callback | + \*-----------------------------------------------------*/ std::vector ClientInfoChangeCallbacks; std::vector ClientInfoChangeCallbackArgs; - /*-------------------------------------------------------------------------------------*\ - | Device List Changed Callback | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | Device List Changed Callback | + \*-----------------------------------------------------*/ std::mutex DeviceListChangeMutex; std::vector DeviceListChangeCallbacks; std::vector DeviceListChangeCallbackArgs; - /*-------------------------------------------------------------------------------------*\ - | Detection Progress, Start, and End Callbacks | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | Detection Progress, Start, and End Callbacks | + \*-----------------------------------------------------*/ std::mutex DetectionProgressMutex; std::vector DetectionProgressCallbacks; std::vector DetectionProgressCallbackArgs; @@ -344,12 +350,15 @@ private: std::vector DetectionEndCallbacks; std::vector DetectionEndCallbackArgs; - /*-------------------------------------------------------------------------------------*\ - | I2C/SMBus Adapter List Changed Callback | - \*-------------------------------------------------------------------------------------*/ + /*-----------------------------------------------------*\ + | I2C/SMBus Adapter List Changed Callback | + \*-----------------------------------------------------*/ std::mutex I2CBusListChangeMutex; std::vector I2CBusListChangeCallbacks; std::vector I2CBusListChangeCallbackArgs; - filesystem::path config_dir; + /*-----------------------------------------------------*\ + | OpenRGB configuration directory path | + \*-----------------------------------------------------*/ + filesystem::path config_dir; };