diff options
author | Torsten Paul <Torsten.Paul@gmx.de> | 2014-01-02 22:27:52 (GMT) |
---|---|---|
committer | Torsten Paul <Torsten.Paul@gmx.de> | 2014-01-02 22:27:52 (GMT) |
commit | 72865e17dae7f51c60e0db54c1aa070f8125f273 (patch) | |
tree | e72ca64bb9ec80b330b3c48b1fad9e1d294c50b3 /src/feature.h | |
parent | 6443df394b7754509ddfd781df7758ba912ebcbd (diff) |
Add feature registry.
Diffstat (limited to 'src/feature.h')
-rw-r--r-- | src/feature.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/feature.h b/src/feature.h new file mode 100644 index 0000000..3c97edc --- /dev/null +++ b/src/feature.h @@ -0,0 +1,47 @@ +#ifndef FEATURE_H_ +#define FEATURE_H_ + +#include <stdio.h> +#include <iostream> +#include <string> +#include <map> + +class Feature { +private: + /** + * Set to true in case the matching feature was given as commandline + * argument. + */ + bool enabled_cmdline; + /** + * Set from the GUI options. This will not be set in case the GUI is + * not started at all. + */ + bool enabled_options; + + std::string name; + + typedef std::map<std::string, Feature *> map_t; + static map_t feature_map; + + Feature(std::string name); + virtual ~Feature(); + virtual void set_enable_cmdline(); + virtual void set_enable_options(bool status); + +public: + static const Feature ExperimentalConcatFunction; + + const std::string& get_name() const; + + bool is_enabled() const; + + friend bool operator ==(const Feature& lhs, const Feature& rhs); + friend bool operator !=(const Feature& lhs, const Feature& rhs); + + static void dump_features(); + static void enable_feature(std::string feature_name); + static void enable_feature(std::string feature_name, bool status); +}; + +#endif |