-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37731 from Dr15Jones/loadAlternativeModuleTypes
Create infrastructure to allow alternative module types to be loaded
- Loading branch information
Showing
7 changed files
with
299 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#ifndef FWCore_Framework_ModuleTypeResolverBase_h | ||
#define FWCore_Framework_ModuleTypeResolverBase_h | ||
// -*- C++ -*- | ||
// | ||
// Package: FWCore/Framework | ||
// Class : ModuleTypeResolverBase | ||
// | ||
/**\class edm::ModuleTypeResolverBase ModuleTypeResolverBase.h "FWCore/Framework/interface/ModuleTypeResolverBase.h" | ||
Description: Base class for deriving alternative module types to use when loading | ||
Usage: | ||
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 | ||
type returned is not what you need. | ||
*/ | ||
// | ||
// Original Author: Chris Jones | ||
// Created: Wed, 27 Apr 2022 16:21:10 GMT | ||
// | ||
|
||
// system include files | ||
#include <string> | ||
|
||
// user include files | ||
|
||
// forward declarations | ||
namespace edm { | ||
class ModuleTypeResolverBase { | ||
public: | ||
static constexpr int kInitialIndex = 0; | ||
static constexpr int kLastIndex = -1; | ||
virtual ~ModuleTypeResolverBase() = default; | ||
|
||
/**This function is meant to be called multiple times with different values for index. The first call should set index | ||
to kInitialIndex. The int returned from the function is the new index to use on next call or is a value of kLastIndex which | ||
means no further calls should be made. The returned string is the next concrete type to be used when making a call. | ||
On subsequent call, the argument basename can be the same string as returned from the previous call to the function. | ||
**/ | ||
virtual std::pair<std::string, int> resolveType(std::string basename, int index) const = 0; | ||
}; | ||
} // namespace edm | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.