Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

XmlRpc::XmlRpcSource Class Reference

An RPC source represents a file descriptor to monitor. More...

#include <XmlRpcSource.h>

Inheritance diagram for XmlRpc::XmlRpcSource:

XmlRpc::XmlRpcClient XmlRpc::XmlRpcServer XmlRpc::XmlRpcServerConnection List of all members.

Public Member Functions

virtual void close ()
 Close the owned fd. If deleteOnClose was specified at construction, the object is deleted.
int getfd () const
 Return the file descriptor being monitored.
bool getKeepOpen () const
 Return whether the file descriptor should be kept open if it is no longer monitored.
virtual unsigned handleEvent (unsigned eventType)=0
 Return true to continue monitoring this source.
void setfd (int fd)
 Specify the file descriptor to monitor.
void setKeepOpen (bool b=true)
 Specify whether the file descriptor should be kept open if it is no longer monitored.
 XmlRpcSource (int fd=-1, bool deleteOnClose=false)
virtual ~XmlRpcSource ()
 Destructor.

Private Attributes

bool _deleteOnClose
int _fd
bool _keepOpen

Detailed Description

An RPC source represents a file descriptor to monitor.


Constructor & Destructor Documentation

XmlRpc::XmlRpcSource::XmlRpcSource int  fd = -1,
bool  deleteOnClose = false
 

Constructor

Parameters:
fd The socket file descriptor to monitor.
deleteOnClose If true, the object deletes itself when close is called.
00010     : _fd(fd), _deleteOnClose(deleteOnClose), _keepOpen(false)
00011   {
00012   }

XmlRpc::XmlRpcSource::~XmlRpcSource  )  [virtual]
 

Destructor.

00015   {
00016   }


Member Function Documentation

void XmlRpc::XmlRpcSource::close  )  [virtual]
 

Close the owned fd. If deleteOnClose was specified at construction, the object is deleted.

Reimplemented in XmlRpc::XmlRpcClient.

00021   {
00022     if (_fd != -1) {
00023       XmlRpcUtil::log(2,"XmlRpcSource::close: closing socket %d.", _fd);
00024       XmlRpcSocket::close(_fd);
00025       XmlRpcUtil::log(2,"XmlRpcSource::close: done closing socket %d.", _fd);
00026       _fd = -1;
00027     }
00028     if (_deleteOnClose) {
00029       XmlRpcUtil::log(2,"XmlRpcSource::close: deleting this");
00030       _deleteOnClose = false;
00031       delete this;
00032     }
00033   }

int XmlRpc::XmlRpcSource::getfd  )  const [inline]
 

Return the file descriptor being monitored.

00025 { return _fd; }

bool XmlRpc::XmlRpcSource::getKeepOpen  )  const [inline]
 

Return whether the file descriptor should be kept open if it is no longer monitored.

00030 { return _keepOpen; }

virtual unsigned XmlRpc::XmlRpcSource::handleEvent unsigned  eventType  )  [pure virtual]
 

Return true to continue monitoring this source.

Implemented in XmlRpc::XmlRpcClient, XmlRpc::XmlRpcServer, and XmlRpc::XmlRpcServerConnection.

void XmlRpc::XmlRpcSource::setfd int  fd  )  [inline]
 

Specify the file descriptor to monitor.

00027 { _fd = fd; }

void XmlRpc::XmlRpcSource::setKeepOpen bool  b = true  )  [inline]
 

Specify whether the file descriptor should be kept open if it is no longer monitored.

00032 { _keepOpen = b; }


Member Data Documentation

bool XmlRpc::XmlRpcSource::_deleteOnClose [private]
 

int XmlRpc::XmlRpcSource::_fd [private]
 

bool XmlRpc::XmlRpcSource::_keepOpen [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 19:25:37 2011 for BOSS6.5.5 by  doxygen 1.3.9.1