diff options
Diffstat (limited to 'gnuradio-core/src/lib/general/gr_prefs.h')
-rw-r--r-- | gnuradio-core/src/lib/general/gr_prefs.h | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/gnuradio-core/src/lib/general/gr_prefs.h b/gnuradio-core/src/lib/general/gr_prefs.h index b1c354bd3..dc2745d16 100644 --- a/gnuradio-core/src/lib/general/gr_prefs.h +++ b/gnuradio-core/src/lib/general/gr_prefs.h @@ -24,6 +24,7 @@ #include <gr_core_api.h> #include <string> +#include <gruel/thread.h> /*! * \brief Base class for representing user preferences a la windows INI files. @@ -39,45 +40,54 @@ public: static gr_prefs *singleton(); static void set_singleton(gr_prefs *p); + gr_prefs(); virtual ~gr_prefs(); /*! * \brief Does \p section exist? */ - virtual bool has_section(const std::string section); + virtual bool has_section(const std::string §ion); /*! * \brief Does \p option exist? */ - virtual bool has_option(const std::string section, const std::string option); + virtual bool has_option(const std::string §ion, const std::string &option); /*! * \brief If option exists return associated value; else default_val. */ - virtual const std::string get_string(const std::string section, - const std::string option, - const std::string default_val); + virtual const std::string get_string(const std::string §ion, + const std::string &option, + const std::string &default_val); /*! * \brief If option exists and value can be converted to bool, return it; else default_val. */ - virtual bool get_bool(const std::string section, - const std::string option, + virtual bool get_bool(const std::string §ion, + const std::string &option, bool default_val); /*! * \brief If option exists and value can be converted to long, return it; else default_val. */ - virtual long get_long(const std::string section, - const std::string option, + virtual long get_long(const std::string §ion, + const std::string &option, long default_val); /*! * \brief If option exists and value can be converted to double, return it; else default_val. */ - virtual double get_double(const std::string section, - const std::string option, + virtual double get_double(const std::string §ion, + const std::string &option, double default_val); + + protected: + virtual std::vector<std::string> _sys_prefs_filenames(); + virtual void _read_files(); + + private: + gruel::mutex d_mutex; + std::string d_configs; }; |