version 2.28.1
CMake pip_code_model now accept optional NAME field PIByteArray helpers: * piSerialize * piDeserialize
This commit is contained in:
@@ -555,10 +555,27 @@ inline PIByteArray & operator >>(PIByteArray & s, T & ) {
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
template<> inline uint piHash(const PIByteArray & ba) {return ba.hash();}
|
||||
template<> inline void piSwap(PIByteArray & f, PIByteArray & s) {f.swap(s);}
|
||||
|
||||
|
||||
template <typename T> PIByteArray piSerialize(const T & value) {
|
||||
PIByteArray ret;
|
||||
ret << value;
|
||||
return ret;
|
||||
}
|
||||
|
||||
template <typename T> T piDeserialize(const PIByteArray & data) {
|
||||
T ret;
|
||||
if (!data.isEmpty()) {
|
||||
PIByteArray ba(data);
|
||||
ba >> ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#undef _TYPENAME_
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user