-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMutex_SendEvent.cc
58 lines (47 loc) · 1.19 KB
/
Mutex_SendEvent.cc
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* SendEvent.cc
*
* Created on: 25.06.2020
* Author: krassus
*/
#include "ns3/log.h"
#include "ns3/core-module.h"
#include "Mutex_SendEvent.h"
namespace ns3
{
NS_LOG_COMPONENT_DEFINE("MutexSendEvent");
MutexSendEvent::MutexSendEvent(Ptr<GameState> gs, Ptr<EEBTProtocolMutex> prot, Ptr<EEBTPNode> recipient, Mac48Address originator, Mac48Address newOriginator, Mac48Address unused, double txPower, uint16_t seqNo) : EventImpl()
{
this->gs = gs;
this->prot = prot;
this->seqNo = seqNo;
this->txPower = txPower;
this->counter = 0;
this->recipient = recipient;
this->originator = originator;
this->newOriginator = newOriginator;
this->unused = unused;
}
MutexSendEvent::~MutexSendEvent() {}
void MutexSendEvent::Notify()
{
this->prot->Send(this->gs, this->recipient, this->originator, this->newOriginator, this->unused, this->seqNo, this->txPower, this);
this->counter++;
}
uint32_t MutexSendEvent::getNTimes()
{
return this->counter;
}
void MutexSendEvent::updateTxPower(double txPower)
{
this->txPower = txPower;
}
uint16_t MutexSendEvent::getSeqNo()
{
return this->seqNo;
}
void MutexSendEvent::setSeqNo(uint16_t seqNo)
{
this->seqNo = seqNo;
}
}