File indexing completed on 2024-04-06 12:13:02
0001 #ifndef FWCore_ServiceRegistry_ESModuleCallingContext_h
0002 #define FWCore_ServiceRegistry_ESModuleCallingContext_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include "FWCore/ServiceRegistry/interface/ESParentContext.h"
0018
0019 #include <iosfwd>
0020 #include <cstdint>
0021
0022 namespace edm {
0023
0024 namespace eventsetup {
0025 struct ComponentDescription;
0026 }
0027 class ModuleCallingContext;
0028 class ESModuleCallingContext {
0029 public:
0030 using Type = ESParentContext::Type;
0031
0032 enum class State {
0033 kPrefetching,
0034 kRunning,
0035 kInvalid
0036 };
0037
0038 ESModuleCallingContext(edm::eventsetup::ComponentDescription const* moduleDescription, std::uintptr_t id);
0039
0040 ESModuleCallingContext(edm::eventsetup::ComponentDescription const* moduleDescription,
0041 std::uintptr_t id,
0042 State state,
0043 ESParentContext const& parent);
0044
0045 void setContext(State state, ESParentContext const& parent);
0046
0047 void setState(State state) { state_ = state; }
0048
0049 edm::eventsetup::ComponentDescription const* componentDescription() const { return componentDescription_; }
0050 State state() const { return state_; }
0051 Type type() const { return parent_.type(); }
0052
0053
0054
0055 std::uintptr_t callID() const { return id_; }
0056 ESParentContext const& parent() const { return parent_; }
0057 ModuleCallingContext const* moduleCallingContext() const { return parent_.moduleCallingContext(); }
0058 ESModuleCallingContext const* esmoduleCallingContext() const { return parent_.esmoduleCallingContext(); }
0059
0060
0061
0062 ModuleCallingContext const* getTopModuleCallingContext() const;
0063
0064
0065
0066 unsigned depth() const;
0067
0068 private:
0069 edm::eventsetup::ComponentDescription const* componentDescription_;
0070 ESParentContext parent_;
0071 std::uintptr_t id_;
0072 State state_;
0073 };
0074 }
0075 #endif