SST  14.1.0
StructuralSimulationToolkit
unpacker.h
1 // Copyright 2009-2024 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-2024, 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_IMPL_UNPACKER_H
13 #define SST_CORE_SERIALIZATION_IMPL_UNPACKER_H
14 
15 #ifndef SST_INCLUDING_SERIALIZER_H
16 #warning \
17  "The header file sst/core/serialization/impl/unpacker.h should not be directly included as it is not part of the stable public API. The file is included in sst/core/serialization/serializer.h"
18 #endif
19 
20 #include "sst/core/serialization/impl/ser_buffer_accessor.h"
21 
22 namespace SST {
23 namespace Core {
24 namespace Serialization {
25 namespace pvt {
26 
28 {
29 public:
30  template <class T>
31  void unpack(T& t)
32  {
33  T* bufptr = ser_buffer_accessor::next<T>();
34  t = *bufptr;
35  }
36 
37  /**
38  * @brief unpack_buffer
39  * @param buf Must unpack to non-null buffer
40  * @param size Must be non-zero
41  */
42  void unpack_buffer(void* buf, int size);
43 
44  void unpack_string(std::string& str);
45 };
46 
47 } // namespace pvt
48 } // namespace Serialization
49 } // namespace Core
50 } // namespace SST
51 
52 #endif // SST_CORE_SERIALIZATION_IMPL_UNPACKER_H
void unpack_buffer(void *buf, int size)
unpack_buffer
Definition: serializer.cc:25
Definition: action.cc:18
Definition: ser_buffer_accessor.h:40