CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

edm::RunPrincipal Class Reference

#include <RunPrincipal.h>

Inheritance diagram for edm::RunPrincipal:
edm::Principal edm::EDProductGetter

List of all members.

Public Types

typedef RunAuxiliary Auxiliary
typedef Principal Base

Public Member Functions

RunAuxiliary const & aux () const
Timestamp const & beginTime () const
Timestamp const & endTime () const
void fillRunPrincipal (DelayedReader *reader=0)
RunID const & id () const
void mergeAuxiliary (RunAuxiliary const &aux)
void put (ConstBranchDescription const &bd, WrapperOwningHolder const &edp)
void readImmediate () const
RunNumber_t run () const
 RunPrincipal (boost::shared_ptr< RunAuxiliary > aux, boost::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, HistoryAppender *historyAppender=0)
void setEndTime (Timestamp const &time)
void setUnscheduledHandler (boost::shared_ptr< UnscheduledHandler >)
 ~RunPrincipal ()

Private Member Functions

void resolveProductImmediate (Group const &g) const
virtual bool unscheduledFill (std::string const &) const

Private Attributes

boost::shared_ptr< RunAuxiliaryaux_

Detailed Description

Definition at line 28 of file RunPrincipal.h.


Member Typedef Documentation

Definition at line 30 of file RunPrincipal.h.

Definition at line 31 of file RunPrincipal.h.


Constructor & Destructor Documentation

edm::RunPrincipal::RunPrincipal ( boost::shared_ptr< RunAuxiliary aux,
boost::shared_ptr< ProductRegistry const >  reg,
ProcessConfiguration const &  pc,
HistoryAppender historyAppender = 0 
)

Definition at line 11 of file RunPrincipal.cc.

                                      :
    Base(reg, pc, InRun, historyAppender),
      aux_(aux) {
  }
edm::RunPrincipal::~RunPrincipal ( ) [inline]

Definition at line 38 of file RunPrincipal.h.

{}

Member Function Documentation

RunAuxiliary const& edm::RunPrincipal::aux ( ) const [inline]

Definition at line 42 of file RunPrincipal.h.

References aux_.

Referenced by edm::SubProcess::beginRun(), beginTime(), endTime(), id(), run(), and edm::RootOutputFile::writeRun().

                                    {
      return *aux_;
    }
Timestamp const& edm::RunPrincipal::beginTime ( ) const [inline]
Timestamp const& edm::RunPrincipal::endTime ( ) const [inline]
void edm::RunPrincipal::fillRunPrincipal ( DelayedReader reader = 0)

Definition at line 21 of file RunPrincipal.cc.

References aux_, edm::Principal::begin(), edm::Principal::end(), edm::Principal::fillPrincipal(), i, edm::Principal::processHistoryID(), and edm::Principal::reader().

                                                      {

    fillPrincipal(aux_->processHistoryID(), reader);

    for (const_iterator i = this->begin(), iEnd = this->end(); i != iEnd; ++i) {
      (*i)->setProcessHistoryID(processHistoryID());
    }
  }
RunID const& edm::RunPrincipal::id ( void  ) const [inline]
void edm::RunPrincipal::mergeAuxiliary ( RunAuxiliary const &  aux) [inline]

Definition at line 66 of file RunPrincipal.h.

References aux_.

                                                 {
      return aux_->mergeAuxiliary(aux);
    }
void edm::RunPrincipal::put ( ConstBranchDescription const &  bd,
WrapperOwningHolder const &  edp 
)

Definition at line 31 of file RunPrincipal.cc.

References edm::ConstBranchDescription::branchID(), Exception, g, edm::Principal::getExistingGroup(), edm::errors::InsertFailure, edm::WrapperHolder::isValid(), edm::ConstBranchDescription::produced(), and edm::Principal::putOrMerge().

Referenced by edm::Run::commit_().

                                        {

    assert(bd.produced());
    if(!edp.isValid()) {
      throw edm::Exception(edm::errors::InsertFailure,"Null Pointer")
        << "put: Cannot put because auto_ptr to product is null."
        << "\n";
    }
    Group *g = getExistingGroup(bd.branchID());
    assert(g);
    // Group assumes ownership
    putOrMerge(edp, g);
  }
void edm::RunPrincipal::readImmediate ( ) const

Definition at line 48 of file RunPrincipal.cc.

References edm::Principal::begin(), edm::Group::branchDescription(), edm::Principal::end(), g, i, edm::ConstBranchDescription::produced(), edm::Group::productUnavailable(), and resolveProductImmediate().

                                    {
    for (Principal::const_iterator i = begin(), iEnd = end(); i != iEnd; ++i) {
      Group const& g = **i;
      if(!g.branchDescription().produced()) {
        if(!g.productUnavailable()) {
          resolveProductImmediate(g);
        }
      }
    }
  }
void edm::RunPrincipal::resolveProductImmediate ( Group const &  g) const [private]

Definition at line 60 of file RunPrincipal.cc.

References edm::Group::branchDescription(), edm::ProductData::getInterface(), edm::getProduct(), edm::ConstBranchDescription::produced(), edm::Group::productData(), edm::Principal::putOrMerge(), and edm::Principal::reader().

Referenced by readImmediate().

                                                            {
    if(g.branchDescription().produced()) return; // nothing to do.
    if(!reader()) return; // nothing to do.

    // must attempt to load from persistent store
    BranchKey const bk = BranchKey(g.branchDescription());
    WrapperOwningHolder edp(reader()->getProduct(bk, g.productData().getInterface(), this));

    // Now fix up the Group
    if(edp.isValid()) {
      putOrMerge(edp, &g);
    }
  }
RunNumber_t edm::RunPrincipal::run ( void  ) const [inline]

Definition at line 46 of file RunPrincipal.h.

References aux(), and edm::RunAuxiliary::run().

Referenced by edm::InputSource::markRun(), and edm::PoolOutputModule::writeRun().

                            {
      return aux().run();
    }
void edm::RunPrincipal::setEndTime ( Timestamp const &  time) [inline]

Definition at line 62 of file RunPrincipal.h.

References aux_.

Referenced by edm::InputSource::doEndRun().

                                           {
      aux_->setEndTime(time);
    }
void edm::RunPrincipal::setUnscheduledHandler ( boost::shared_ptr< UnscheduledHandler ) [inline]

Definition at line 70 of file RunPrincipal.h.

{}
virtual bool edm::RunPrincipal::unscheduledFill ( std::string const &  ) const [inline, private, virtual]

Implements edm::Principal.

Definition at line 80 of file RunPrincipal.h.

{return false;}

Member Data Documentation

boost::shared_ptr<RunAuxiliary> edm::RunPrincipal::aux_ [private]

Definition at line 85 of file RunPrincipal.h.

Referenced by aux(), fillRunPrincipal(), mergeAuxiliary(), and setEndTime().