Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:02:04

0001 #ifndef FWCore_Framework_ModuleTypeResolverBase_h
0002 #define FWCore_Framework_ModuleTypeResolverBase_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     FWCore/Framework
0006 // Class  :     ModuleTypeResolverBase
0007 //
0008 /**\class edm::ModuleTypeResolverBase ModuleTypeResolverBase.h "FWCore/Framework/interface/ModuleTypeResolverBase.h"
0009 
0010  Description: Base class for deriving alternative module types to use when loading
0011 
0012  Usage:
0013         This is meant to be used as part of a do...while loop. The condition should be the returned int is not kLastIndex and the
0014  type returned is not what you need.
0015 */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Wed, 27 Apr 2022 16:21:10 GMT
0019 //
0020 
0021 // system include files
0022 #include <memory>
0023 #include <string>
0024 
0025 // user include files
0026 
0027 // forward declarations
0028 namespace edm {
0029   class ModuleTypeResolverBase {
0030   public:
0031     static constexpr int kInitialIndex = 0;
0032     static constexpr int kLastIndex = -1;
0033     virtual ~ModuleTypeResolverBase() = default;
0034 
0035     /**This function is meant to be called multiple times with different values for index. The first call should set index
0036        to kInitialIndex. The int returned from the function is the new index to use on next call or is a value of kLastIndex which
0037        means no further calls should be made. The returned string is the next concrete type to be used when making a call.
0038        On subsequent call, the argument basename can be the same string as returned from the previous call to the function.
0039     **/
0040     virtual std::pair<std::string, int> resolveType(std::string basename, int index) const = 0;
0041   };
0042 }  // namespace edm
0043 
0044 #endif