CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BufferArea.cc
Go to the documentation of this file.
1 
3 
4 #include <memory>
5 #include <list>
6 
7 namespace edm {
8 
9 namespace
10  {
11  // --------------------------------------------
12  // keep the buffers around since there are intended to be used
13  // by multiple threads
14 
15  struct BufHolder
16  {
17  BufHolder() { }
18  ~BufHolder()
19  {
20  while(!v_.empty())
21  { EventBuffer* b = v_.front(); delete b; v_.pop_front(); }
22  }
23  std::list<EventBuffer*> v_;
24  };
25  BufHolder holder;
26  }
27 
28  EventBuffer* getEventBuffer(int es, int qd)
29  {
30  std::auto_ptr<EventBuffer> b(new EventBuffer(es,qd));
31  holder.v_.push_front(b.get());
32  return b.release();
33  }
34 
35 }
36 
37 
EventBuffer * getEventBuffer(int event_size_max, int queue_depth_max)
Definition: BufferArea.cc:28
double b
Definition: hdecay.h:120