gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
plugin_details.hpp
Go to the documentation of this file.
1 // GAMBIT: Global and Modular BSM Inference Tool
2 // *********************************************
11 //
22 
23 #ifndef __PLUGIN_DETAILS_HPP
24 #define __PLUGIN_DETAILS_HPP
25 
26 #include <vector>
27 #include "yaml-cpp/yaml.h"
28 
29 namespace Gambit
30 {
31 
32  namespace Scanner
33  {
34 
35  namespace Plugins
36  {
37 
40  {
42  std::string version;
50  std::string status;
52  std::vector<std::string> reason;
54  std::string release_version;
56  std::string path;
58  std::string plugin;
60  std::string type;
62  std::string full_string;
64  std::vector<std::string> reqd_inifile_entries;
66  std::vector<std::string> reqd_not_linked_libs;
68  std::vector<std::string> ini_libs_not_found;
70  std::multimap<std::string, std::string> linked_libs;
72  std::vector<std::string> reqd_incs_not_found;
74  std::vector<std::string> ini_incs_not_found;
76  std::multimap<std::string, std::string> found_incs;
78  mutable YAML::Node flags;
79 
81 
82  std::multimap<std::string, std::string> linked_libraries() const {return linked_libs;}
83 
84  Plugin_Details(const std::string &str);
85 
86  void get_status(const YAML::Node &, const YAML::Node &, const YAML::Node &);
87 
88  static std::string get_description(const std::vector<const Plugin_Details *> &plugins);
89 
90  std::string printMin() const;
91 
92  std::string print() const;
93 
94  std::string printFull() const;
95 
96  static std::string printMultiPlugins(const std::vector<const Plugin_Details *> &);
97  };
98 
99  inline bool operator == (const Plugin_Details &plug1, const Plugin_Details &plug2)
100  {
101  if ((plug1.major_version != plug2.major_version) ||
102  (plug1.major_version != plug2.major_version) ||
103  (plug1.minor_version != plug2.minor_version) ||
104  (plug1.release_version == "" && plug2.release_version != "") ||
105  (plug1.release_version != "" && plug2.release_version == ""))
106  {
107  return false;
108  }
109 
110  return true;
111  }
112 
114  {
115  private:
116  mutable const Plugin_Details *details;
117 
118  public:
120  Plugin_Details_Ref(const Plugin_Details &details) : details(&details) {}
121  Plugin_Details_Ref(const Plugin_Details_Ref &details) : details(details.details) {}
122 
123  //const Plugin_Details_Ref &operator = (const Plugin_Details &details_in) const
124  //{
125  // details = &details_in;
126  // return *this;
127  //}
128 
129  const Plugin_Details_Ref &operator = (const Plugin_Details_Ref &details_in) const
130  {
131  details = details_in.details;
132  return *this;
133  }
134 
135  //Plugin_Details_Ref &operator = (Plugin_Details &details_in)
136  //{
137  // details = &details_in;
138  // return *this;
139  //}
140 
141  Plugin_Details_Ref &operator = (Plugin_Details_Ref &details_in)
142  {
143  details = details_in.details;
144  return *this;
145  }
146 
147  operator Plugin_Details &(){return *(Plugin_Details *)details;}
148  operator const Plugin_Details &() const {return *details;}
149  };
150 
152  bool Plugin_Version_Supersedes(const Plugin_Details &plug1, const Plugin_Details &plug2);
153 
154  }
155 
156  }
157 
158 }
159 
160 #endif
std::vector< std::string > ini_incs_not_found
paths specified in the "locations.yaml" file but where not found
std::multimap< std::string, std::string > linked_libs
list of all libraries that are linked: {lib_name: path_to_lib}
container info for a specific plugin
std::vector< std::string > ini_libs_not_found
libraries specified in the "locations.yaml" file but not found
std::vector< std::string > reason
reason is excluded
bool Plugin_Version_Supersedes(const Plugin_Details &plug1, const Plugin_Details &plug2)
compares the user defined plugin version to the actual plugin version.
std::string path
full path to library containing plugin
std::multimap< std::string, std::string > found_incs
list of all files that were found: {file_name: include_path_to_file}
bool operator==(const Plugin_Details &plug1, const Plugin_Details &plug2)
std::string release_version
release version
Plugin_Details_Ref(const Plugin_Details &details)
std::multimap< std::string, std::string > linked_libraries() const
std::vector< std::string > reqd_inifile_entries
inifile entries requested my plugin in the "reqd_inifile_entries(...)" function
std::vector< std::string > reqd_not_linked_libs
libraries that were not linked but requested by the "reqd_libraries(...)" function ...
static std::string printMultiPlugins(const std::vector< const Plugin_Details *> &)
Plugin_Details_Ref(const Plugin_Details_Ref &details)
void get_status(const YAML::Node &, const YAML::Node &, const YAML::Node &)
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
std::vector< std::string > reqd_incs_not_found
requested include files that were not found
std::string version
version string: maj.min.patch-release
std::string status
status, not set right now
std::string full_string
full string that ScannerBit sees
TODO: see if we can use this one:
Definition: Analysis.hpp:33
static std::string get_description(const std::vector< const Plugin_Details *> &plugins)