Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

NullBuffer Class Reference

#include <nullbuffer.hpp>

Inheritance diagram for NullBuffer:

Inheritance graph
[legend]
Collaboration diagram for NullBuffer:

Collaboration graph
[legend]
List of all members.

Detailed Description

Implements a "black hole" buffer which does not retain data. This buffer is used when a buffer is required, but its data are not used.

Definition at line 53 of file nullbuffer.hpp.

Public Methods

 NullBuffer ()
 Constructor. Created a null buffer.

 NullBuffer (const char *p_cFileName, bool p_boolReadOnly=false)
 Constructor. Created a null buffer.

 ~NullBuffer ()
 Destructor.

XMLStreamBufferoperator<< (const char *p_cData)
 Writes data to the buffer.

XMLStreamBufferoperator<< (XMLStreamBuffer &p_pXMLStreamBuffer)
 Transfers data from the given buffer.

XMLStreamBufferoperator>> (XMLStreamBuffer &p_pXMLStreamBuffer)
 Transfers data to the given buffer.

void write (const void *p_bData, int p_intSize)
 Writes raw data to the buffer.

void flush ()
 Empties the buffer.

void * data ()
 Returns a copy of buffer's data.

int length ()
 Returns a the lenght of buffer's data.

InputSource * getInputSource ()
 Returns an input source which uses buffer's data.

const char * getName ()
 Returns a unique name for the buffer.

void sleep ()
 Set the sleep mode for the buffer. Indicates to the buffer that it can release some of the ressources it uses.


Constructor & Destructor Documentation

BEGIN_XDFLENGINE_NS NullBuffer::NullBuffer  
 

Constructor. Created a null buffer.

Definition at line 52 of file nullbuffer.cpp.

References DEBUG_CREATE.

NullBuffer::NullBuffer const char *    p_cFileName,
bool    p_boolReadOnly = false
 

Constructor. Created a null buffer.

Parameters:
p_cFileName (const char*) name of the file to use
p_boolReadOnly (bool) ? read only ?

Definition at line 60 of file nullbuffer.cpp.

References DEBUG_CREATE.

NullBuffer::~NullBuffer  
 

Destructor.

Definition at line 68 of file nullbuffer.cpp.

References DEBUG_DEL.


Member Function Documentation

void * NullBuffer::data  
 

Returns a copy of buffer's data.

Remarks:
The data blocks returned by this function must be deallocated by its user.
Returns:
(void*) A pointer to a copy of buffer's data.

Definition at line 136 of file nullbuffer.cpp.

References DEBUG_FUNC.

void NullBuffer::flush  
 

Empties the buffer.

Remarks:
If the buffer is readonly, nothing is done.

Definition at line 128 of file nullbuffer.cpp.

References DEBUG_FUNC.

InputSource * NullBuffer::getInputSource  
 

Returns an input source which uses buffer's data.

Remarks:
The input sources object returned by this function must be deallocated by its user.
Returns:
(InputSource*) A pointer to a InputSource object.

Definition at line 163 of file nullbuffer.cpp.

References DEBUG_FUNC.

const char * NullBuffer::getName  
 

Returns a unique name for the buffer.

Returns:
(const char* ) Buffer's name.

Definition at line 76 of file nullbuffer.cpp.

References DEBUG_FUNC.

int NullBuffer::length  
 

Returns a the lenght of buffer's data.

Returns:
(int) Data length.

Definition at line 153 of file nullbuffer.cpp.

References DEBUG_FUNC.

XMLStreamBuffer & NullBuffer::operator<< XMLStreamBuffer   p_pXMLStreamBuffer
 

Transfers data from the given buffer.

Parameters:
p_pXMLStreamBuffer (XMLStreamBuffer) Buffer to transfer data from.
Returns:
(XMLStreamBuffer&) self.

Definition at line 95 of file nullbuffer.cpp.

References DEBUG_FUNC.

XMLStreamBuffer & NullBuffer::operator<< const char *    p_cData
 

Writes data to the buffer.

Parameters:
p_cData (const char*) char data to write.
Returns:
(XMLStreamBuffer&) self.

Reimplemented from XMLStreamConsumer.

Definition at line 86 of file nullbuffer.cpp.

References DEBUG_FUNC.

XMLStreamBuffer & NullBuffer::operator>> XMLStreamBuffer   p_pXMLStreamBuffer
 

Transfers data to the given buffer.

Parameters:
p_pXMLStreamBuffer (XMLStreamBuffer) Buffer to transfer data to.
Returns:
(XMLStreamBuffer&) self.

Definition at line 105 of file nullbuffer.cpp.

References DEBUG_FUNC.

void NullBuffer::sleep  
 

Set the sleep mode for the buffer. Indicates to the buffer that it can release some of the ressources it uses.

Definition at line 120 of file nullbuffer.cpp.

References DEBUG_FUNC.

void NullBuffer::write const void *    p_bData,
int    p_intSize
 

Writes raw data to the buffer.

Parameters:
p_bData (const void*) bin data to write.
p_intSize (int) size of the data to write.

Definition at line 112 of file nullbuffer.cpp.

References DEBUG_FUNC.


The documentation for this class was generated from the following files:
Generated on Sat Oct 4 13:24:27 2003 for XDFLengine by doxygen1.3-rc2