diff options
author | Determinant <ted.sybil@gmail.com> | 2018-08-01 14:15:43 -0400 |
---|---|---|
committer | Determinant <ted.sybil@gmail.com> | 2018-08-01 14:15:43 -0400 |
commit | d542aa0b24d5607ee066a2a50f5e29064c1aaef7 (patch) | |
tree | 3ea26f118645e67f4969a723dad60db71b519d63 /include/salticidae/msg.h | |
parent | bc078abd9d5fcc420dfbcda06869a95aba39b1ea (diff) |
...
Diffstat (limited to 'include/salticidae/msg.h')
-rw-r--r-- | include/salticidae/msg.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/salticidae/msg.h b/include/salticidae/msg.h index bc1a633..80b468a 100644 --- a/include/salticidae/msg.h +++ b/include/salticidae/msg.h @@ -61,7 +61,8 @@ class MsgBase { template<typename MsgType, typename = typename std::enable_if< !std::is_same<MsgType, MsgBase>::value && - !std::is_same<MsgType, uint8_t *>::value>::type> + !std::is_same<MsgType, bytearray_t>::value && + !std::is_same<MsgType, DataStream>::value>::type> MsgBase(const MsgType &msg): magic(0x0) { set_opcode(MsgType::opcode); set_payload(std::move(msg.serialized)); @@ -87,15 +88,13 @@ class MsgBase { payload(std::move(other.payload)), no_payload(other.no_payload) {} - MsgBase(const uint8_t *raw_header): no_payload(true) { + MsgBase(DataStream &&s): no_payload(true) { uint32_t _magic; opcode_t _opcode; uint32_t _length; #ifndef SALTICIDAE_NOCHECKSUM uint32_t _checksum; #endif - DataStream s(raw_header, raw_header + MsgBase::header_size); - s >> _magic >> _opcode >> _length |