![]() |
![]() |
00001 // $Id: FragmentProcessor.h,v 1.6 2011/03/07 15:31:32 mommsen Exp $ 00003 00004 #ifndef EventFilter_StorageManager_FragmentProcessor_h 00005 #define EventFilter_StorageManager_FragmentProcessor_h 00006 00007 #include "toolbox/lang/Class.h" 00008 #include "toolbox/task/WaitingWorkLoop.h" 00009 #include "xdaq/Application.h" 00010 00011 #include "boost/date_time/posix_time/posix_time_types.hpp" 00012 #include "boost/shared_ptr.hpp" 00013 00014 #include "EventFilter/StorageManager/interface/EventDistributor.h" 00015 #include "EventFilter/StorageManager/interface/FragmentQueue.h" 00016 #include "EventFilter/StorageManager/interface/FragmentStore.h" 00017 #include "EventFilter/StorageManager/interface/SharedResources.h" 00018 #include "EventFilter/StorageManager/interface/StateMachine.h" 00019 #include "EventFilter/StorageManager/interface/WrapperNotifier.h" 00020 00021 00022 namespace stor { 00023 00024 class I2OChain; 00025 class QueueID; 00026 00027 00040 class FragmentProcessor : public toolbox::lang::Class 00041 { 00042 public: 00043 00044 FragmentProcessor( xdaq::Application *app, SharedResourcesPtr sr ); 00045 00046 ~FragmentProcessor(); 00047 00053 bool processMessages(toolbox::task::WorkLoop*); 00054 00058 void startWorkLoop(std::string workloopName); 00059 00060 00061 private: 00062 00066 void processAllCommands(); 00067 00071 void processAllRegistrations(); 00072 00076 void processOneFragmentIfPossible(); 00077 00082 void processOneFragment(); 00083 00084 xdaq::Application* app_; 00085 SharedResourcesPtr sharedResources_; 00086 WrapperNotifier wrapperNotifier_; 00087 StateMachinePtr stateMachine_; 00088 FragmentStore fragmentStore_; 00089 EventDistributor eventDistributor_; 00090 00091 boost::posix_time::time_duration timeout_; // Waiting time 00092 bool actionIsActive_; 00093 00094 toolbox::task::WorkLoop* processWL_; 00095 00096 }; 00097 00098 } // namespace stor 00099 00100 #endif // EventFilter_StorageManager_FragmentProcessor_h 00101 00102