gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
Gambit::Scanner::Plugins Namespace Reference

Classes

class  __plugin_resume__
 Container class to store plugin values for resume function. More...
 
class  __plugin_resume_base__
 Virtual container base class to store plugin values for resume function. More...
 
class  classFactory
 
class  factoryBase
 These classes are used by the plugins to load and save data. More...
 
class  funcFactory
 
struct  Plugin_Details
 container info for a specific plugin More...
 
class  Plugin_Details_Ref
 
class  Plugin_Interface
 Interface for a ScannerBit plugin. More...
 
class  Plugin_Interface< ret(args...)>
 
class  Plugin_Interface_Base
 
struct  Plugin_Interface_Details
 Plugin info to be given to the interface class. More...
 
class  Plugin_Loader
 container class for the actual plugins detected by ScannerBit More...
 
class  Plugin_Main_Interface_Base
 
class  Plugin_Main_Interface_Base< ret(args...)>
 
struct  pluginData
 Structure that holds all the data provided by plugins about themselves. More...
 
class  pluginInfo
 Container for all the plugin info from the inifile and Scannerbit. More...
 
struct  Proto_Plugin_Details
 Plugin info from inifile. More...
 
class  VersionCompare
 
class  VersionCompareBase
 Base class for comparing scanner plugins. More...
 
class  VersionCompareBottom
 

Functions

bool operator== (const Plugin_Details &plug1, const Plugin_Details &plug2)
 
bool Plugin_Version_Supersedes (const Plugin_Details &plug1, const Plugin_Details &plug2)
 compares the user defined plugin version to the actual plugin version. More...
 
const std::map< type_index, void * > & error_map_return ()
 
std::string print_plugins (std::map< std::string, std::map< std::string, std::vector< Plugin_Details > > >::const_iterator plugins)
 
bool is_new_plugin (std::map< str, std::map< str, std::vector< Plugin_Details >>> &pmap, Plugin_Details &cand)
 Check a plugin map and return a flag indicating if a candidate plugin is already in the map or not. More...
 

Variables

EXPORT_SYMBOLS pluginInfo plugin_info
 Access Functor for plugin info. More...
 

Function Documentation

◆ error_map_return()

const std::map<type_index, void *>& Gambit::Scanner::Plugins::error_map_return ( )
inline

Definition at line 46 of file plugin_interface.hpp.

Referenced by Gambit::Scanner::Plugins::Plugin_Interface_Base::initPlugin().

47  {
48  static const std::map<type_index, void *> temp_map;
49  return temp_map;
50  }
Here is the caller graph for this function:

◆ is_new_plugin()

bool Gambit::Scanner::Plugins::is_new_plugin ( std::map< str, std::map< str, std::vector< Plugin_Details >>> &  pmap,
Plugin_Details cand 
)

Check a plugin map and return a flag indicating if a candidate plugin is already in the map or not.

Definition at line 104 of file plugin_loader.cpp.

References Gambit::Scanner::Plugins::Plugin_Details::plugin, Gambit::Scanner::Plugins::Plugin_Details::type, and Gambit::Scanner::Plugins::Plugin_Details::version.

Referenced by Gambit::Scanner::Plugins::Plugin_Loader::process().

105  {
106  bool new_plugin_type = pmap.find(cand.type) == pmap.end();
107  bool new_plugin_name = new_plugin_type || pmap.at(cand.type).find(cand.plugin) == pmap.at(cand.type).end();
108  bool new_plugin_version = true;
109  if (not new_plugin_name)
110  {
111  for (auto x : pmap.at(cand.type).at(cand.plugin))
112  if (x.version == cand.version) new_plugin_version = false;
113  }
114  return new_plugin_version;
115  }
Here is the caller graph for this function:

◆ operator==()

bool Gambit::Scanner::Plugins::operator== ( const Plugin_Details plug1,
const Plugin_Details plug2 
)
inline

Definition at line 99 of file plugin_details.hpp.

References Gambit::Scanner::Plugins::Plugin_Details::major_version, Gambit::Scanner::Plugins::Plugin_Details::minor_version, and Gambit::Scanner::Plugins::Plugin_Details::release_version.

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  }

◆ Plugin_Version_Supersedes()

bool Gambit::Scanner::Plugins::Plugin_Version_Supersedes ( const Plugin_Details plug1,
const Plugin_Details plug2 
)

compares the user defined plugin version to the actual plugin version.

