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 
14 
15  void Packet::setDataToValidate(const uint16_t& tmp) {
16  std::lock_guard<std::mutex> lock(tmpDataMutex);
17  tmpData = tmp;
18  }
19 
21  std::lock_guard<std::mutex> lock(tmpDataMutex);
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
void setDataToValidate(const uint16_t &td)
Definition: packet.cpp:15
uint16_t tmpData
Definition: packet.h:40
uint16_t getData() const
Definition: packet.cpp:30
Packet(const uint8_t &nbytes, const std::string &info)
Definition: packet.cpp:7
Definition: create.h:48
std::mutex tmpDataMutex
Definition: packet.h:42
void setData(const uint16_t &d)
Definition: packet.cpp:25
uint16_t data
Definition: packet.h:39
std::mutex dataMutex
Definition: packet.h:41
void validate()
Definition: packet.cpp:20


libcreate
Author(s): Jacob Perron
autogenerated on Sat May 8 2021 03:02:37