Refactor Packet API

Declare setData member as protected
Rename 'setTempData' to 'setDataToValidate'
This commit is contained in:
Jacob Perron 2018-04-01 20:04:27 -07:00 committed by jacobperron
parent 6a8702f4e1
commit a70dee6605
4 changed files with 11 additions and 6 deletions

View file

@ -41,6 +41,10 @@ namespace create {
mutable boost::mutex dataMutex;
mutable boost::mutex tmpDataMutex;
protected:
// Thread safe
void setData(const uint16_t& d);
public:
const uint8_t nbytes;
const std::string info;
@ -48,10 +52,11 @@ namespace create {
Packet(const uint8_t& nbytes, const std::string& info);
~Packet();
// All of the following are thread safe
void setTempData(const uint16_t& td);
// Thread safe
void setDataToValidate(const uint16_t& td);
// Thread safe
void validate();
void setData(const uint16_t& d);
// Thread safe
uint16_t getData() const;
};