gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
plugin_comparators.hpp
Go to the documentation of this file.
1 // GAMBIT: Global and Modular BSM Inference Tool
2 // *********************************************
10 //
21 
22 #ifndef __PLUGIN_COMPARATORS_HPP
23 #define __PLUGIN_COMPARATORS_HPP
24 
25 #include <string>
26 
28 
29 namespace Gambit
30 {
31 
32  namespace Scanner
33  {
34 
35  namespace Plugins
36  {
37 
40  {
41  private:
42  bool empty;
43 
44  public:
45  VersionCompareBase() : empty(false) {}
46  virtual bool operator() (const Plugin_Details &) = 0;
47  bool isEmpty() const {return empty;}
48  void setEmpty(bool in) {empty = in;}
49  virtual ~VersionCompareBase() {}
50  };
51 
53  {
54  private:
55  constexpr static unsigned char GREATER = 0x01;
56  static const unsigned char EQUAL = 0x02;
57  static const unsigned char LESS = 0x04;
58  static const unsigned char NEG = 0x08;
59  static const unsigned char MAJOR = 0x10;
60  static const unsigned char MINOR = 0x20;
61  static const unsigned char PATCH = 0x40;
62  static const unsigned char RELEASE = 0x80;
63  unsigned int major_version;
64  unsigned int minor_version;
65  unsigned int patch_version;
66  std::string release_version;
67  bool (*f)(int, int);
68  unsigned char flag;
69 
70  static bool gt (int a, int b) {return a > b;}
71  static bool lt (int a, int b) {return a < b;}
72  static bool gte (int a, int b) {return a >= b;}
73  static bool lte (int a, int b) {return a <= b;}
74  static bool eq (int a, int b) {return a == b;}
75  static bool neq (int a, int b) {return a != b;}
76 
77  public:
78  VersionCompareBottom (const std::string&);
79  bool operator() (const Plugin_Details&);
80  };
81 
83  {
84  private:
85  static const unsigned char OR = 0x02;
86  static const unsigned char AND = 0x04;
89  unsigned char flag;
90 
91  public:
92  VersionCompare(const std::string&);
93  bool operator() (const Plugin_Details&);
94  ~VersionCompare();
95  };
96 
97  }
98 
99  }
100 
101 }
102 
103 #endif
virtual bool operator()(const Plugin_Details &)=0
container info for a specific plugin
START_MODEL b
Definition: demo.hpp:270
Base class for comparing scanner plugins.
Class to hold details of scanner plugins and define simple comparison operations on them...
DS5_MSPCTM DS_INTDOF int
TODO: see if we can use this one:
Definition: Analysis.hpp:33