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 134 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 147 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:153
statemachine::HandleFiles::~HandleFiles ( )

Definition at line 66 of file EPStates.cc.

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

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:153

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_, edm::IEventProcessor::respondToCloseInputFile(), and edm::IEventProcessor::respondToCloseOutputFiles().

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

78  {
80  ep_.closeInputFile(cleaningUpAfterException);
83  }
virtual void respondToCloseOutputFiles()=0
edm::IEventProcessor & ep_
Definition: EPStates.h:153
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:153
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:153
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:153
virtual bool shouldWeCloseOutput() const =0

Member Data Documentation

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

Definition at line 153 of file EPStates.h.

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

bool statemachine::HandleFiles::exitCalled_
private

Definition at line 154 of file EPStates.h.

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