Robotics Library  0.6.2
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
rl::hal::Socket Class Referenceabstract

#include <Socket.h>

Inheritance diagram for rl::hal::Socket:
Inheritance graph
[legend]

Public Member Functions

 Socket (const ::std::string &host, const unsigned short int &port)
 
virtual ~Socket ()
 
void close ()
 
::std::string getHost () const
 
unsigned short int getPort () const
 
virtual void open ()=0
 
::std::size_t read (void *buf, const ::std::size_t &count)
 
::std::size_t select (const bool &read, const bool &write, const ::rl::math::Real &timeout)
 
::std::size_t write (const void *buf, const ::std::size_t &count)
 
- Public Member Functions inherited from rl::hal::Com
 Com ()
 
virtual ~Com ()
 
bool isConnected () const
 

Protected Member Functions

void connect (const int &domain, const int &type, const int &protocol)
 
- Protected Member Functions inherited from rl::hal::Com
void setConnected (const bool &connected)
 

Private Attributes

::std::string host
 
unsigned short int port
 
int sockfd
 

Constructor & Destructor Documentation

◆ Socket()

rl::hal::Socket::Socket ( const ::std::string &  host,
const unsigned short int &  port 
)

◆ ~Socket()

rl::hal::Socket::~Socket ( )
virtual

Member Function Documentation

◆ close()

void rl::hal::Socket::close ( )
virtual

Implements rl::hal::Com.

◆ connect()

void rl::hal::Socket::connect ( const int &  domain,
const int &  type,
const int &  protocol 
)
protected

◆ getHost()

std::string rl::hal::Socket::getHost ( ) const

◆ getPort()

unsigned short int rl::hal::Socket::getPort ( ) const

◆ open()

virtual void rl::hal::Socket::open ( )
pure virtual

Implements rl::hal::Com.

Implemented in rl::hal::UdpSocket, and rl::hal::TcpSocket.

◆ read()

std::size_t rl::hal::Socket::read ( void *  buf,
const ::std::size_t &  count 
)

◆ select()

std::size_t rl::hal::Socket::select ( const bool &  read,
const bool &  write,
const ::rl::math::Real timeout 
)

◆ write()

std::size_t rl::hal::Socket::write ( const void *  buf,
const ::std::size_t &  count 
)

Member Data Documentation

◆ host

::std::string rl::hal::Socket::host
private

◆ port

unsigned short int rl::hal::Socket::port
private

◆ sockfd

int rl::hal::Socket::sockfd
private

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