CMS 3D CMS Logo

ESProductResolverFactoryProducer Class Reference

#include <FWCore/Framework/interface/ESProductResolverFactoryProducer.h>

Detailed Description

Description: An EventSetup algorithmic Provider that manages Factories of Proxies

Usage: This class is used when the algorithms in the EventSetup that are to be run on demand are encapsulated in edm::eventsetup::ProductResolvers's. This 'design pattern' is more flexible than having the algorithm embedded directly in the Provider (see ESProducer for such an implemenation).

Users inherit from this class and then call the 'registerFactory' method in their class' constructor in order to get their Proxies registered. For most users, the already available templated Factory classes should suffice and therefore they should not need to create their own Factories.

Example: register one Factory that creates a resolver that takes no arguments

class FooResolver : public edm::eventsetup::ESProductResolver { ... };
class FooProd : public edm::ESProductResolverFactoryProducer { ... };
FooProd::FooProd(const edm::ParameterSet&) {
typedef edm::eventsetup::ESProductResolverFactoryTemplate<FooResolver> > TYPE;
registerFactory(std::make_unique<TYPE>();
};

Example: register one Factory that creates a resolver that takes one argument

class BarResolver : public edm::eventsetup::ESProductResolver { ...
BarResolver(const edm::ParameterSet&) ;
... };
class BarProd : public edm::ESProductResolverFactoryProducer { ... };
BarProd::BarProd(const edm::ParameterSet& iPS) {
registerFactory(std::make_unique<TYPE>(iPS);
};