mageec  0.1.0
MAchine Guided Energy Efficient Compilation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
mageec-features.h
Go to the documentation of this file.
1 /* MAGEEC Program Feature Class
2  Copyright (C) 2013, 2014 Embecosm Limited and University of Bristol
3 
4  This file is part of MAGEEC.
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 
20 #ifndef __MAGEEC_FEATURES_H_
21 #define __MAGEEC_FEATURES_H_
22 
23 #include <iostream>
24 #include <string>
25 #include <vector>
26 
27 namespace mageec
28 {
34 {
35 public:
36  virtual ~mageec_feature();
37 
38  virtual std::string name() = 0;
39  virtual std::string desc() = 0;
40  virtual int get_feature() = 0;
41 
42  static void dump_vector(std::vector<mageec_feature*> features,
43  std::ostream &OS, bool json);
44 };
45 
47 {
48  std::string feature_name;
49  std::string feature_desc;
50  int feature_value;
51 public:
52  // FIXME: This int has been added to avoid warnings about padding.
53  // This causes the same object to be created for 64-bit systems, but a 32-bit
54  // extra hole added for 32-bit issues.
56 
57  basic_feature (std::string name);
58  basic_feature (std::string name, int value);
59  basic_feature (std::string name, std::string desc, int value);
60  std::string name();
61  std::string desc();
62  int get_feature();
63 };
64 
65 } // End namespace mageec
66 
67 #endif