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 137 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 150 of file EPStates.h.

Constructor & Destructor Documentation

statemachine::HandleFiles::HandleFiles ( my_context  ctx)

Definition at line 56 of file EPStates.cc.

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

Definition at line 67 of file EPStates.cc.

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

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

Member Function Documentation

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

Definition at line 79 of file EPStates.cc.

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

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

79  {
81  ep_.closeInputFile(cleaningUpAfterException);
83  }
edm::IEventProcessor & ep_
Definition: EPStates.h:156
virtual void closeOutputFiles()=0
virtual void respondToCloseInputFile()=0
virtual void closeInputFile(bool cleaningUpAfterException)=0
void statemachine::HandleFiles::exit ( )

Definition at line 61 of file EPStates.cc.

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

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

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

Definition at line 85 of file EPStates.cc.

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

85  {
87  ep_.closeInputFile(false);
88 
89  ep_.readFile();
91  }
edm::IEventProcessor & ep_
Definition: EPStates.h:156
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 93 of file EPStates.cc.

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

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

Member Data Documentation

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

Definition at line 156 of file EPStates.h.

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

bool statemachine::HandleFiles::exitCalled_
private

Definition at line 157 of file EPStates.h.

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