PIByteArray works on binary stream

This commit is contained in:
2022-05-10 15:23:18 +03:00
parent 0f9e592273
commit b2bc385397
58 changed files with 254 additions and 923 deletions

View File

@@ -195,21 +195,21 @@ private:
int offset, cur, height;
};
inline PIByteArray & operator <<(PIByteArray & b, const Daemon::HostInfo & v) {
b << v.execCommand << v.hostname << v.user << v.OS_name
BINARY_STREAM_STORE (Daemon::HostInfo) {
s << v.execCommand << v.hostname << v.user << v.OS_name
<< v.OS_version << v.architecture << v.execDateTime
<< v.processorsCount << v.ID << v.threads << v.priority
<< v.physical_memsize << v.share_memsize
<< v.cpu_load_system << v.cpu_load_user;
return b;
return s;
}
inline PIByteArray & operator >>(PIByteArray & b, Daemon::HostInfo & v) {
b >> v.execCommand >> v.hostname >> v.user >> v.OS_name
BINARY_STREAM_RESTORE(Daemon::HostInfo) {
s >> v.execCommand >> v.hostname >> v.user >> v.OS_name
>> v.OS_version >> v.architecture >> v.execDateTime
>> v.processorsCount >> v.ID >> v.threads >> v.priority
>> v.physical_memsize >> v.share_memsize
>> v.cpu_load_system >> v.cpu_load_user;
return b;
return s;
}
#endif // DAEMON_H