- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
static_cast<void>(memcpy(reinterpret_cast<U8INT*>(&this->someField), pBuffer , sizeof(someField)));
static_cast<void>(memcpy(reinterpret_cast<U8INT*>(&this->anotherField), pBuffer + sizeof(someField), sizeof(anotherField)));
static_cast<void>(memcpy(reinterpret_cast<U8INT*>(&this->yetAnotherField), pBuffer + sizeof(someField) + sizeof(anotherField), sizeof(yetAnotherField)));
static_cast<void>(memcpy(reinterpret_cast<U8INT*>(&this->moreOfTheSame), pBuffer + sizeof(someField) + sizeof(anotherField) + sizeof(yetAnotherField), sizeof(moreOfTheSame)));
static_cast<void>(memcpy(reinterpret_cast<U8INT*>(&this->iamTiredOfThis), pBuffer + sizeof(someField) + sizeof(anotherField) + sizeof(yetAnotherField) + sizeof(moreOfTheSame), sizeof(iamTiredOfThis)));
static_cast<void>(memcpy(reinterpret_cast<U8INT*>(&this->butItDoesntEnd), pBuffer + sizeof(someField) + sizeof(anotherField) + sizeof(yetAnotherField) + sizeof(moreOfTheSame) + sizeof(iamTiredOfThis), sizeof(butItDoesntEnd)));
static_cast<void>(memcpy(reinterpret_cast<U8INT*>(&this->itGoesOnAndOn), pBuffer + sizeof(someField) + sizeof(anotherField) + sizeof(yetAnotherField) + sizeof(moreOfTheSame) + sizeof(iamTiredOfThis) + sizeof(butItDoesntEnd), sizeof(itGoesOnAndOn)));
static_cast<void>(memcpy(reinterpret_cast<U8INT*>(&this->godHaveMercyOnMe), pBuffer + sizeof(someField) + sizeof(anotherField) + sizeof(yetAnotherField) + sizeof(moreOfTheSame) + sizeof(iamTiredOfThis) + sizeof(butItDoesntEnd) + sizeof(itGoesOnAndOn), sizeof(godHaveMercyOnMe)));
static_cast<void>(memcpy(reinterpret_cast<U8INT*>(&this->crcSum), pBuffer + sizeof(someField) + sizeof(anotherField) + sizeof(yetAnotherField) + sizeof(moreOfTheSame) + sizeof(iamTiredOfThis) + sizeof(butItDoesntEnd) + sizeof(itGoesOnAndOn) + sizeof(godHaveMercyOnMe), sizeof(crcSum)));
сериализация сообщения в С++, следуя best practices Скота Маерса. (имена полей класса анонимизированы, все остально как в оригинале.)
1024-- 23.10.2016 07:00 # −1
huesto 23.10.2016 14:07 # −1
kurwa 23.10.2016 16:00 # 0
Dummy00001 23.10.2016 16:35 # +1
kurwa-nextgen 23.10.2016 18:13 # 0
Dummy00001 23.10.2016 18:21 # 0
kurwa 23.10.2016 22:47 # 0
Dummy00001 23.10.2016 22:59 # 0
guestinho 23.10.2016 19:54 # 0
shadow_of_stertor 23.10.2016 16:01 # −1
roman-kashitsyn 24.10.2016 00:30 # 0
Я для подобной цели когда-то запилил
huesto 24.10.2016 00:42 # 0
Опечатка в слове реквайрс.
huesto 24.10.2016 00:43 # 0
roman-kashitsyn 24.10.2016 00:45 # 0
huesto 24.10.2016 00:47 # 0
roman-kashitsyn 24.10.2016 01:09 # +2
huesto 24.10.2016 01:12 # +2