Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-24 09:53:11

0001 #ifndef FWCore_ServiceRegistry_ESParentContext_h
0002 #define FWCore_ServiceRegistry_ESParentContext_h
0003 
0004 /**\class edm::ESParentContext
0005 
0006  Description: This is intended to be used as a member of ESModuleCallingContext.
0007 
0008  Usage:
0009 
0010 
0011 */
0012 //
0013 // Original Author: C. Jones
0014 //         Created: 2/07/2021
0015 
0016 namespace edm {
0017 
0018   class ModuleCallingContext;
0019   class ESModuleCallingContext;
0020 
0021   class ESParentContext {
0022   public:
0023     enum class Type { kModule, kESModule, kInvalid };
0024 
0025     ESParentContext();
0026     explicit ESParentContext(ModuleCallingContext const*) noexcept;
0027     explicit ESParentContext(ESModuleCallingContext const*) noexcept;
0028 
0029     Type type() const noexcept { return type_; }
0030 
0031     ModuleCallingContext const* moduleCallingContext() const;
0032     ESModuleCallingContext const* esmoduleCallingContext() const;
0033 
0034   private:
0035     Type type_;
0036 
0037     union Parent {
0038       ModuleCallingContext const* module;
0039       ESModuleCallingContext const* esmodule;
0040     } parent_;
0041   };
0042 }  // namespace edm
0043 #endif