Go to the documentation of this file.00001 #include "FWCore/Framework/interface/CurrentProcessingContext.h"
00002
00003 #include "DataFormats/Provenance/interface/ModuleDescription.h"
00004
00005 namespace edm {
00006 CurrentProcessingContext::CurrentProcessingContext() :
00007 pathInSchedule_(0),
00008 slotInPath_(0),
00009 moduleDescription_(0),
00010 pathName_(0),
00011 isEndPath_(false),
00012 unscheduledDepth_(0) {
00013 }
00014
00015 CurrentProcessingContext::CurrentProcessingContext(std::string const* name,
00016 int bitpos,
00017 bool isEndPth) :
00018 pathInSchedule_(bitpos),
00019 slotInPath_(0),
00020 moduleDescription_(0),
00021 pathName_(name),
00022 isEndPath_(isEndPth),
00023 unscheduledDepth_(0) {
00024 }
00025
00026 std::string const*
00027 CurrentProcessingContext::moduleLabel() const {
00028 return is_active()
00029 ? &(moduleDescription_->moduleLabel())
00030 : 0;
00031 }
00032
00033 std::string const*
00034 CurrentProcessingContext::pathName() const {
00035 return pathName_;
00036 }
00037
00038 ModuleDescription const*
00039 CurrentProcessingContext::moduleDescription() const {
00040 return moduleDescription_;
00041 }
00042
00043 int
00044 CurrentProcessingContext::pathInSchedule() const {
00045 return is_active()
00046 ? pathInSchedule_
00047 : -1;
00048 }
00049
00050
00051 int
00052 CurrentProcessingContext::slotInPath() const {
00053 return is_active()
00054 ? static_cast<int>(slotInPath_)
00055 : -1;
00056 }
00057
00058 bool
00059 CurrentProcessingContext::isEndPath() const {
00060 return isEndPath_;
00061 }
00062
00063 unsigned int
00064 CurrentProcessingContext::unscheduledDepth() const {
00065 return unscheduledDepth_;
00066 }
00067
00068 bool
00069 CurrentProcessingContext::isUnscheduled() const {
00070 return 0 != unscheduledDepth();
00071 }
00072
00073 void
00074 CurrentProcessingContext::setUnscheduledDepth(unsigned int iDepth) {
00075 unscheduledDepth_ = iDepth;
00076 }
00077
00078 void
00079 CurrentProcessingContext::activate(size_t theSlotInPath,
00080 ModuleDescription const* mod) {
00081 assert( mod );
00082 slotInPath_ = theSlotInPath;
00083 moduleDescription_ = mod;
00084 }
00085
00086 void
00087 CurrentProcessingContext::deactivate() {
00088 pathInSchedule_ = 0;
00089 slotInPath_ = 0;
00090 moduleDescription_ = 0;
00091 pathName_ = 0;
00092 }
00093 }