DP3
BlobStreamable.h
Go to the documentation of this file.
1 // BlobStreamable.h: Interface for classes that can be streamed using blobs.
2 //
3 // Copyright (C) 2020 ASTRON (Netherlands Institute for Radio Astronomy)
4 // SPDX-License-Identifier: GPL-3.0-or-later
5 
6 #ifndef LOFAR_BLOB_BLOBSTREAMABLE_H
7 #define LOFAR_BLOB_BLOBSTREAMABLE_H
8 
9 #include <string>
10 
11 namespace dp3 {
12 namespace blob {
13 
14 class BlobIStream;
15 class BlobOStream;
16 
18 
20 
22 
26  public:
28  virtual ~BlobStreamable() {}
29 
35 
38  void serialize(BlobOStream& bos) const;
39 
40  protected:
42  virtual const std::string& classType() const = 0;
43 
44  private:
46  virtual void read(BlobIStream& bis) = 0;
47 
49  virtual void write(BlobOStream& bos) const = 0;
50 
52  friend class DH_BlobStreamable;
53 };
54 
56 
57 } // namespace blob
58 } // namespace dp3
59 
60 #endif
Input stream for a blob.
Definition: BlobIStream.h:43
Output stream for a blob.
Definition: BlobOStream.h:40
Interface for classes that can be streamed using blobs.
Definition: BlobStreamable.h:25
virtual ~BlobStreamable()
Destructor.
Definition: BlobStreamable.h:28
virtual const std::string & classType() const =0
Return the class type of *this as a string.
static BlobStreamable * deserialize(BlobIStream &bis)
friend class DH_BlobStreamable
The private methods must be accessible for DH_BlobStreamable.
Definition: BlobStreamable.h:52
void serialize(BlobOStream &bos) const
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53