12 #ifndef SST_CORE_SERIALIZATION_SERIALIZE_PRIORITY_QUEUE_H 13 #define SST_CORE_SERIALIZATION_SERIALIZE_PRIORITY_QUEUE_H 15 #include "sst/core/serialization/serializer.h" 21 namespace Serialization {
24 template <
class T,
class S,
class C>
27 typedef std::priority_queue<T, S, C> Pqueue;
30 S& getContainer(std::priority_queue<T, S, C>& q)
32 struct UnderlyingContainer : std::priority_queue<T, S, C>
34 static S& getUnderlyingContainer(std::priority_queue<T, S, C>& q) {
return q.*&UnderlyingContainer::c; }
36 return UnderlyingContainer::getUnderlyingContainer(q);
41 switch ( ser.mode() ) {
42 case serializer::SIZER:
44 size_t size = v.size();
47 auto container = getContainer(v);
48 for (
auto it = container.begin(); it != container.end(); ++it ) {
49 T& t =
const_cast<T&
>(*it);
54 case serializer::PACK:
56 size_t size = v.size();
59 auto container = getContainer(v);
60 for (
auto it = container.begin(); it != container.end(); ++it ) {
61 T& t =
const_cast<T&
>(*it);
66 case serializer::UNPACK:
70 for (
size_t i = 0; i < size; ++i ) {
85 #endif // SST_CORE_SERIALIZATION_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:35
Serialization "gateway" object.
Definition: serialize.h:110