Public Member Functions | Static Public Member Functions | List of all members
Celartem::NullStream Class Reference

#include <cel_stream.h>

Inheritance diagram for Celartem::NullStream:
Inheritance graph
[legend]

Public Member Functions

virtual size_t readBytes (void *buffer, size_t inSize, bool wouldBlock=false)
 
virtual void writeBytes (const void *buffer, size_t inSize)
 
virtual void flushBuffer ()
 
virtual bool isEof () const
 
virtual void lock () const
 
virtual void unlock () const
 
- Public Member Functions inherited from Celartem::Stream
virtual size_t duplicateStream (Stream *inStream, size_t inBufferSize=1024, DuplicateStreamCallback inCallback=NULL, void *inCallbackContext=NULL)
 
virtual size_t duplicateStreamBytes (Stream *inStream, size_t inMaximumByteSize, size_t inBufferSize=1024, DuplicateStreamCallback inCallback=NULL, void *inCallbackContext=NULL)
 
- Public Member Functions inherited from Celartem::Referable
 Referable ()
 
void addRef () const
 
void releaseRef () const
 
size_t getReferenceCount () const
 

Static Public Member Functions

static AutoPtr< NullStreamcreate ()
 
- Static Public Member Functions inherited from Celartem::Referable
static void dumpDbgAllRefCount ()
 

Detailed Description

This stream class works as if it were a null device.
This class only accepts writeBytes method calls.

Member Function Documentation

static AutoPtr<NullStream> Celartem::NullStream::create ( )
inlinestatic

This method creates an instance of NullStream class.

virtual void Celartem::NullStream::flushBuffer ( )
inlinevirtual

flushBuffer is provided for the purpose of flushing buffered stream.

Implements Celartem::Stream.

virtual bool Celartem::NullStream::isEof ( ) const
inlinevirtual

isEof return true if the stream pointer has already reached the end of stream; you should not rely on readBytes to determine the end of stream.

Returns
true if the file pointer reachs EOF, otherwise false.

Implements Celartem::Stream.

virtual void Celartem::NullStream::lock ( ) const
inlinevirtual

The actual meanings of this method is defined in the derived class.

Implements Celartem::Lockable.

virtual size_t Celartem::NullStream::readBytes ( void *  buffer,
size_t  inSize,
bool  wouldBlock = false 
)
inlinevirtual

readBytes tries to read bytes from the stream. If wouldBlock is false, readBytes reads the data currenly available and returned immediately; the returned value indicates the bytes actually read and it is no more than inSize. If wouldBlock is true, it blocks until it reads all the bytes specified by inSize parameter. If the stream is potentially read-only and it seems there're no chance to read the bytes specified by inSize, it throws some exception. In the case it throws some exception, the contents in the buffer is invalid and the position of stream pointer is not defined; they are implementation specific.

Parameters
bufferPointer to a buffer that receives the data.
inSizeMaximum size to read; readBytes reads data no more than the number of bytes specified by inSize.
wouldBlockIt specifies it blocks until all bytes comes or not.
Returns
readBytes returns the number of bytes read by this call.

Implements Celartem::Stream.

virtual void Celartem::NullStream::unlock ( ) const
inlinevirtual

The actual meanings of this method is defined in the derived class.

Implements Celartem::Lockable.

virtual void Celartem::NullStream::writeBytes ( const void *  buffer,
size_t  inSize 
)
inlinevirtual

writeBytes tries to write the data to the stream. If it could not write all the bytes specified by inSize, it throws some exception, which describes the status. In the case it throws some exception, the position of stream pointer is not defined; it is implementation specific.

Parameters
bufferPointer to the buffer that holds the data to be sent.
inSizethe number of bytes to be sent.

Implements Celartem::Stream.


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

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:06.
Cuminas Logo