InMemory Class Reference

#include <InStreams.h>

Inheritance diagram for InMemory:

PhysicalInStream InStream< InMemory, InBinary > InStream< InMemory, InConfig > InStream< InMemory, InText > InBinaryMemory InConfigMemory InTextMemory List of all members.

Public Member Functions

 InMemory ()
virtual bool exists () const
virtual bool getEof () const

Protected Member Functions

void open (const void *mem, unsigned size=0)
virtual void readFromStream (void *p, int size)
virtual void skipInStream (int size)

Private Attributes

const char * memory
const char * end

Detailed Description

An PhysicalInStream that reads the data from a memory region.

Definition at line 704 of file InStreams.h.


Constructor & Destructor Documentation

InMemory::InMemory (  )  [inline]

Default constructor

Definition at line 712 of file InStreams.h.


Member Function Documentation

virtual bool InMemory::exists (  )  const [inline, virtual]

The function states whether the stream actually exists.

Returns:
Does the stream exist? This is always true for memory streams.

Reimplemented from PhysicalInStream.

Definition at line 718 of file InStreams.h.

References memory.

virtual bool InMemory::getEof (  )  const [inline, virtual]

The function states whether the end of the file has been reached. It will only work if the correct size of the memory block was specified during the construction of the stream.

Returns:
End of file reached?

Implements PhysicalInStream.

Definition at line 726 of file InStreams.h.

References end, and memory.

void InMemory::open ( const void *  mem,
unsigned  size = 0 
) [inline, protected]

Opens the stream.

Parameters:
mem The address of the memory block from which is read.
size The size of the memory block. It is only used to implement the function eof(). If the size is not specified, eof() will always return true, but reading from the stream is still possible.

Definition at line 738 of file InStreams.h.

References end, and memory.

Referenced by InBinaryMemory::InBinaryMemory(), InConfigMemory::InConfigMemory(), and InTextMemory::InTextMemory().

void InMemory::readFromStream ( void *  p,
int  size 
) [protected, virtual]

The function reads a number of bytes from memory.

Parameters:
p The address the data is written to. Note that p must point to a memory area that is at least "size" bytes large.
size The number of bytes to be read.

Implements PhysicalInStream.

Definition at line 147 of file InStreams.cpp.

References memory.

virtual void InMemory::skipInStream ( int  size  )  [inline, protected, virtual]

The function skips a number of bytes.

Parameters:
size The number of bytes to be skipped.

Reimplemented from PhysicalInStream.

Definition at line 754 of file InStreams.h.

References memory.


Member Data Documentation

const char * InMemory::end [private]

Points to the end of the memory block.

Definition at line 707 of file InStreams.h.

Referenced by getEof(), and open().

const char* InMemory::memory [private]

Points to the next byte to read from memory.

Definition at line 707 of file InStreams.h.

Referenced by exists(), getEof(), open(), readFromStream(), and skipInStream().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:38:36 2006 for DT2005.panorama by  doxygen 1.4.7