Go to the documentation of this file.00001
00003
00004 #include "EventFilter/StorageManager/interface/I2OChain.h"
00005 #include "EventFilter/StorageManager/interface/StateMachine.h"
00006
00007 #include <iostream>
00008
00009 #include <boost/statechart/event_base.hpp>
00010
00011 #include "xcept/tools.h"
00012
00013 using namespace std;
00014 using namespace stor;
00015 using namespace boost::statechart;
00016
00017 Operations::Operations()
00018 {
00019
00020
00021 }
00022
00023 Operations::~Operations()
00024 {
00025
00026
00027 }
00028
00029 void Operations::processI2OFragment( I2OChain& frag ) const
00030 {
00031 do_processI2OFragment( frag );
00032 }
00033
00034 void Operations::noFragmentToProcess() const
00035 {
00036 do_noFragmentToProcess();
00037 }
00038
00039 std::string Operations::stateName() const
00040 {
00041 return do_stateName();
00042 }
00043
00044 void Operations::moveToFailedState( xcept::Exception& exception ) const
00045 {
00046 do_moveToFailedState( exception );
00047 }
00048
00049
00051
00053
00054 void
00055 Operations::do_processI2OFragment( I2OChain& frag ) const
00056 {
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074 }
00075
00076
00077 void Operations::safeEntryAction()
00078 {
00079 const std::string unknown = "unknown exception";
00080 std::string msg = "Error going into " + stateName() + " state: ";
00081 try
00082 {
00083 do_entryActionWork();
00084 }
00085 catch( xcept::Exception& e )
00086 {
00087 XCEPT_DECLARE_NESTED( stor::exception::StateTransition,
00088 sentinelException, msg, e );
00089 moveToFailedState( sentinelException );
00090 }
00091 catch( std::exception& e )
00092 {
00093 msg += e.what();
00094 XCEPT_DECLARE( stor::exception::StateTransition,
00095 sentinelException, msg );
00096 moveToFailedState( sentinelException );
00097 }
00098 catch(...)
00099 {
00100 msg += "unknown exception";
00101 XCEPT_DECLARE( stor::exception::StateTransition,
00102 sentinelException, msg );
00103 moveToFailedState( sentinelException );
00104 }
00105 }
00106
00107
00108 void Operations::safeExitAction()
00109 {
00110 const std::string unknown = "unknown exception";
00111 std::string msg = "Error leaving " + stateName() + " state: ";
00112 try
00113 {
00114 do_exitActionWork();
00115 }
00116 catch( xcept::Exception& e )
00117 {
00118 XCEPT_DECLARE_NESTED( stor::exception::StateTransition,
00119 sentinelException, msg, e );
00120 moveToFailedState( sentinelException );
00121 }
00122 catch( std::exception& e )
00123 {
00124 msg += e.what();
00125 XCEPT_DECLARE( stor::exception::StateTransition,
00126 sentinelException, msg );
00127 moveToFailedState( sentinelException );
00128 }
00129 catch(...)
00130 {
00131 msg += "unknown exception";
00132 XCEPT_DECLARE( stor::exception::StateTransition,
00133 sentinelException, msg );
00134 moveToFailedState( sentinelException );
00135 }
00136 }
00137
00138
00139 void
00140 Operations::do_noFragmentToProcess() const
00141 {
00142
00143 }
00144
00145
00146
00153