YggdrasilWM
0.1.1
A tiny window manager coded in C++
|
ConfigHandler class This class is responsible for handling the configuration It can be created with a file name or not, if not config files will be looked up in default path defined in ConfigFileHandler ConfigHandler is a Singleton class and should be created after the Logger class and before the WindowManager class. More...
#include <ConfigHandler.hpp>
Public Member Functions | |
ConfigHandler (const ConfigHandler &)=delete | |
ConfigHandler & | operator= (const ConfigHandler &)=delete |
template<typename T > | |
std::shared_ptr< T > | getConfigData () |
Get the ConfigData object of type T. More... | |
template<typename T > | |
void | addConfigData (std::shared_ptr< T > configData) |
void | configInit () |
Initialize the ConfigHandler Read the configuration file and store the JSon root object in Json::Value root_ Get the configFilePath form which the config has been read. More... | |
~ConfigHandler () | |
Static Public Member Functions | |
static void | Create (const std::string &configPath) |
static void | Create () |
static ConfigHandler & | GetInstance () |
Get the ConfigHandler object Throws an exception if the object is not created. More... | |
static void | Destroy () |
Destroy the ConfigHandler object. More... | |
static unsigned long | colorCodeToULong (const std::string &colorCode) |
Convert a string containing a color code to unsigned long. More... | |
Private Member Functions | |
ConfigHandler () | |
Construct a new ConfigHandler object without a path Instanciate a ConfigFileHandler Object without a path. More... | |
ConfigHandler (const std::string &configPath) | |
Private Attributes | |
std::string | configPath_ |
std::unordered_map< std::type_index, std::shared_ptr< ConfigDataBase > > | configMap_ |
Static Private Attributes | |
static ConfigHandler * | instance_ = nullptr |
ConfigHandler class This class is responsible for handling the configuration It can be created with a file name or not, if not config files will be looked up in default path defined in ConfigFileHandler ConfigHandler is a Singleton class and should be created after the Logger class and before the WindowManager class.
|
delete |
|
default |
|
private |
Construct a new ConfigHandler object without a path Instanciate a ConfigFileHandler Object without a path.
Referenced by Create().
|
explicitprivate |
|
inline |
T | Type of the ConfigData object you want to add to the ConfigHandler |
configData | the ConfigData object you want to add |
References configMap_.
Referenced by configInit().
|
static |
Convert a string containing a color code to unsigned long.
colorCode |
Referenced by ConfigDataBar::configInit(), ConfigDataGroup::configInit(), and ConfigDataWidget::configInit().
void ConfigHandler::configInit | ( | ) |
Initialize the ConfigHandler Read the configuration file and store the JSon root object in Json::Value root_ Get the configFilePath form which the config has been read.
References addConfigData(), configPath_, Logger::GetInstance(), L_INFO, and Logger::Log().
Referenced by main().
|
static |
References ConfigHandler(), and instance_.
Referenced by main().
|
static |
|
static |
|
inline |
Get the ConfigData object of type T.
T | Type of the ConfigData object |
References configMap_.
Referenced by WindowManager::addGroupsFromConfig(), Client::frame(), EventHandler::handleKeyPress(), EventHandler::handleUnmapNotify(), and WindowManager::init().
|
static |
Get the ConfigHandler object Throws an exception if the object is not created.
References instance_.
Referenced by WindowManager::addGroupsFromConfig(), WindowManager::createBars(), Client::frame(), EventHandler::handleKeyPress(), EventHandler::handleUnmapNotify(), WindowManager::init(), and main().
|
delete |
|
private |
Referenced by addConfigData(), and getConfigData().
|
private |
Referenced by configInit().
|
staticprivate |
Referenced by Create(), Destroy(), and GetInstance().