SST  12.0.0
StructuralSimulationToolkit
serialize_unpacker.h
1 // Copyright 2009-2022 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-2022, 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 SST_CORE_SERIALIZATION_SERIALIZE_UNPACKER_H
13 #define SST_CORE_SERIALIZATION_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 
23 {
24 public:
25  template <class T>
26  void unpack(T& t)
27  {
28  T* bufptr = ser_buffer_accessor::next<T>();
29  t = *bufptr;
30  }
31 
32  /**
33  * @brief unpack_buffer
34  * @param buf Must unpack to non-null buffer
35  * @param size Must be non-zero
36  */
37  void unpack_buffer(void* buf, int size);
38 
39  void unpack_string(std::string& str);
40 };
41 
42 } // namespace pvt
43 } // namespace Serialization
44 } // namespace Core
45 } // namespace SST
46 
47 #endif // SST_CORE_SERIALIZATION_SERIALIZE_UNPACKER_H
void unpack_buffer(void *buf, int size)
unpack_buffer
Definition: serializer.cc:25
Definition: serialize_buffer_accessor.h:35
Definition: serialize_unpacker.h:22