Belle II Software  release-08-01-10
Buffer.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #ifndef _Belle2_Buffer_hh
9 #define _Belle2_Buffer_hh
10 
11 #include <cstddef>
12 
13 namespace Belle2 {
19  class Buffer {
20 
21  // constructors & destructors
22  public:
23  Buffer();
24  Buffer(unsigned int size, unsigned char* memory = NULL);
25  Buffer(const Buffer& w);
26  virtual ~Buffer();
27 
28  // member methods implemented
29  public:
30  unsigned char* ptr() { return m_memory; }
31  const unsigned char* ptr() const { return m_memory; }
32  unsigned int size() const { return m_size; }
33  virtual bool available() { return m_memory != NULL; }
34 
35  // operators
36  public:
37  const Buffer& operator = (const Buffer&);
38 
39  // member data
40  protected:
41  unsigned char* m_memory;
42  unsigned int m_size;
43  bool m_allocated;
44 
45  };
46 
48 }
49 
50 #endif
Abstract base class for different kinds of events.