AI Watch A1
Multi-person 3D skeleton detection using Intel RealSense and OpenPose with Kafka support.
|
UsageManager class is a utility class that helps with configuration parameters. More...
#include <UsageManager.hpp>
Public Member Functions | |
UsageManager (UsageManager &other)=delete | |
Disabling the possibility to clone the Singleton object. Singletons should not be cloneable. More... | |
void | operator= (const UsageManager &)=delete |
Disabling the possibility to assign a Singleton object. Singletons should not be assignable. More... | |
virtual | ~UsageManager () |
Destroy the Usage Manager object. More... | |
int * | get_argc (void) |
Get the argc's pointer. More... | |
char *** | get_argv (void) |
Get the argv's pointer. More... | |
Static Public Member Functions | |
static UsageManager * | getInstance (int *argc, char ***argv, const int expected_argc, const char *expectedUsageMessage) |
Get the unique class instance, given input parameters. This method should be called the first time when we want to create a reference to the object of this class. More... | |
static UsageManager * | getInstance (void) |
Get the unique class instance. This methods should be called in the following scenario: when we just want to retrieve the reference to the object of this class. More... | |
Private Member Functions | |
const int | get_expected_argc (void) |
Get the expected argc value. More... | |
const char * | get_expectedUsageMessage (void) |
Get the expected usage message. More... | |
void | checkUsage (void) |
Checks if the configuration parameters are valid and if they are equal to the number of the expected parameters. If not, it raises an error. More... | |
UsageManager (int *argc=nullptr, char ***argv=nullptr, const int expected_argc=0, const char *expectedUsageMessage=nullptr) | |
Construct a new UsageManager object. More... | |
Private Attributes | |
int * | argc |
configuration parameters' number. More... | |
char *** | argv |
configuration parameters. More... | |
const int | expected_argc |
expected configuration parameters' number. More... | |
const char * | expectedUsageMessage |
a simple message that lets the user understand how to properly run the executable. More... | |
Static Private Attributes | |
static UsageManager * | sharedInstance { nullptr } |
The field for storing the singleton instance. More... | |
static std::mutex | singletonMutex |
Mutex for thread-safe access. More... | |
UsageManager class is a utility class that helps with configuration parameters.
UsageManager class is a class that keeps track of configuration parameters read from a configuration file, checks if these parameters are valid, and if they are equal to the number of the expected parameters. Furthermore, it offers an on-demand service by returning the parameters read from the file to the callers.
Definition at line 27 of file UsageManager.hpp.
|
inlineprivate |
Construct a new UsageManager object.
argc | configuration parameters' number. |
argv | configuration parameters. |
expected_argc | expected configuration parameters' number. |
expectedUsageMessage | a simple message that lets the user understand how to properly run the executable. |
Definition at line 84 of file UsageManager.hpp.
References checkUsage().
Referenced by getInstance().
|
delete |
Disabling the possibility to clone the Singleton object. Singletons should not be cloneable.
other |
|
virtual |
Destroy the Usage Manager object.
Definition at line 37 of file UsageManager.cpp.
References get_argc(), get_argv(), and sharedInstance.
|
private |
Checks if the configuration parameters are valid and if they are equal to the number of the expected parameters. If not, it raises an error.
Definition at line 20 of file UsageManager.cpp.
References CHECK_USAGE_ERROR, CHECK_USAGE_SCOPE, get_argc(), get_argv(), get_expected_argc(), get_expectedUsageMessage(), and programNameOffset.
Referenced by UsageManager().
int * UsageManager::get_argc | ( | void | ) |
Get the argc's pointer.
Definition at line 56 of file UsageManager.cpp.
References argc.
Referenced by checkUsage(), and ~UsageManager().
char *** UsageManager::get_argv | ( | void | ) |
Get the argv's pointer.
Definition at line 60 of file UsageManager.cpp.
References argv, getInstance(), USAGE_MANAGER_NULLPTR_ERROR, and USAGE_MANAGER_NULLPTR_SCOPE.
Referenced by checkUsage(), OpenCV_Manager::getVideoFramesCV(), FacadeSingleton::sendData(), CleanCommand::setCommand(), OpenPoseCommand::setCommand(), MoveCommand::setCommand(), OpenCV_Manager::showSkeletonsCV(), and ~UsageManager().
|
private |
Get the expected argc value.
Definition at line 27 of file UsageManager.cpp.
References expected_argc.
Referenced by checkUsage().
|
private |
Get the expected usage message.
Definition at line 31 of file UsageManager.cpp.
References expectedUsageMessage.
Referenced by checkUsage().
|
static |
Get the unique class instance, given input parameters. This method should be called the first time when we want to create a reference to the object of this class.
argc | configuration parameters' number. |
argv | configuration parameters. |
expected_argc | expected configuration parameters' number. |
expectedUsageMessage | a simple message that lets the user understand how to properly run the executable. |
Definition at line 44 of file UsageManager.cpp.
References argc, argv, expected_argc, expectedUsageMessage, sharedInstance, singletonMutex, and UsageManager().
|
static |
Get the unique class instance. This methods should be called in the following scenario: when we just want to retrieve the reference to the object of this class.
Definition at line 50 of file UsageManager.cpp.
References sharedInstance, and singletonMutex.
Referenced by FacadeSingleton::FacadeSingleton(), get_argv(), OpenCV_Manager::getVideoFramesCV(), CleanCommand::setCommand(), OpenPoseCommand::setCommand(), and MoveCommand::setCommand().
|
delete |
Disabling the possibility to assign a Singleton object. Singletons should not be assignable.
|
private |
configuration parameters' number.
Definition at line 43 of file UsageManager.hpp.
Referenced by get_argc(), and getInstance().
|
private |
configuration parameters.
Definition at line 47 of file UsageManager.hpp.
Referenced by get_argv(), and getInstance().
|
private |
expected configuration parameters' number.
Definition at line 51 of file UsageManager.hpp.
Referenced by get_expected_argc(), and getInstance().
|
private |
a simple message that lets the user understand how to properly run the executable.
Definition at line 55 of file UsageManager.hpp.
Referenced by get_expectedUsageMessage(), and getInstance().
|
staticprivate |
The field for storing the singleton instance.
Definition at line 32 of file UsageManager.hpp.
Referenced by getInstance(), and ~UsageManager().
|
staticprivate |
Mutex for thread-safe access.
Definition at line 36 of file UsageManager.hpp.
Referenced by getInstance().