Belle II Software  release-08-01-10
Writer.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_Writer_hh
9 #define _Belle2_Writer_hh
10 
11 #include <cstddef>
12 #include <string>
13 
14 namespace Belle2 {
20  class Serializable;
21 
22  class Writer {
23 
24  public:
25  virtual ~Writer() {}
26 
27  public:
28  virtual size_t write(const void*, size_t) = 0;
29  virtual bool available() = 0;
30 
31  protected:
32  void reverse(void* buf, size_t len);
33 
34  public:
35  virtual void writeBool(bool);
36  virtual void writeChar(char);
37  virtual void writeShort(short);
38  virtual void writeInt(int);
39  virtual void writeLong(long long);
40  virtual void writeUChar(unsigned char);
41  virtual void writeUShort(unsigned short);
42  virtual void writeUInt(unsigned int);
43  virtual void writeULong(unsigned long long);
44  virtual void writeFloat(float);
45  virtual void writeDouble(double);
46  virtual void writeString(const std::string&);
47  virtual void writeObject(const Serializable&);
48 
49  };
50 
52 };
53 
54 #endif
Abstract base class for different kinds of events.