packet.cpp
Go to the documentation of this file.
00001 #include "create/packet.h"
00002 
00003 namespace create {
00004 
00005   Packet::Packet(const uint8_t& numBytes, const std::string& comment) :
00006     nbytes(numBytes),
00007     info(comment),
00008     data(0),
00009     tmpData(0) { }
00010 
00011   Packet::~Packet() { }
00012 
00013   void Packet::setDataToValidate(const uint16_t& tmp) {
00014     boost::mutex::scoped_lock lock(tmpDataMutex);
00015     tmpData = tmp;
00016   }
00017 
00018   void Packet::validate() {
00019     boost::mutex::scoped_lock lock(tmpDataMutex);
00020     setData(tmpData);
00021   }
00022 
00023   void Packet::setData(const uint16_t& d) {
00024     boost::mutex::scoped_lock lock(dataMutex);
00025     data = d;
00026   }
00027 
00028   uint16_t Packet::getData() const {
00029     boost::mutex::scoped_lock lock(dataMutex);
00030     return data;
00031   }
00032 
00033 } // namespace create


libcreate
Author(s): Jacob Perron
autogenerated on Thu Jun 6 2019 21:02:06