-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMessage.cpp
39 lines (31 loc) · 873 Bytes
/
Message.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Message.cpp
* Author: kubatek94
*
* Created on 16 March 2016, 19:25
*/
#include "Message.h"
namespace Message {
Message::Message(Message::Type type, int dataLength) : type(type), buffer(dataOffset + dataLength) {
buffer.put(static_cast<int>(type));
buffer.put(dataOffset + dataLength);
}
Message::Type Message::getType() {
return type;
}
int Message::getLength() {
return buffer.get(1);
}
int Message::getDataLength() {
return getLength() - dataOffset;
}
MessageBuffer* Message::getBuffer() {
return &buffer;
}
void Message::action(VirtualInput& virtualInput) { }
}