The BoostCommunication object that is used for actual read/write communication for all Connection objects
BoostCommunication( |
| ) |
Initializes the BoostCommunication object
ioService std::unique_ptr<boost::asio::io_service> | boost io_service |
ioObj std::unique_ptr<IO_Object> | boost io_object passed (Template) |
Destroys the BoostCommunication object
Boost io_service needed in communication
Boost io_object used to communicate (serial_port, ip::tcp::socket, etc.)
std::function<void( |
| )> m_parseDataFunction |
The function to send all the read in data to. If null, the data will be thrown out.
The mutex used to access/change the parse data function.
void write( |
| ) const |
Uses boost to write bytes to the io_object. Blocks until the write completes
data const std::vector<uint8>& | the bytes to be written |
Clears the read buffer.
Gets the read position from the byte buffer.
Gets the append position from the byte buffer.
Starts the main read loop that reads in all data using boost
The ByteStream object holding the read in bytes
Performs the actual port read of bytes.
void readLoopHandler( |
| ) |
The read handler for the read loop, called when data comes in or the read operation has been canceled
error const boost::system::error_code& | boost error code |
bytes_transferred std::size_t | number of bytes read in |
Error_Connection | I/O error occurred, the I/O service has been stopped |
Stops the current boost::asio::io_service so no more reads or writes will happen
void stopIoServiceError( |
| ) |
Stops the current boost::asio::io_service due to an error
void setParseFunction( |
| ) |
Sets the function to be called when data is read in.
fn | The function to set as the parser function. |