Pothos  0.7.0-gf7fbae99
The Pothos dataflow programming software suite
BinaryObject.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 #include <Pothos/Config.hpp>
13 #include <Pothos/Archive/Split.hpp>
14 #include <cstddef> //size_t
15 
16 namespace Pothos {
17 namespace serialization {
18 
24 {
25 public:
26  BinaryObject(const void * const buff, const size_t len):
27  buff(buff), len(len)
28  {
29  return;
30  }
31 
32  template <typename Archive>
33  void save(Archive &ar, const unsigned int)
34  {
35  ar.writeBytes(buff, len);
36  }
37 
38  template <typename Archive>
39  void load(Archive &ar, const unsigned int)
40  {
41  ar.readBytes(const_cast<void *>(buff), len);
42  }
43 
45 
46 private:
47  const void * const buff;
48  const size_t len;
49 };
50 
51 }}
void save(Archive &ar, const unsigned int)
Definition: BinaryObject.hpp:33
#define POTHOS_SERIALIZATION_SPLIT_MEMBER()
Definition: Split.hpp:34
void load(Archive &ar, const unsigned int)
Definition: BinaryObject.hpp:39
Definition: ArchiveEntry.hpp:20
BinaryObject(const void *const buff, const size_t len)
Definition: BinaryObject.hpp:26
Definition: BinaryObject.hpp:23