libdap::fdoutbuf Class Reference

#include <fdiostream.h>

Inheritance diagram for libdap::fdoutbuf:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 fdoutbuf (int _fd, bool _close)
virtual ~fdoutbuf ()

Protected Member Functions

int flushBuffer ()
virtual int overflow (int c)
virtual int sync ()
virtual std::streamsize xsputn (const char *s, std::streamsize num)

Protected Attributes

char buffer [bufferSize]
bool close
int fd

Static Protected Attributes

static const int bufferSize = 4096

Detailed Description

fdoutbuf 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.

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

Definition at line 50 of file fdiostream.h.


Constructor & Destructor Documentation

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

Make an instance of fdoutbuf. To write to a file using an open file descriptor, use fdostream instead.

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

Definition at line 44 of file fdiostream.cc.

References buffer, and bufferSize.

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

When deleting the stream buffer, be sure to call sync(). Close the associated file if specified.

Definition at line 52 of file fdiostream.cc.

References close, fd, and sync().

Here is the call graph for this function:


Member Function Documentation

int libdap::fdoutbuf::flushBuffer (  )  [protected]

Definition at line 60 of file fdiostream.cc.

References buffer.

Referenced by overflow(), and sync().

int libdap::fdoutbuf::overflow ( int  c  )  [protected, virtual]

Buffer full, write c and all previous characters

Definition at line 71 of file fdiostream.cc.

References flushBuffer().

Here is the call graph for this function:

int libdap::fdoutbuf::sync (  )  [protected, virtual]

synchronize with file/destination

Definition at line 87 of file fdiostream.cc.

References flushBuffer().

Referenced by ~fdoutbuf().

Here is the call graph for this function:

std::streamsize libdap::fdoutbuf::xsputn ( const char *  s,
std::streamsize  num 
) [protected, virtual]

write multiple characters

Definition at line 97 of file fdiostream.cc.

References fd.


Member Data Documentation

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

Definition at line 55 of file fdiostream.h.

Referenced by fdoutbuf(), and flushBuffer().

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

Definition at line 54 of file fdiostream.h.

Referenced by fdoutbuf().

bool libdap::fdoutbuf::close [protected]

Definition at line 53 of file fdiostream.h.

Referenced by ~fdoutbuf().

int libdap::fdoutbuf::fd [protected]

Definition at line 52 of file fdiostream.h.

Referenced by xsputn(), and ~fdoutbuf().


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