I work with libconfig ++ and threads to create a small server application. The fact is that libconfig ++ is not thread safe , so my idea is to create another class that acts like a wrapper with Mutex, something like this:
class app_config { public: app_config(); void set(); void get(); virtual ~app_config(); private: Config cfg; boost::mutex *cfg_mutex; };
Now all is well, until I understand that libconfig supports many types for its variables. And so when our main character (s) finds himself in search of any C ++ guru with a good heart who wants to show him any way to make it work.
In essence, the get and set functions require the variable std::string or char* path , containing the path to the configuration file variable (I would not think to use it either) and the type of the return value (or the second argument in the case of set ) should change ...
As always, any help would be appreciated.
Julian
source share