summaryrefslogtreecommitdiff
path: root/src/feature.h
blob: 3c97edcac4c214a8f6ee03e1e5e660e7696e7b20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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
contact: Jan Huwald // Impressum