Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:59

0001 #ifndef FWCore_PluginManager_PluginCapabilities_h
0002 #define FWCore_PluginManager_PluginCapabilities_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     PluginManager
0006 // Class  :     PluginCapabilities
0007 //
0008 /**\class PluginCapabilities PluginCapabilities.h FWCore/PluginManager/interface/PluginCapabilities.h
0009 
0010  Description: <one line class summary>
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Fri Apr  6 12:36:19 EDT 2007
0019 //
0020 
0021 // system include files
0022 #include <map>
0023 #include <string>
0024 
0025 // user include files
0026 #include "FWCore/PluginManager/interface/PluginFactoryBase.h"
0027 // forward declarations
0028 
0029 namespace edmplugin {
0030   class SharedLibrary;
0031   class DummyFriend;
0032   class PluginCapabilities : public PluginFactoryBase {
0033     friend class DummyFriend;
0034 
0035   public:
0036     PluginCapabilities(const PluginCapabilities&) = delete;                   // stop default
0037     const PluginCapabilities& operator=(const PluginCapabilities&) = delete;  // stop default
0038     ~PluginCapabilities() override;
0039 
0040     // ---------- const member functions ---------------------
0041     std::vector<PluginInfo> available() const override;
0042     const std::string& category() const override;
0043 
0044     // ---------- static member functions --------------------
0045     static PluginCapabilities* get();
0046 
0047     // ---------- member functions ---------------------------
0048     void load(const std::string& iName);
0049 
0050     //returns false if loading fails because iName is unknown
0051     bool tryToLoad(const std::string& iName);
0052 
0053     ///Check to see if any capabilities are in the file, returns 'true' if found
0054     bool tryToFind(const SharedLibrary& iLoadable);
0055 
0056   private:
0057     PluginCapabilities();
0058 
0059     // ---------- member data --------------------------------
0060     std::map<std::string, std::filesystem::path> classToLoadable_;
0061   };
0062 
0063 }  // namespace edmplugin
0064 #endif