Rev | Line | |
---|
[46d6469] | 1 | #include "MessageContainer.h"
|
---|
| 2 |
|
---|
| 3 | #include <iostream>
|
---|
| 4 |
|
---|
| 5 | #include "Compiler.h"
|
---|
| 6 |
|
---|
| 7 | using namespace std;
|
---|
| 8 |
|
---|
| 9 | MessageContainer::MessageContainer() {
|
---|
| 10 | }
|
---|
| 11 |
|
---|
| 12 | MessageContainer::MessageContainer(const MessageContainer& mc) {
|
---|
| 13 | this->msg = mc.msg;
|
---|
| 14 | this->clientAddr = mc.clientAddr;
|
---|
| 15 | this->isAcked = mc.isAcked;
|
---|
| 16 | this->timeAcked = mc.timeAcked;
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 | MessageContainer::MessageContainer(NETWORK_MSG msg, struct sockaddr_in clientAddr) {
|
---|
| 20 | this->clientAddr = clientAddr;
|
---|
| 21 | this->msg = msg;
|
---|
| 22 | this->isAcked = false;
|
---|
| 23 | this->timeAcked = 0;
|
---|
| 24 | }
|
---|
| 25 |
|
---|
| 26 | MessageContainer::~MessageContainer() {
|
---|
| 27 | }
|
---|
| 28 |
|
---|
| 29 | bool MessageContainer::getAcked() {
|
---|
| 30 | return this->isAcked;
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | unsigned long long MessageContainer::getTimeAcked() {
|
---|
| 34 | return this->timeAcked;
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | NETWORK_MSG* MessageContainer::getMessage() {
|
---|
| 38 | return &msg;
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | void MessageContainer::setAcked(bool acked) {
|
---|
| 42 | cout << "acked before: " << this->isAcked << endl;
|
---|
| 43 | this->isAcked = acked;
|
---|
| 44 | cout << "acked after: " << this->isAcked << endl;
|
---|
| 45 | }
|
---|
| 46 |
|
---|
| 47 | void MessageContainer::setTimeAcked(unsigned long long time) {
|
---|
| 48 | this->timeAcked = time;
|
---|
| 49 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.