Goby v2
|
basic interface class for all the derived serial (and networking mimics) line-based nodes (serial, tcp, udp, etc.) More...
#include <goby/util/linebasedcomms/interface.h>
Public Types | |
enum | AccessOrder { NEWEST_FIRST, OLDEST_FIRST } |
Public Member Functions | |
LineBasedInterface (const std::string &delimiter) | |
void | start () |
void | close () |
bool | active () |
void | sleep (int sec) |
bool | readline (std::string *s, AccessOrder order=OLDEST_FIRST) |
returns string line (including delimiter) More... | |
bool | readline (protobuf::Datagram *msg, AccessOrder order=OLDEST_FIRST) |
void | write (const std::string &s) |
void | write (const protobuf::Datagram &msg) |
void | clear () |
void | set_delimiter (const std::string &s) |
std::string | delimiter () const |
boost::asio::io_service & | io_service () |
Protected Member Functions | |
virtual void | do_start ()=0 |
virtual void | do_write (const protobuf::Datagram &line)=0 |
virtual void | do_close (const boost::system::error_code &error)=0 |
void | set_active (bool active) |
std::string & | delimiter () |
std::deque< goby::util::protobuf::Datagram > & | in () |
boost::mutex & | in_mutex () |
Protected Attributes | |
std::string | delimiter_ |
boost::asio::io_service | io_service_ |
std::deque< protobuf::Datagram > | in_ |
boost::mutex | in_mutex_ |
Friends | |
template<typename ASIOAsyncReadStream > | |
class | LineBasedConnection |
basic interface class for all the derived serial (and networking mimics) line-based nodes (serial, tcp, udp, etc.)
Definition at line 44 of file interface.h.
bool goby::util::LineBasedInterface::readline | ( | std::string * | s, |
AccessOrder | order = OLDEST_FIRST |
||
) |
returns string line (including delimiter)
Definition at line 80 of file interface.cpp.