conexus logo

Conexus::FileDescriptor Class Reference
[Conexus I/O Endpoints]

This class is the top level object for all subclasses performing I/O (Input/Output) operations via file descriptors (which in Linux/Unix/POSIX can be used for almost all I/O). More...

#include <filedescriptor.h>

Inheritance diagram for Conexus::FileDescriptor:

Inheritance graph
[legend]

List of all members.

Public Types

typedef ConexusPointer
< FileDescriptor
pointer

Public Member Functions

virtual ~FileDescriptor ()
virtual int fd () throw ()
 Base class method returning the raw file descriptor.
virtual void close (bool force=false) throw ( close_exception )
 Closes the Endpoint object by closing the member file descriptor.
bool is_blocking ()
bool set_blocking (bool block=true)

Protected Member Functions

 FileDescriptor (int fd=-1, bool close_on_destruct=true)
virtual size_t write_data (const Data data, Timeout to) throw ( write_exception )
virtual Data read_data (size_t s, Timeout to) throw ( read_exception )

Protected Attributes

int m_fd


Detailed Description

This class is the top level object for all subclasses performing I/O (Input/Output) operations via file descriptors (which in Linux/Unix/POSIX can be used for almost all I/O).

Todo:
think about whether read_data() should throw select_interrupted() by default
Author:
Rick L Vinyard Jr

Member Typedef Documentation


Constructor & Destructor Documentation

Conexus::FileDescriptor::FileDescriptor ( int  fd = -1,
bool  close_on_destruct = true 
) [protected]

Conexus::FileDescriptor::~FileDescriptor (  )  [virtual]


Member Function Documentation

void Conexus::FileDescriptor::close ( bool  force = false  )  throw ( close_exception ) [virtual]

Closes the Endpoint object by closing the member file descriptor.

If the object is already closed will return without attempting to close.

Implements Conexus::Endpoint.

Reimplemented in Conexus::Pipe, Conexus::Socket, and Conexus::TTY.

References Conexus::throw_close_exception().

Referenced by Conexus::TTY::close(), and ~FileDescriptor().

int Conexus::FileDescriptor::fd (  )  throw () [virtual]

Base class method returning the raw file descriptor.

References m_fd.

bool Conexus::FileDescriptor::is_blocking (  ) 

Data Conexus::FileDescriptor::read_data ( size_t  s,
Timeout  to 
) throw ( read_exception ) [protected, virtual]

bool Conexus::FileDescriptor::set_blocking ( bool  block = true  ) 

size_t Conexus::FileDescriptor::write_data ( const Data  data,
Timeout  to 
) throw ( write_exception ) [protected, virtual]


Member Data Documentation


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

Generated on Wed Jul 8 15:51:20 2009 for conexus by doxygen 1.5.8