My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
gcp::util::Port Class Reference
Inheritance diagram for gcp::util::Port:
gcp::util::SerialClient gcp::util::TcpClient gcp::util::GpibUsbController

Public Member Functions

 Port (int fd=-1)
 
virtual ~Port ()
 
int getFd ()
 
virtual int connect ()
 
void writeString (std::string &message, int fd=-1)
 
void writeBytes (Vector< unsigned char > &buffer)
 
unsigned int readBytes (unsigned char *message, int fd=-1)
 
unsigned int readBytes (Vector< unsigned char > &buffer)
 
unsigned char getNextByte ()
 
std::string readString (int fd=-1)
 
bool concatenateString (std::ostringstream &os, int fd=-1, bool cont=true)
 
void concatenateChar (std::ostringstream &os, int fd=-1)
 
int getNbyte (int fd=-1)
 
void terminateAt (std::string strip)
 
void strip (std::string strip)
 
void dontStrip (std::string strip)
 
void stripUnprintable (bool strip)
 
void append (std::string append)
 
void setNoBuf ()
 
void setLineBuf ()
 

Static Public Member Functions

static void writeBytes (Vector< unsigned char > &buffer, int fd)
 

Static Public Attributes

static const unsigned int MAX_RCV_BUFFER = 300
 
static const unsigned TELNET_PORT_NO = 23
 

Protected Attributes

int fd_
 

Constructor & Destructor Documentation

Port::Port ( int  fd = -1)

Constructor

....................................................................... Constructor.

Port::~Port ( )
virtual

Destructor

....................................................................... Destructor.

Member Function Documentation

void Port::append ( std::string  append)

Append the passed string to the end of each line

....................................................................... A string to append to the end of each line

virtual int gcp::util::Port::connect ( )
inlinevirtual

Connect to the port

Reimplemented in gcp::util::GpibUsbController, gcp::util::TcpClient, and gcp::util::SerialClient.

void Port::dontStrip ( std::string  dontStrip)

Characters we mustn't strip. Note that this will override duplicate characters implied by stripUnprintable()

....................................................................... Strip

int gcp::util::Port::getFd ( )
inline

Return the file descriptor associated with our port connection

unsigned int Port::readBytes ( unsigned char *  message,
int  fd = -1 
)

Read a message from the port

void Port::setLineBuf ( )

Set line buffering for this stream

void Port::setNoBuf ( )

Set no buffering for this stream

void Port::strip ( std::string  strip)

Strip any of the following characters from data read from the port

....................................................................... Strip

void Port::stripUnprintable ( bool  strip)

Strip any unprintable characters

....................................................................... Strip unprintable characters

void Port::terminateAt ( std::string  term)

terminate a read when any of the following characters are read from the port

....................................................................... Terminate a read at any of the characters in the passed string

void Port::writeBytes ( Vector< unsigned char > &  message)

....................................................................... Write a message to the port

void Port::writeBytes ( Vector< unsigned char > &  message,
int  fd 
)
static

....................................................................... Write a message to the port

void Port::writeString ( std::string &  message,
int  fd = -1 
)

Write a message to the port

....................................................................... Write a message to the port


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