Definition at line 465 of file plugin_details.cpp.

References Gambit::Scanner::Plugins::Plugin_Details::major_version, Gambit::Scanner::Plugins::Plugin_Details::minor_version, Gambit::Scanner::Plugins::Plugin_Details::patch_version, and Gambit::Scanner::Plugins::Plugin_Details::release_version.

Referenced by Gambit::Scanner::Plugins::Plugin_Loader::find(), and Gambit::Scanner::Plugins::Plugin_Details_Ref::operator const Plugin_Details &().

466  {
467  if (plug1.major_version > plug2.major_version)
468  {
469  return true;
470  }
471  else if (plug1.major_version == plug2.major_version)
472  {
473  if (plug1.minor_version > plug2.minor_version)
474  {
475  return true;
476  }
477  else if (plug1.minor_version == plug2.minor_version)
478  {
479  if (plug1.patch_version > plug2.patch_version)
480  {
481  return true;
482  }
483  else if (plug1.patch_version == plug2.patch_version)
484  {
485  if (plug1.release_version == "" && plug2.release_version != "")
486  {
487  return true;
488  }
489  }
490  }
491  }
492 
493  return false;
494  }
Here is the caller graph for this function:

◆ print_plugins()

std::string Gambit::Scanner::Plugins::print_plugins ( std::map< std::string, std::map< std::string, std::vector< Plugin_Details > > >::const_iterator  plugins)
inline

Definition at line 52 of file plugin_loader.cpp.

References Gambit::table_formatter::capitalize_title(), Gambit::table_formatter::green(), Gambit::table_formatter::padding(), Gambit::table_formatter::red(), and Gambit::table_formatter::str().

Referenced by Gambit::Scanner::Plugins::Plugin_Loader::print_all().

53  {
54  table_formatter table(plugins->first + " PLUGINS", "VERSION", "STATUS");
55  table.capitalize_title();
56  table.padding(1);
57 
58  for (auto it = plugins->second.begin(); it != plugins->second.end(); ++it)
59  {
60  for (auto jt = it->second.begin(); jt != it->second.end(); ++jt)
61  {
62  const str firstentry = (jt == it->second.begin() ? it->first : "");
63  table << firstentry;
64  table << jt->version;
65  if (jt->status == "ok")
66  table.green() << jt->status;
67  else
68  table.red() << jt->status;
69  }
70  }
71 
72  return table.str();
73  }
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ plugin_info

pluginInfo Gambit::Scanner::Plugins::plugin_info

Access Functor for plugin info.

This will manage all the plugins including stored and writing resume info.

Definition at line 706 of file plugin_loader.cpp.

Referenced by Gambit::Scanner::Function_Base< ret(args...)>::check_for_switch_to_alternate_min_LogL(), do_cleanup(), Gambit::Scanner::resume_params_func::dump(), ff_prior_diagnostic(), Gambit::gambit_core::ff_prior_diagnostic(), ff_scanner_diagnostic(), Gambit::gambit_core::ff_scanner_diagnostic(), ff_test_function_diagnostic(), Gambit::gambit_core::ff_test_function_diagnostic(), Gambit::Scanner::Function_Base< ret(args...)>::Function_Base(), Gambit::Scanner::resume_params_func::get_temp_file_name(), Gambit::Scanner::Plugins::Plugin_Interface_Base::initPlugin(), main(), Gambit::Diver_1_0_2::objective(), Gambit::Diver_1_0_0::objective(), Gambit::Diver_1_0_4::objective(), Gambit::Scanner::resume_params_func::operator()(), Gambit::Scanner::Function_Base< ret(args...)>::operator()(), Gambit::Scanner::Plugins::pluginInfo::operator()(), prior_diagnostic(), Gambit::gambit_core::prior_diagnostic(), Gambit::Scanner::Scan_Manager::Run(), Gambit::gambit_core::run_diagnostic(), Gambit::PostProcessor::PPDriver::run_main_loop(), Gambit::Scanner::Scan_Manager::Scan_Manager(), scanner_diagnostic(), Gambit::gambit_core::scanner_diagnostic(), sighandler(), Gambit::Scanner::Function_Base< ret(args...)>::switch_to_alternate_min_LogL(), Gambit::Scanner::Function_Base< ret(args...)>::tell_scanner_early_shutdown_in_progress(), test_function_diagnostic(), Gambit::gambit_core::test_function_diagnostic(), and Gambit::Scanner::TWalk().