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.11 2011/08/31 20:11:59 wmtan Exp $
3 
4 #ifndef EventFilter_StorageManager_FragmentStore_h
5 #define EventFilter_StorageManager_FragmentStore_h
6 
7 #include <map>
8 
12 
13 
14 namespace stor {
15 
27  {
28  public:
29 
30  explicit FragmentStore(size_t maxMemoryUsageMB);
31 
38  const bool addFragment(I2OChain&);
39 
40 
46 
47 
52  void resetStaleEventTimes();
53 
54 
61  const bool getStaleEvent(I2OChain&, utils::Duration_t timeout);
62 
63 
67  inline void clear()
68  { store_.clear(); memoryUsed_ = 0; }
69 
70 
74  inline bool empty() const
75  { return store_.empty(); }
76 
77 
81  inline bool full() const
82  { return (memoryUsed_ >= maxMemoryUsage_); }
83 
84 
88  inline unsigned int size() const
89  { return store_.size(); }
90 
91 
95  inline size_t memoryUsed() const
96  { return memoryUsed_; }
97 
98 
99  private:
100 
101  //Prevent copying of the FragmentStore
104 
105  typedef std::map<FragKey, I2OChain> fragmentMap;
107 
108  size_t memoryUsed_;
109  const size_t maxMemoryUsage_;
110  };
111 
112 } // namespace stor
113 
114 #endif // EventFilter_StorageManager_FragmentStore_h
115 
116 
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:81
std::map< FragKey, I2OChain > fragmentMap
size_t memoryUsed() const
Definition: FragmentStore.h:95
void addToStaleEventTimes(const utils::Duration_t)
const bool getStaleEvent(I2OChain &, utils::Duration_t timeout)
bool empty() const
Definition: FragmentStore.h:74
unsigned int size() const
Definition: FragmentStore.h:88