FACT++  1.0
ConnectionUSB Class Reference

#include <ConnectionUSB.h>

+ Inheritance diagram for ConnectionUSB:
+ Collaboration diagram for ConnectionUSB:

Public Member Functions

void SetLogStream (MessageImp *log)
std::ostream & Out ()
void AsyncRead (const boost::asio::mutable_buffers_1 buffers, int type=0, int counter=0)
void AsyncWrite (const boost::asio::const_buffers_1 &buffers)
void AsyncWait (boost::asio::deadline_timer &timer, int millisec, void(ConnectionUSB::*handler)(const boost::system::error_code &))
 ConnectionUSB (boost::asio::io_service &io_service, std::ostream &out)
void SetEndpoint (const std::string &addr)
void Connect ()
void PostClose (int64_t delay=0)
void PostMessage (const void *msg, size_t s=0)
void PostMessage (const std::string &cmd, size_t s=-1)
template<typename T , size_t N>
void PostMessage (const std::array< T, N > &msg)
template<typename T >
void PostMessage (const std::vector< T > &msg)
virtual void HandleReceivedData (const boost::system::error_code &, size_t, int=0, int=0)
virtual void HandleTransmittedData (size_t)
virtual void HandleReadTimeout (const boost::system::error_code &)
int IsClosed () const
bool IsConnected () const
bool IsConnecting () const
std::string URL () const
- Public Member Functions inherited from MessageImp
 MessageImp (std::ostream &out=std::cout)
virtual ~MessageImp ()
virtual void IndicateStateChange (const Time &, const std::string &)
void StateChanged (const Time &time, const std::string &server, const std::string &msg, int state)
int Update (const std::string &txt, int severity=kMessage)
int Update (const char *txt, int severity=kMessage)
int Update (const std::ostringstream &str, int severity=kMessage)
int Debug (const std::string &str)
int Message (const std::string &str)
int Info (const std::string &str)
int Warn (const std::string &str)
int Error (const std::string &str)
int Alarm (const std::string &str)
int Fatal (const std::string &str)
int Comment (const std::string &str)
int Debug (const char *txt)
int Message (const char *txt)
int Info (const char *txt)
int Warn (const char *txt)
int Error (const char *txt)
int Alarm (const char *txt)
int Fatal (const char *txt)
int Comment (const char *txt)
int Debug (const std::ostringstream &str)
int Message (const std::ostringstream &str)
int Info (const std::ostringstream &str)
int Warn (const std::ostringstream &str)
int Alarm (const std::ostringstream &str)
int Error (const std::ostringstream &str)
int Fatal (const std::ostringstream &str)
int Comment (const std::ostringstream &str)
std::ostream & operator() () const
std::ostream & Out () const
virtual bool MessageQueueEmpty () const

Protected Member Functions

void CloseImp (int64_t delay=0)

Protected Attributes

boost::asio::deadline_timer fInTimeout

Private Types

enum  ConnectionStatus_t { kDisconnected = 0, kConnecting = 1, kConnected = 2 }

Private Member Functions

void ConnectImp (const boost::system::error_code &error, boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
void HandleWriteTimeout (const boost::system::error_code &error)
void HandleSentData (const boost::system::error_code &error, size_t)
void HandleReconnectTimeout (const boost::system::error_code &error)
int Write (const Time &t, const std::string &txt, int qos=kInfo)
virtual void ConnectionEstablished ()

Private Attributes

std::string fAddress
boost::asio::serial_port_base::baud_rate fBaudRate
boost::asio::serial_port_base::character_size fCharacterSize
boost::asio::serial_port_base::parity fParity
boost::asio::serial_port_base::stop_bits fStopBits
boost::asio::serial_port_base::flow_control fFlowControl
boost::asio::deadline_timer fOutTimeout
boost::asio::deadline_timer fConnectTimeout
size_t fQueueSize
ConnectionStatus_t fConnectionStatus

Additional Inherited Members

- Public Types inherited from MessageImp
enum  Severity {
  kMessage = 10, kInfo = 20, kWarn = 30, kError = 40,
  kAlarm = 45, kFatal = 50, kComment = 90, kDebug = 99
 Severity of a message. More...

Detailed Description

Definition at line 14 of file ConnectionUSB.h.

The documentation for this class was generated from the following files: