X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fconfig%2Fconfig.hpp;fp=src%2Fconfig%2Fconfig.hpp;h=88234dc9a808daac04d8ad0e47f3f53f10a7fa60;hb=c85ac8bccf13f6aba024fef47453f3e1b6c3c615;hp=5dac6a3f51cd88df949e1369270d4585794a26e0;hpb=b0c88ede74392fc3d73270c3b9a545b7e641d9ab;p=ric-plt%2Fxapp-frame-cpp.git diff --git a/src/config/config.hpp b/src/config/config.hpp index 5dac6a3..88234dc 100644 --- a/src/config/config.hpp +++ b/src/config/config.hpp @@ -42,12 +42,12 @@ namespace xapp { #define MAX_PFNAME (4096 + 256) // max path name and max filname + nil for buffer allocation class Config { - std::string fname; // the file name that we'll listen to - std::thread* listener; // listener thread info + std::string fname = ""; // the file name that we'll listen to + std::thread* listener = NULL; // listener thread info - std::shared_ptr jh; // the currently parsed json from the config - std::unique_ptr cb; // info needed to drive user code when config change noticed - void* user_cb_data; // data that the caller wants passed on notification callback + std::shared_ptr jh = NULL; // the currently parsed json from the config + std::unique_ptr cb = NULL; // info needed to drive user code when config change noticed + void* user_cb_data = NULL; // data that the caller wants passed on notification callback // ----------------------------------------------------------------------- private: @@ -57,20 +57,20 @@ class Config { public: Config(); // builders - Config( std::string fname); + Config( const std::string& fname); - bool Get_control_bool( std::string name, bool defval ); - bool Get_control_bool( std::string name ); + bool Get_control_bool( const std::string& name, bool defval ) const; + bool Get_control_bool( const std::string& name ) const; - std::string Get_contents( ); + std::string Get_contents( ) const; - std::string Get_control_str( std::string name, std::string defval ); - std::string Get_control_str( std::string name ); + std::string Get_control_str( const std::string& name, const std::string& defval ) const; + std::string Get_control_str( const std::string& name ) const; - double Get_control_value( std::string name, double defval ); - double Get_control_value( std::string name ); + double Get_control_value( const std::string& name, double defval ) const; + double Get_control_value( const std::string& name ) const; - std::string Get_port( std::string name ); + std::string Get_port( const std::string& name ) const; void Set_callback( notify_callback usr_func, void* usr_data ); };