CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
statemachine::HandleFiles Class Reference

#include <EPStates.h>

Inheritance diagram for statemachine::HandleFiles:

Public Types

typedef mpl::list
< sc::transition< Event, Error >
, sc::transition< Lumi, Error >
, sc::transition< Run, Error >
, sc::transition< File, Error >
, sc::transition< Stop,
EndingLoop >, sc::transition
< Restart, Error > > 
reactions
 

Public Member Functions

void closeFiles (bool cleaningUpAfterException)
 
void exit ()
 
void goToNewInputFile ()
 
 HandleFiles (my_context ctx)
 
bool shouldWeCloseOutput ()
 
 ~HandleFiles ()
 

Private Attributes

edm::IEventProcessorep_
 
bool exitCalled_
 

Detailed Description

Definition at line 135 of file EPStates.h.

Member Typedef Documentation

typedef mpl::list< sc::transition<Event, Error>, sc::transition<Lumi, Error>, sc::transition<Run, Error>, sc::transition<File, Error>, sc::transition<Stop, EndingLoop>, sc::transition<Restart, Error> > statemachine::HandleFiles::reactions

Definition at line 148 of file EPStates.h.

Constructor & Destructor Documentation

statemachine::HandleFiles::HandleFiles ( my_context  ctx)

Definition at line 55 of file EPStates.cc.

55  :
56  my_base(ctx),
57  ep_(context<Machine>().ep()),
58  exitCalled_(false) { }
edm::IEventProcessor & ep_
Definition: EPStates.h:154
statemachine::HandleFiles::~HandleFiles ( )

Definition at line 66 of file EPStates.cc.

References closeFiles(), ep_, exitCalled_, python.rootplot.argparse::message, edm::IEventProcessor::setExceptionMessageFiles(), and AlCaHLTBitMon_QueryRunRegistry::string.

66  {
67  if(!exitCalled_) {
68  try {
69  closeFiles(true);
70  }
71  catch(...) {
72  std::string message("Another exception was caught while trying to clean up files after the primary fatal exception.");
74  }
75  }
76  }
virtual void setExceptionMessageFiles(std::string &message)=0
void closeFiles(bool cleaningUpAfterException)
Definition: EPStates.cc:78
edm::IEventProcessor & ep_
Definition: EPStates.h:154

Member Function Documentation

void statemachine::HandleFiles::closeFiles ( bool  cleaningUpAfterException)

Definition at line 78 of file EPStates.cc.

References edm::IEventProcessor::closeInputFile(), edm::IEventProcessor::closeOutputFiles(), ep_, and edm::IEventProcessor::respondToCloseInputFile().

Referenced by exit(), and ~HandleFiles().

78  {
80  ep_.closeInputFile(cleaningUpAfterException);
82  }
edm::IEventProcessor & ep_
Definition: EPStates.h:154
virtual void closeOutputFiles()=0
virtual void respondToCloseInputFile()=0
virtual void closeInputFile(bool cleaningUpAfterException)=0
void statemachine::HandleFiles::exit ( )

Definition at line 60 of file EPStates.cc.

References edm::IEventProcessor::alreadyHandlingException(), closeFiles(), ep_, and exitCalled_.

Referenced by argparse.ArgumentParser::error(), and python.rootplot.argparse.ArgumentParser::error().

60  {
61  if(ep_.alreadyHandlingException()) return;
62  exitCalled_ = true;
63  closeFiles(false);
64  }
void closeFiles(bool cleaningUpAfterException)
Definition: EPStates.cc:78
edm::IEventProcessor & ep_
Definition: EPStates.h:154
virtual bool alreadyHandlingException() const =0
void statemachine::HandleFiles::goToNewInputFile ( )

Definition at line 84 of file EPStates.cc.

References edm::IEventProcessor::closeInputFile(), ep_, edm::IEventProcessor::readFile(), edm::IEventProcessor::respondToCloseInputFile(), and edm::IEventProcessor::respondToOpenInputFile().

84  {
86  ep_.closeInputFile(false);
87 
88  ep_.readFile();
90  }
edm::IEventProcessor & ep_
Definition: EPStates.h:154
virtual void readFile()=0
virtual void respondToOpenInputFile()=0
virtual void respondToCloseInputFile()=0
virtual void closeInputFile(bool cleaningUpAfterException)=0
bool statemachine::HandleFiles::shouldWeCloseOutput ( )

Definition at line 92 of file EPStates.cc.

References ep_, dtDQMClient_cfg::fileMode, statemachine::NOMERGE, and edm::IEventProcessor::shouldWeCloseOutput().

92  {
93  if(context<Machine>().fileMode() == NOMERGE) return true;
94  return ep_.shouldWeCloseOutput();
95  }
edm::IEventProcessor & ep_
Definition: EPStates.h:154
virtual bool shouldWeCloseOutput() const =0

Member Data Documentation

edm::IEventProcessor& statemachine::HandleFiles::ep_
private

Definition at line 154 of file EPStates.h.

Referenced by closeFiles(), exit(), goToNewInputFile(), shouldWeCloseOutput(), and ~HandleFiles().

bool statemachine::HandleFiles::exitCalled_
private

Definition at line 155 of file EPStates.h.

Referenced by exit(), and ~HandleFiles().