Settings class
#include <Settings.hpp>
Contents
This is the detailed one. More details. Private...
Public static functions
- static void resetSingletone()
- static auto getInstance(const std::string& i_value) -> std::shared_ptr<Settings>
- getInstance Gets a single instance of the Settings class The method provides creation and receipt of a single instance of the Settings class with the specified value of the settings path.
Constructors, destructors, conversion operators
Public functions
- void operator=(const Settings&) deleted
- auto getInstanceName() const -> std::string
- getInstanceName Gets the name of the current instance of settings
- auto getDatasetPath() const -> std::string
- getDatasetPath Returns the path to the dataset
- void setDatasetPath(const std::string& i_datasetPath)
- setDatasetPath Sets the path to the dataset
- auto getGenerationMethodPrefix(const GenerationTypes i_methodType) const -> std::string
- getGenerationMethodPrefix Gets the prefix of the generation method by its corresponding GenerationTypes The method takes the GenerationTypes type variable of the generation method and returns the corresponding prefix.
- auto getLibraryPath() const -> std::string
- getLibraryPath Returns the path to the library
- auto getLibraryNameFromEnum(const LibrariesTypes& library) const -> std::string
- getLibraryNameFromEnum Gets the library name by its enumerated type
- auto getMaxInputs() const -> uint32_t
- getMaxInputs Gets the maximum number of inputs
- auto getMaxOutputs() const -> uint32_t
- getMaxOutputs Returns the maximum number of outputs
- auto getNumThread() const -> uint16_t
- getNumThread Retrieves the number of threads used for processing
- void setNumThread(uint16_t i_numThreads)
Function documentation
static std::shared_ptr<Settings> CG_Gen:: Settings:: getInstance(const std::string& i_value)
getInstance Gets a single instance of the Settings class The method provides creation and receipt of a single instance of the Settings class with the specified value of the settings path.
| Parameters | |
|---|---|
| i_value | The value of the path to the settings |
| Returns | std::shared_ptr<Settings> A pointer to a single instance of the Settings class |
If an instance already exists, the method returns a pointer to it, otherwise it creates a new instance, loads the settings from the file and returns a pointer to it.
This is a safer way to create an instance. instance = new Singleton is dangeruous in case two instance threads wants to access at the same time
std::string CG_Gen:: Settings:: getInstanceName() const
getInstanceName Gets the name of the current instance of settings
| Returns | std::string Name of the current instance of settings |
|---|
std::string CG_Gen:: Settings:: getDatasetPath() const
getDatasetPath Returns the path to the dataset
| Returns | std::string The path to the dataset |
|---|
void CG_Gen:: Settings:: setDatasetPath(const std::string& i_datasetPath)
setDatasetPath Sets the path to the dataset
| Parameters | |
|---|---|
| i_datasetPath | a string representing the path to the dataset |
std::string CG_Gen:: Settings:: getGenerationMethodPrefix(const GenerationTypes i_methodType) const
getGenerationMethodPrefix Gets the prefix of the generation method by its corresponding GenerationTypes The method takes the GenerationTypes type variable of the generation method and returns the corresponding prefix.
| Parameters | |
|---|---|
| i_methodType | A GenerationTypes variable containing the name of the generation method |
| Returns | std::string Prefix of the generation method |
If the passed GenerationTypes does not match any of the known methods, std::out_of_range exception is thrown.
std::string CG_Gen:: Settings:: getLibraryPath() const
getLibraryPath Returns the path to the library
| Returns | std::string Library path |
|---|
std::string CG_Gen:: Settings:: getLibraryNameFromEnum(const LibrariesTypes& library) const
getLibraryNameFromEnum Gets the library name by its enumerated type
| Parameters | |
|---|---|
| library | The enumerated type LibrariesTypes representing the library |
| Returns | std::string Library name |
uint32_t CG_Gen:: Settings:: getMaxInputs() const
getMaxInputs Gets the maximum number of inputs
| Returns | uint32_t Maximum number of inputs |
|---|
uint32_t CG_Gen:: Settings:: getMaxOutputs() const
getMaxOutputs Returns the maximum number of outputs
| Returns | uint32_t Maximum number of outputs |
|---|
uint16_t CG_Gen:: Settings:: getNumThread() const
getNumThread Retrieves the number of threads used for processing
| Returns | uint16_t The number of threads configured for processing |
|---|