CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

edm::CurrentProcessingContext Class Reference

#include <CurrentProcessingContext.h>

List of all members.

Public Member Functions

void activate (std::size_t theSlotInPath, ModuleDescription const *mod)
 Set the context to reflect the active state.
 CurrentProcessingContext (std::string const *name, int bitpos, bool isEndPth)
 CurrentProcessingContext ()
 Default-constructed objects reflect the inactive state.
void deactivate ()
 Set all data to reflect inactive state.
bool isEndPath () const
 Return true if the path is an end path, and false otherwise.
bool isUnscheduled () const
 Returns true if the module is being called via unscheduled execution.
ModuleDescription const * moduleDescription () const
std::string const * moduleLabel () const
int pathInSchedule () const
std::string const * pathName () const
void setUnscheduledDepth (unsigned int)
 Set the depth in a series of unscheduled callbacks.
int slotInPath () const
unsigned int unscheduledDepth () const
 Returns 0 if module is on the path and >0 when the module executing is unscheduled.

Private Member Functions

bool is_active () const

Private Attributes

bool isEndPath_
ModuleDescription const * moduleDescription_
int pathInSchedule_
std::string const * pathName_
std::size_t slotInPath_
unsigned int unscheduledDepth_

Detailed Description

Definition at line 23 of file CurrentProcessingContext.h.


Constructor & Destructor Documentation

edm::CurrentProcessingContext::CurrentProcessingContext ( )

Default-constructed objects reflect the inactive state.

Definition at line 6 of file CurrentProcessingContext.cc.

edm::CurrentProcessingContext::CurrentProcessingContext ( std::string const *  name,
int  bitpos,
bool  isEndPth 
)

Create a CurrentProcessingContext ready to handle the Path with given name and bit position (slot in Schedule).

Definition at line 15 of file CurrentProcessingContext.cc.


Member Function Documentation

void edm::CurrentProcessingContext::activate ( std::size_t  theSlotInPath,
ModuleDescription const *  mod 
)

Set the context to reflect the active state.

Definition at line 79 of file CurrentProcessingContext.cc.

References mod(), moduleDescription_, and slotInPath_.

Referenced by edm::Path::processOneOccurrence().

                                                                   {
    assert( mod );
    slotInPath_     = theSlotInPath;
    moduleDescription_ = mod;
  }
void edm::CurrentProcessingContext::deactivate ( )

Set all data to reflect inactive state.

Definition at line 87 of file CurrentProcessingContext.cc.

References moduleDescription_, pathInSchedule_, pathName_, and slotInPath_.

bool edm::CurrentProcessingContext::is_active ( ) const [inline, private]

Definition at line 89 of file CurrentProcessingContext.h.

References moduleDescription_.

Referenced by moduleLabel(), pathInSchedule(), and slotInPath().

{ return moduleDescription_ != 0; }
bool edm::CurrentProcessingContext::isEndPath ( ) const

Return true if the path is an end path, and false otherwise.

Definition at line 59 of file CurrentProcessingContext.cc.

References isEndPath_.

Referenced by edm::Worker::doWork().

                                            {
    return isEndPath_;
  }
bool edm::CurrentProcessingContext::isUnscheduled ( ) const

Returns true if the module is being called via unscheduled execution.

Definition at line 69 of file CurrentProcessingContext.cc.

References unscheduledDepth().

Referenced by edm::Worker::doWork().

                                                {
    return 0 != unscheduledDepth();
  }
ModuleDescription const * edm::CurrentProcessingContext::moduleDescription ( ) const

Return the address of the ModuleDescription describing this module if active, and null otherwise.

Definition at line 39 of file CurrentProcessingContext.cc.

References moduleDescription_.

Referenced by edm::OutputModule::getTriggerResults().

                                                    {
    return moduleDescription_;
  }
std::string const * edm::CurrentProcessingContext::moduleLabel ( ) const

The compiler-generated copy c'tor and d'tor are correct, because all our resources are contained by value. We do not own the resources to which we point; we own only the pointers. Return the address of the moduleLabel if the module is active, and null otherwise.

Definition at line 27 of file CurrentProcessingContext.cc.

References is_active(), moduleDescription_, and edm::ModuleDescription::moduleLabel().

Referenced by moduleLabel().

                                              {
    return is_active()
      ? &(moduleDescription_->moduleLabel())
      : 0;
  }
int edm::CurrentProcessingContext::pathInSchedule ( ) const

Return the slot number of this path in the schedule (this is the bit position of the path) if the path is active, and -1 otherwise.

Definition at line 44 of file CurrentProcessingContext.cc.

References is_active(), and pathInSchedule_.

Referenced by path(), and pmid().

                                                 {
    return is_active()
      ? pathInSchedule_
      : -1;
  }
std::string const * edm::CurrentProcessingContext::pathName ( ) const

Return the name of the current path if the module is active, and null otherwise.

Definition at line 34 of file CurrentProcessingContext.cc.

References pathName_.

Referenced by pathName().

                                           {
    return pathName_;
  }
void edm::CurrentProcessingContext::setUnscheduledDepth ( unsigned int  iDepth)

Set the depth in a series of unscheduled callbacks.

Definition at line 74 of file CurrentProcessingContext.cc.

References unscheduledDepth_.

Referenced by edm::UnscheduledHandler::tryToFill().

                                                                   {
    unscheduledDepth_ = iDepth;
  }
int edm::CurrentProcessingContext::slotInPath ( ) const

Return the slot number of this module in the path if the path is active, and -1 otherwise.

Definition at line 52 of file CurrentProcessingContext.cc.

References is_active(), and slotInPath_.

Referenced by module(), and pmid().

                                             {
    return is_active()
      ? static_cast<int>(slotInPath_)
      : -1;
  }
unsigned int edm::CurrentProcessingContext::unscheduledDepth ( ) const

Returns 0 if module is on the path and >0 when the module executing is unscheduled.

Definition at line 64 of file CurrentProcessingContext.cc.

References unscheduledDepth_.

Referenced by isUnscheduled(), and edm::UnscheduledHandler::tryToFill().

                                                   {
    return unscheduledDepth_;
  }

Member Data Documentation

Definition at line 86 of file CurrentProcessingContext.h.

Referenced by isEndPath().

Definition at line 82 of file CurrentProcessingContext.h.

Referenced by deactivate(), and pathInSchedule().

std::string const* edm::CurrentProcessingContext::pathName_ [private]

Definition at line 85 of file CurrentProcessingContext.h.

Referenced by deactivate(), and pathName().

Definition at line 83 of file CurrentProcessingContext.h.

Referenced by activate(), deactivate(), and slotInPath().

Definition at line 87 of file CurrentProcessingContext.h.

Referenced by setUnscheduledDepth(), and unscheduledDepth().