-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrame.cpp
More file actions
63 lines (60 loc) · 1.16 KB
/
Frame.cpp
File metadata and controls
63 lines (60 loc) · 1.16 KB
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
59
60
61
62
#include "Frame.h"
Frame::Frame()
{
this->empty = 1;
// this->payload = NULL;
//Default ctor
}
Frame::Frame(std::string name){
this->empty = 1;
this->name = name;
}
std::string Frame::getName(){
return this->name;
}
std::string Frame::getsourceAdd(){
return this->sourceAdd;
}
void Frame::setsourceAdd(std::string a){
//std::mutex * thismutex = (mymutex);
this->mymutex.lock();
this->sourceAdd = a;
this->mymutex.unlock();
}
std::string Frame::getDestAdd(){
return this->destAdd;
}
void Frame::setDestAdd(std::string b){
this->mymutex.lock();
this->destAdd = b;
this->mymutex.unlock();
}
void Frame::setPayload(std::string s, std::string d, std::string c){
this->mymutex.lock();
this->sourceAdd = s;
this->destAdd = d;
this->payload = c;
this->empty = 0;
this->mymutex.unlock();
}
std::string Frame::getPayload()
{
return this->payload;
}
int Frame::isempty()
{
return this->empty;
}
void Frame::clearPayload()
{
this->mymutex.lock();
this->sourceAdd.clear();
this->destAdd.clear();
this->payload.clear();
this->empty = 1;
this->mymutex.unlock();
}
Frame::~Frame()
{
//dtor
}