CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DQMEventStore.h
Go to the documentation of this file.
1 // $Id: DQMEventStore.h,v 1.14 2012/04/20 10:48:18 mommsen Exp $
3 
4 #ifndef EventFilter_StorageManager_DQMEventStore_h
5 #define EventFilter_StorageManager_DQMEventStore_h
6 
7 #include <map>
8 #include <queue>
9 
10 #include <boost/thread/mutex.hpp>
11 
12 #include "TThread.h"
13 
14 #include "xcept/Exception.h"
15 #include "xdaq/ApplicationDescriptor.h"
16 
23 
24 
25 namespace stor {
26 
27  class DQMEventMonitorCollection;
28 
29 
41  template<class EventType, class ConnectionType, class StateMachineType>
43  {
44  public:
45 
47  (
48  xdaq::ApplicationDescriptor*,
51  ConnectionType*,
52  size_t (ConnectionType::*getExpectedUpdatesCount)() const,
53  StateMachineType*,
54  void (StateMachineType::*moveToFailedState)(xcept::Exception&),
56  );
57 
59 
65 
71  void addDQMEvent(EventType const&);
72 
76  void purge();
77 
81  void clear();
82 
86  bool empty()
87  { return store_.empty(); }
88 
89  void moveToFailedState(xcept::Exception& sentinelException)
90  { (stateMachineType_->*moveToFailedState_)(sentinelException); }
91 
94 
95 
96  private:
97 
98  //Prevent copying of the DQMEventStore
101 
102  void addDQMEventToStore(EventType const&);
103  void addDQMEventToReadyToServe(EventType const&);
105  DQMEventMsgView getDQMEventView(EventType const&);
107  static void processCompletedTopLevelFolders(void* arg);
110 
111  xdaq::ApplicationDescriptor* appDescriptor_;
115  ConnectionType* connectionType_;
116  size_t (ConnectionType::*getExpectedUpdatesCount_)() const;
117  StateMachineType* stateMachineType_;
118  void (StateMachineType::*moveToFailedState_)(xcept::Exception&);
120 
121  typedef std::map<DQMKey, DQMTopLevelFolderPtr> DQMTopLevelFolderMap;
124 
127 
128  std::vector<unsigned char> tempEventArea_;
129 
130  };
131 
132 } // namespace stor
133 
134 #endif // EventFilter_StorageManager_DQMEventStore_h
135 
136 
DQMTopLevelFolderPtr makeDQMTopLevelFolder(EventType const &)
DQMEventMsgView getDQMEventView(EventType const &)
std::vector< unsigned char > tempEventArea_
static boost::mutex mutex
Definition: LHEProxy.cc:11
xdaq::ApplicationDescriptor * appDescriptor_
ConnectionType * connectionType_
bool processCompletedTopLevelFolders_
StateMachineType * stateMachineType_
void addDQMEvent(EventType const &)
bool doProcessCompletedTopLevelFolders()
Definition: DQMEventStore.h:92
DQMEventMonitorCollection & dqmEventMonColl_
bool getNextReadyTopLevelFolder(DQMTopLevelFolderPtr &)
DQMEventStore & operator=(DQMEventStore const &)
bool handleNextCompletedTopLevelFolder()
A arg
Definition: Factorize.h:36
static void processCompletedTopLevelFolders(void *arg)
size_t(ConnectionType::* getExpectedUpdatesCount_)() const
void setParameters(DQMProcessingParams const &)
boost::shared_ptr< DQMEventQueueCollection > DQMEventQueueCollectionPtr
TThread * completedFolderThread_
static boost::mutex storeMutex_
DQMProcessingParams dqmParams_
void stopProcessingCompletedTopLevelFolders()
void moveToFailedState(xcept::Exception &sentinelException)
Definition: DQMEventStore.h:89
boost::shared_ptr< AlarmHandler > AlarmHandlerPtr
Definition: AlarmHandler.h:116
AlarmHandlerPtr alarmHandler_
void(StateMachineType::* moveToFailedState_)(xcept::Exception &)
DQMEventStore(xdaq::ApplicationDescriptor *, DQMEventQueueCollectionPtr, DQMEventMonitorCollection &, ConnectionType *, size_t(ConnectionType::*getExpectedUpdatesCount)() const, StateMachineType *, void(StateMachineType::*moveToFailedState)(xcept::Exception &), AlarmHandlerPtr)
std::map< DQMKey, DQMTopLevelFolderPtr > DQMTopLevelFolderMap
DQMTopLevelFolderMap store_
void addDQMEventToStore(EventType const &)
void addDQMEventToReadyToServe(EventType const &)
DQMEventQueueCollectionPtr dqmEventQueueCollection_
boost::shared_ptr< DQMTopLevelFolder > DQMTopLevelFolderPtr