Note: Goby version 1 (shown here) is now considered obsolete. Please use version 2 for new projects, and consider upgrading old projects.

Goby Underwater Autonomy Project  Series: 1.1, revision: 163, released on 2013-02-06 14:23:27 -0500
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Public Types | Public Member Functions | Protected Member Functions | Static Protected Attributes
goby::util::LineBasedInterface Class Reference

basic interface class for all the derived serial (and networking mimics) line-based nodes (serial, tcp, udp, etc.) More...

#include <util/liblinebasedcomms/interface.h>

Inherited by goby::util::LineBasedClient< ASIOAsyncReadStream >, goby::util::TCPServer, goby::util::LineBasedClient< boost::asio::ip::tcp::socket >, and goby::util::LineBasedClient< boost::asio::serial_port >.

List of all members.

Public Types

enum  AccessOrder { NEWEST_FIRST, OLDEST_FIRST }

Public Member Functions

void start ()
void close ()
bool active ()
bool readline (std::string *s, AccessOrder order=OLDEST_FIRST)
 returns string line (including delimiter)
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

Protected Member Functions

 LineBasedInterface (const std::string &delimiter)
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)

Static Protected Attributes

static std::string delimiter_
static boost::asio::io_service io_service_
static std::deque
< protobuf::Datagram > 
in_
static boost::mutex in_mutex_

Detailed Description

basic interface class for all the derived serial (and networking mimics) line-based nodes (serial, tcp, udp, etc.)

Definition at line 39 of file interface.h.


Member Function Documentation

bool goby::util::LineBasedInterface::readline ( std::string *  s,
AccessOrder  order = OLDEST_FIRST 
) [inline]

returns string line (including delimiter)

Returns:
true if data was read, false if no data to read

Definition at line 55 of file interface.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends