packet.h
Go to the documentation of this file.
1 
31 #ifndef CREATE_PACKET_H
32 #define CREATE_PACKET_H
33 
34 #include <mutex>
35 
36 namespace create {
37  class Packet {
38  private:
39  uint16_t data;
40  uint16_t tmpData;
41  mutable std::mutex dataMutex;
42  mutable std::mutex tmpDataMutex;
43 
44  protected:
45  // Thread safe
46  void setData(const uint16_t& d);
47 
48  public:
49  const uint8_t nbytes;
50  const std::string info;
51 
52  Packet(const uint8_t& nbytes, const std::string& info);
53  ~Packet();
54 
55  // Thread safe
56  void setDataToValidate(const uint16_t& td);
57  // Thread safe
58  void validate();
59  // Thread safe
60  uint16_t getData() const;
61  };
62 
63 } // namepsace create
64 
65 #endif // CREATE_PACKET_H
const uint8_t nbytes
Definition: packet.h:49
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
const std::string info
Definition: packet.h:50
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