@@ -35,29 +35,30 @@ POSSIBILITY OF SUCH DAMAGE.
3535#ifndef CREATE_SERIAL_H
3636#define CREATE_SERIAL_H
3737
38+ #include < condition_variable>
39+ #include < functional>
40+ #include < memory>
41+ #include < mutex>
42+ #include < thread>
43+
3844#include < boost/asio.hpp>
39- #include < boost/thread.hpp>
40- #include < boost/thread/condition_variable.hpp>
41- #include < boost/function.hpp>
42- #include < boost/shared_ptr.hpp>
43- #include < boost/enable_shared_from_this.hpp>
4445
4546#include " create/data.h"
4647#include " create/types.h"
4748#include " create/util.h"
4849
4950namespace create {
50- class Serial : public boost ::enable_shared_from_this<Serial> {
51+ class Serial : public std ::enable_shared_from_this<Serial> {
5152
5253 protected:
5354 boost::asio::io_service io;
5455 boost::asio::signal_set signals;
5556 boost::asio::serial_port port;
5657
5758 private:
58- boost ::thread ioThread;
59- boost ::condition_variable dataReadyCond;
60- boost ::mutex dataReadyMut;
59+ std ::thread ioThread;
60+ std ::condition_variable dataReadyCond;
61+ std ::mutex dataReadyMut;
6162 bool dataReady;
6263 bool isReading;
6364 bool firstRead;
@@ -66,13 +67,13 @@ namespace create {
6667 // Callback executed when data arrives from Create
6768 void onData (const boost::system::error_code& e, const std::size_t & size);
6869 // Callback to execute once data arrives
69- boost ::function<void ()> callback;
70+ std ::function<void ()> callback;
7071 // Start and stop reading data from Create
7172 bool startReading ();
7273 void stopReading ();
7374
7475 protected:
75- boost ::shared_ptr<Data> data;
76+ std ::shared_ptr<Data> data;
7677 // These are for possible diagnostics
7778 uint64_t corruptPackets;
7879 uint64_t totalPackets;
@@ -85,9 +86,9 @@ namespace create {
8586 void notifyDataReady ();
8687
8788 public:
88- Serial (boost ::shared_ptr<Data> data);
89+ Serial (std ::shared_ptr<Data> data);
8990 ~Serial ();
90- bool connect (const std::string& port, const int & baud = 115200 , boost ::function<void ()> cb = 0);
91+ bool connect (const std::string& port, const int & baud = 115200 , std ::function<void ()> cb = 0);
9192 void disconnect ();
9293 inline bool connected () const { return port.is_open (); };
9394 bool send (const uint8_t * bytes, const uint32_t numBytes);
0 commit comments