Loading...
Searching...
No Matches
UuidKeySerialization.hpp
1#pragma once
2#include <score/plugins/UuidKey.hpp>
4
5#if defined(SCORE_DEBUG_DELIMITERS)
6SCORE_SERALIZE_DATASTREAM_DEFINE_T(template <typename T>, UuidKey<T>)
7#else
8// The same 16 bytes DataStreamReader writes, without one: QSettings streams
9// these while flushing, which can happen after the application's components
10// are gone.
11template <typename T>
12QDataStream& operator<<(QDataStream& stream, const UuidKey<T>& obj)
13{
14 stream.writeRawData(
15 reinterpret_cast<const char*>(obj.impl().data), sizeof(obj.impl().data));
16 return stream;
17}
18
19template <typename T>
20QDataStream& operator>>(QDataStream& stream, UuidKey<T>& obj)
21{
22 stream.readRawData(reinterpret_cast<char*>(obj.impl().data), sizeof(obj.impl().data));
23 return stream;
24}
25#endif
Definition UuidKey.hpp:345