libdap::fdinbuf Class Reference

#include <fdiostream.h>

Inheritance diagram for libdap::fdinbuf:

Inheritance graph
[legend]
Collaboration diagram for libdap::fdinbuf:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 fdinbuf (int _fd, bool close)
virtual ~fdinbuf ()

Protected Member Functions

virtual int underflow ()

Protected Attributes

char buffer [bufferSize]
bool close
int fd

Static Protected Attributes

static const int bufferSize = 4096
static const int putBack = 128

Detailed Description

fdintbuf is a stream buffer specialization designed specifically for files that are referenced using a file descriptor. This class implements a 4k buffer for data and optionally closes the file when the buffer is deleted. The stream buffer has 128 characters of 'put back' space.

Note:
Instead of using this class, use fdistream.
See also:
fdistream

Definition at line 99 of file fdiostream.h.


Constructor & Destructor Documentation

libdap::fdinbuf::fdinbuf ( int  _fd,
bool  _close 
)

Make a stream buffer for reading from an open file using its file descriptor.

Parameters:
_fd The open file descriptor
_close If true, close the open file when deleting the stream buffer. False by default.
See also:
fdistream

Definition at line 159 of file fdiostream.cc.

References buffer, and putBack.

libdap::fdinbuf::~fdinbuf (  )  [virtual]

Close the file if specified.

Definition at line 168 of file fdiostream.cc.

References close, and fd.


Member Function Documentation

int libdap::fdinbuf::underflow (  )  [protected, virtual]

Insert new characters into the buffer

Definition at line 175 of file fdiostream.cc.

References buffer, bufferSize, DBG, fd, and putBack.


Member Data Documentation

char libdap::fdinbuf::buffer[bufferSize] [protected]

Definition at line 105 of file fdiostream.h.

Referenced by fdinbuf(), and underflow().

const int libdap::fdinbuf::bufferSize = 4096 [static, protected]

Definition at line 103 of file fdiostream.h.

Referenced by underflow().

bool libdap::fdinbuf::close [protected]

Definition at line 102 of file fdiostream.h.

Referenced by ~fdinbuf().

int libdap::fdinbuf::fd [protected]

Definition at line 101 of file fdiostream.h.

Referenced by underflow(), and ~fdinbuf().

const int libdap::fdinbuf::putBack = 128 [static, protected]

Definition at line 104 of file fdiostream.h.

Referenced by fdinbuf(), and underflow().


The documentation for this class was generated from the following files:
Generated on Wed Feb 10 16:10:28 2010 for libdap++ by  doxygen 1.4.7