CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DQMTopLevelFolder.h
Go to the documentation of this file.
1 // $Id: DQMTopLevelFolder.h,v 1.5 2011/04/04 16:05:37 mommsen Exp $
3 
4 #ifndef EventFilter_StorageManager_DQMTopLevelFolder_h
5 #define EventFilter_StorageManager_DQMTopLevelFolder_h
6 
7 #include <vector>
8 
9 #include "boost/shared_ptr.hpp"
10 
12 
19 
21 
22 
23 namespace stor {
24 
25  class DQMEventMonitorCollection;
26 
27 
37  {
38 
39  public:
40 
41  class Record
42  {
43  private:
44 
45  struct Entry
46  {
47  std::vector<unsigned char> buffer;
49  };
50 
51  public:
52 
53  Record() :
54  entry_(new Entry) {};
55 
59  inline void clear()
60  { entry_->buffer.clear(); entry_->dqmConsumers.clear(); }
61 
66  inline void* getBuffer(size_t size) const
67  { entry_->buffer.resize(size); return &(entry_->buffer[0]); }
68 
73  inline void tagForEventConsumers(const QueueIDs& ids)
74  { entry_->dqmConsumers = ids; }
75 
81  { return entry_->dqmConsumers; }
82 
87  { return DQMEventMsgView(&entry_->buffer[0]); }
88 
92  inline bool empty() const
93  { return ( entry_->buffer.empty() ); }
94 
98  inline size_t memoryUsed() const
99  { return entry_->buffer.size() + entry_->dqmConsumers.size()*sizeof(QueueID); }
100 
104  inline unsigned long totalDataSize() const
105  { return entry_->buffer.size(); }
106 
107 
108  private:
109 
110  // We use here a shared_ptr to avoid copying the whole
111  // buffer each time the event record is handed on
112  boost::shared_ptr<Entry> entry_;
113 
114  };
115 
116 
117  public:
118 
120  (
121  const DQMKey&,
122  const QueueIDs&,
123  const DQMProcessingParams&,
125  const unsigned int expectedUpdates,
127  );
128 
130 
136  void addDQMEvent(const DQMEventMsgView&);
137 
144  void addDQMEvent(const I2OChain& dqmEvent);
145 
151  bool isReady(const utils::TimePoint_t& now) const;
152 
157  bool getRecord(Record&);
158 
159 
160  private:
161 
162  void addEvent(std::auto_ptr<DQMEvent::TObjectTable>);
163  size_t populateTable(DQMEvent::TObjectTable&) const;
164 
169  const unsigned int expectedUpdates_;
171 
172  unsigned int nUpdates_;
173  unsigned int mergeCount_;
175  std::string releaseTag_;
176  uint32_t updateNumber_;
178 
179  typedef boost::shared_ptr<DQMFolder> DQMFolderPtr;
180  typedef std::map<std::string, DQMFolderPtr> DQMFoldersMap;
182 
183  static unsigned int sentEvents_;
184  };
185 
186  typedef boost::shared_ptr<DQMTopLevelFolder> DQMTopLevelFolderPtr;
187 
188 } // namespace stor
189 
190 #endif // EventFilter_StorageManager_DQMTopLevelFolder_h
191 
192 
std::map< std::string, DQMFolderPtr > DQMFoldersMap
DQMEventMsgView getDQMEventMsgView() const
void addDQMEvent(const DQMEventMsgView &)
size_t populateTable(DQMEvent::TObjectTable &) const
bool isReady(const utils::TimePoint_t &now) const
std::vector< QueueID > QueueIDs
Definition: QueueID.h:80
void * getBuffer(size_t size) const
static unsigned int sentEvents_
std::vector< unsigned char > buffer
void addEvent(std::auto_ptr< DQMEvent::TObjectTable >)
const unsigned int expectedUpdates_
const DQMProcessingParams dqmParams_
utils::TimePoint_t lastUpdate_
boost::posix_time::ptime TimePoint_t
Definition: Utils.h:35
boost::shared_ptr< AlarmHandler > AlarmHandlerPtr
Definition: AlarmHandler.h:116
QueueIDs getEventConsumerTags() const
DQMTopLevelFolder(const DQMKey &, const QueueIDs &, const DQMProcessingParams &, DQMEventMonitorCollection &, const unsigned int expectedUpdates, AlarmHandlerPtr)
boost::shared_ptr< Entry > entry_
unsigned long totalDataSize() const
DQMEventMonitorCollection & dqmEventMonColl_
boost::shared_ptr< DQMFolder > DQMFolderPtr
boost::shared_ptr< DQMTopLevelFolder > DQMTopLevelFolderPtr
std::map< std::string, std::vector< TObject * > > TObjectTable
AlarmHandlerPtr alarmHandler_
tuple size
Write out results.
void tagForEventConsumers(const QueueIDs &ids)