12 #ifndef SST_CORE_SERIALIZATION_IMPL_SERIALIZE_PRIORITY_QUEUE_H 13 #define SST_CORE_SERIALIZATION_IMPL_SERIALIZE_PRIORITY_QUEUE_H 15 #ifndef SST_INCLUDING_SERIALIZE_H 17 "The header file sst/core/serialization/impl/serialize_priority_queue.h should not be directly included as it is not part of the stable public API. The file is included in sst/core/serialization/serialize.h" 20 #include "sst/core/serialization/serializer.h" 26 namespace Serialization {
29 template <
class T,
class S,
class C>
32 typedef std::priority_queue<T, S, C> Pqueue;
35 S& getContainer(std::priority_queue<T, S, C>& q)
37 struct UnderlyingContainer : std::priority_queue<T, S, C>
39 static S& getUnderlyingContainer(std::priority_queue<T, S, C>& q) {
return q.*&UnderlyingContainer::c; }
41 return UnderlyingContainer::getUnderlyingContainer(q);
46 switch ( ser.mode() ) {
47 case serializer::SIZER:
49 size_t size = v.size();
52 auto container = getContainer(v);
53 for (
auto it = container.begin(); it != container.end(); ++it ) {
54 T& t =
const_cast<T&
>(*it);
59 case serializer::PACK:
61 size_t size = v.size();
64 auto container = getContainer(v);
65 for (
auto it = container.begin(); it != container.end(); ++it ) {
66 T& t =
const_cast<T&
>(*it);
71 case serializer::UNPACK:
75 for (
size_t i = 0; i < size; ++i ) {
88 void operator()(Pqueue& UNUSED(v),
serializer& UNUSED(ser),
const char* UNUSED(name))
98 #endif // SST_CORE_SERIALIZATION_IMPL_SERIALIZE_PRIORITY_QUEUE_H This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:43
Serialization "gateway" object.
Definition: serialize.h:133