AI Watch A1
Multi-person 3D skeleton detection using Intel RealSense and OpenPose with Kafka support.
UsageManager.hpp
Go to the documentation of this file.
1//
2// UsageManager.hpp
3// AI Watch A1
4//
5// Created by Denny Caruso on 23/07/22.
6//
7
8// License: Apache 2.0. See LICENSE file in root directory.
9// Copyright(c) 2022. All Rights Reserved.
10
11#ifndef UsageManager_hpp
12#define UsageManager_hpp
13
14#include <string>
15#include <opencv2/core.hpp>
16#include <mutex>
17#include "../constants.hpp"
18
19
20
28private:
36 static std::mutex singletonMutex;
37
38
39
43 int * argc;
47 char *** argv;
51 const int expected_argc;
56
57
58
63 const int get_expected_argc (void);
68 const char * get_expectedUsageMessage (void);
73 void checkUsage (void);
74
75
76
84 UsageManager (int * argc = nullptr, char *** argv = nullptr, const int expected_argc = 0, const char * expectedUsageMessage = nullptr) : argc(argc), argv(argv), expected_argc(expected_argc), expectedUsageMessage(expectedUsageMessage) {
85 checkUsage();
86 }
87public:
93 UsageManager (UsageManager & other) = delete;
98 void operator= (const UsageManager &) = delete;
99
100
101
105 virtual ~UsageManager();
116 static UsageManager * getInstance (int * argc, char *** argv, const int expected_argc, const char * expectedUsageMessage);
122 static UsageManager * getInstance (void);
123
124
125
130 int * get_argc (void);
135 char *** get_argv (void);
136};
137
138#endif /* UsageManager_hpp */
UsageManager class is a utility class that helps with configuration parameters.
void checkUsage(void)
Checks if the configuration parameters are valid and if they are equal to the number of the expected ...
static std::mutex singletonMutex
Mutex for thread-safe access.
int * get_argc(void)
Get the argc's pointer.
const char * get_expectedUsageMessage(void)
Get the expected usage message.
virtual ~UsageManager()
Destroy the Usage Manager object.
const char * expectedUsageMessage
a simple message that lets the user understand how to properly run the executable.
void operator=(const UsageManager &)=delete
Disabling the possibility to assign a Singleton object. Singletons should not be assignable.
UsageManager(UsageManager &other)=delete
Disabling the possibility to clone the Singleton object. Singletons should not be cloneable.
char *** get_argv(void)
Get the argv's pointer.
int * argc
configuration parameters' number.
char *** argv
configuration parameters.
UsageManager(int *argc=nullptr, char ***argv=nullptr, const int expected_argc=0, const char *expectedUsageMessage=nullptr)
Construct a new UsageManager object.
static UsageManager * sharedInstance
The field for storing the singleton instance.
const int get_expected_argc(void)
Get the expected argc value.
static UsageManager * getInstance(void)
Get the unique class instance. This methods should be called in the following scenario: when we just ...
const int expected_argc
expected configuration parameters' number.