SST  11.0.0
StructuralSimulationToolkit
serialize_unpacker.h
1 // Copyright 2009-2021 NTESS. Under the terms
2 // of Contract DE-NA0003525 with NTESS, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2021, NTESS
6 // All rights reserved.
7 //
8 // This file is part of the SST software package. For license
9 // information, see the LICENSE file in the top level directory of the
10 // distribution.
11 
12 #ifndef SERIALIZE_UNPACKER_H
13 #define SERIALIZE_UNPACKER_H
14 
15 #include "sst/core/serialization/serialize_buffer_accessor.h"
16 
17 namespace SST {
18 namespace Core {
19 namespace Serialization {
20 namespace pvt {
21 
22 class ser_unpacker :
23  public ser_buffer_accessor
24 {
25  public:
26  template <class T>
27  void
28  unpack(T& t){
29  T* bufptr = ser_buffer_accessor::next<T>();
30  t = *bufptr;
31  }
32 
33  /**
34  * @brief unpack_buffer
35  * @param buf Must unpack to non-null buffer
36  * @param size Must be non-zero
37  */
38  void
39  unpack_buffer(void* buf, int size);
40 
41  void
42  unpack_string(std::string& str);
43 
44 };
45 
46 } }
47 }
48 }
49 
50 #endif // SERIALIZE_UNPACKER_H
void unpack_buffer(void *buf, int size)
unpack_buffer
Definition: serializer.cc:23
Definition: serialize_buffer_accessor.h:34
Definition: serialize_unpacker.h:22