CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FragmentStore.h
Go to the documentation of this file.
1 // $Id: FragmentStore.h,v 1.9 2011/03/07 15:31:32 mommsen Exp $
3 
4 #ifndef EventFilter_StorageManager_FragmentStore_h
5 #define EventFilter_StorageManager_FragmentStore_h
6 
7 #include <map>
8 
10 
13 
14 
15 namespace stor {
16 
28  {
29  public:
30 
31  explicit FragmentStore(size_t maxMemoryUsageMB);
32 
39  const bool addFragment(I2OChain&);
40 
41 
47 
48 
53  void resetStaleEventTimes();
54 
55 
62  const bool getStaleEvent(I2OChain&, utils::Duration_t timeout);
63 
64 
68  inline void clear()
69  { store_.clear(); memoryUsed_ = 0; }
70 
71 
75  inline bool empty() const
76  { return store_.empty(); }
77 
78 
82  inline bool full() const
83  { return (memoryUsed_ >= maxMemoryUsage_); }
84 
85 
89  inline unsigned int size() const
90  { return store_.size(); }
91 
92 
96  inline size_t memoryUsed() const
97  { return memoryUsed_; }
98 
99 
100  private:
101 
102  //Prevent copying of the FragmentStore
105 
106  typedef std::map<FragKey, I2OChain> fragmentMap;
108 
109  size_t memoryUsed_;
110  const size_t maxMemoryUsage_;
111  };
112 
113 } // namespace stor
114 
115 #endif // EventFilter_StorageManager_FragmentStore_h
116 
117 
const size_t maxMemoryUsage_
const bool addFragment(I2OChain &)
FragmentStore & operator=(FragmentStore const &)
FragmentStore(size_t maxMemoryUsageMB)
boost::posix_time::time_duration Duration_t
Definition: Utils.h:41
bool full() const
Definition: FragmentStore.h:82
std::map< FragKey, I2OChain > fragmentMap
size_t memoryUsed() const
Definition: FragmentStore.h:96
void addToStaleEventTimes(const utils::Duration_t)
const bool getStaleEvent(I2OChain &, utils::Duration_t timeout)
bool empty() const
Definition: FragmentStore.h:75
unsigned int size() const
Definition: FragmentStore.h:89