aboutsummaryrefslogtreecommitdiff
path: root/include/salticidae/msg.h
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2020-02-18 19:26:55 -0500
committerDeterminant <ted.sybil@gmail.com>2020-02-18 19:26:55 -0500
commitb9913ffd42258f17818c911d0f249aa1877af438 (patch)
tree44bee2503ea0a70077eb311a9cfc474ddd5e401a /include/salticidae/msg.h
parentc18cf986facd3c37b85bf20087bdf04537b555f2 (diff)
get it almost working
Diffstat (limited to 'include/salticidae/msg.h')
-rw-r--r--include/salticidae/msg.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/include/salticidae/msg.h b/include/salticidae/msg.h
index a81a5ae..11cf309 100644
--- a/include/salticidae/msg.h
+++ b/include/salticidae/msg.h
@@ -58,14 +58,10 @@ class MsgBase {
mutable bool no_payload;
public:
- MsgBase(): magic(0x0), opcode(0xff), no_payload(true) {}
-
- template<typename MsgType,
- typename = typename std::enable_if<
- !std::is_same<MsgType, MsgBase>::value &&
- !std::is_same<MsgType, bytearray_t>::value &&
- !std::is_same<MsgType, DataStream>::value>::type>
- MsgBase(const MsgType &msg): magic(0x0) {
+ MsgBase(uint32_t magic = 0x0): magic(magic), opcode(0xff), no_payload(true) {}
+
+ template<typename MsgType>
+ MsgBase(const MsgType &msg, uint32_t magic): magic(magic) {
set_opcode(MsgType::opcode);
set_payload(std::move(msg.serialized));
set_checksum();