Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
packet.cpp
Go to the documentation of this file.
1
#include <memory>
2
3
#include "
create/packet.h
"
4
5
namespace
create
{
6
7
Packet::Packet
(
const
uint8_t& numBytes,
const
std::string& comment) :
8
data(0),
9
tmpData(0),
10
nbytes(numBytes),
11
info(comment) { }
12
13
Packet::~Packet
() { }
14
15
void
Packet::setDataToValidate
(
const
uint16_t& tmp) {
16
std::lock_guard<std::mutex> lock(
tmpDataMutex
);
17
tmpData
= tmp;
18
}
19
20
void
Packet::validate
() {
21
std::lock_guard<std::mutex> lock(
tmpDataMutex
);
22
setData
(
tmpData
);
23
}
24
25
void
Packet::setData
(
const
uint16_t& d) {
26
std::lock_guard<std::mutex> lock(
dataMutex
);
27
data
= d;
28
}
29
30
uint16_t
Packet::getData
()
const
{
31
std::lock_guard<std::mutex> lock(
dataMutex
);
32
return
data
;
33
}
34
35
}
// namespace create
create::Packet::setDataToValidate
void setDataToValidate(const uint16_t &td)
Definition:
packet.cpp:15
create::Packet::tmpData
uint16_t tmpData
Definition:
packet.h:40
create::Packet::getData
uint16_t getData() const
Definition:
packet.cpp:30
create::Packet::Packet
Packet(const uint8_t &nbytes, const std::string &info)
Definition:
packet.cpp:7
create
Definition:
create.h:48
create::Packet::tmpDataMutex
std::mutex tmpDataMutex
Definition:
packet.h:42
create::Packet::setData
void setData(const uint16_t &d)
Definition:
packet.cpp:25
create::Packet::~Packet
~Packet()
Definition:
packet.cpp:13
create::Packet::data
uint16_t data
Definition:
packet.h:39
packet.h
create::Packet::dataMutex
std::mutex dataMutex
Definition:
packet.h:41
create::Packet::validate
void validate()
Definition:
packet.cpp:20
libcreate
Author(s): Jacob Perron
autogenerated on Sat May 8 2021 03:02:37