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

IReader Struct Reference

Inheritance diagram for IReader:

AbstractReader Reader TextReader EndianReader HttpReader List of all members.

Public Types

typedef opShr get

Public Member Functions

IReader opShr (inout bool x)
IReader opShr (inout byte x)
IReader opShr (inout ubyte x)
IReader opShr (inout short x)
IReader opShr (inout ushort x)
IReader opShr (inout int x)
IReader opShr (inout uint x)
IReader opShr (inout long x)
IReader opShr (inout ulong x)
IReader opShr (inout float x)
IReader opShr (inout double x)
IReader opShr (inout real x)
IReader opShr (inout char x)
IReader opShr (inout wchar x)
IReader opShr (inout dchar x)
IReader opShr (inout byte[] x)
IReader opShr (inout short[] x)
IReader opShr (inout int[] x)
IReader opShr (inout long[] x)
IReader opShr (inout ubyte[] x)
IReader opShr (inout ushort[] x)
IReader opShr (inout uint[] x)
IReader opShr (inout ulong[] x)
IReader opShr (inout float[] x)
IReader opShr (inout double[] x)
IReader opShr (inout real[] x)
IReader opShr (inout char[] x)
IReader opShr (inout wchar[] x)
IReader opShr (inout dchar[] x)
IReader opShr (IReadable x)
IReader push (uint size)
void wait ()
uint length ()
IBuffer getBuffer ()
void setAllocator (IArrayAllocator memory)
IArrayAllocator getAllocator ()
void setDecoder (IDecoder d)

Detailed Description

All reader instances should implement this interface.

Definition at line 95 of file IReader.d.


Member Typedef Documentation

typedef opShr get
 

Reimplemented in AbstractReader, and TextReader.

Definition at line 97 of file IReader.d.

Referenced by UString::VersionMango::read(), RollCall::read(), Payload::read(), Message::read(), InvalidatorPayload::read(), testClassIO(), testClassSerialization(), testCompositeIO(), VersionMango::testDecoder(), and testProtocol().


Member Function Documentation

IReader opShr inout bool  x  ) 
 

These are the basic reader methods

Reimplemented in AbstractReader.

IReader opShr inout byte  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout ubyte  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout short  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout ushort  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout int  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout uint  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout long  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout ulong  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout float  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout double  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout real  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout char  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout wchar  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout dchar  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout byte[]  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout short[]  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout int[]  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout long[]  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout ubyte[]  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout ushort[]  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout uint[]  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout ulong[]  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout float[]  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout double[]  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout real[]  x  ) 
 

Reimplemented in AbstractReader.

IReader opShr inout char[]  x  ) 
 

Reimplemented in AbstractReader, and TextReader.

IReader opShr inout wchar[]  x  ) 
 

Reimplemented in AbstractReader, and TextReader.

IReader opShr inout dchar[]  x  ) 
 

Reimplemented in AbstractReader, and TextReader.

IReader opShr IReadable  x  ) 
 

This is the mechanism used for binding arbitrary classes to the IO system. If a class implements IReadable, it can be used as a target for IReader get() operations. That is, implementing IReadable is intended to transform any class into an IReader adaptor for the content held therein.

Reimplemented in AbstractReader.

IReader push uint  size  ) 
 

Push the size (in bytes) to use for the next array-read. By default, array sizes are read from the input stream, so this is the means by which one may specify the size where the stream is not formatted in such a manner.

char[] x; int size; IReader reader; reader.push(size).get(x);

Reimplemented in AbstractReader.

void wait  ) 
 

Pause the current thread until some content arrives in the associated input buffer. This may stall forever.

Reimplemented in AbstractReader.

uint length  ) 
 

Return the size (byte count) of the subsequent data stream. This is typically read from the stream as a number, but may be provided by the client code via the push() method.

Reimplemented in AbstractReader.

IBuffer getBuffer  ) 
 

Return the buffer associated with this reader

Reimplemented in AbstractReader.

Referenced by VersionMango::StringDecoder::bind(), UString::VersionMango::UStringDecoder::read(), LineScanner::read(), and ReaderToken::read().

void setAllocator IArrayAllocator  memory  ) 
 

Set the allocator to use for array management. Arrays are always allocated by the IReader. That is, you cannot read data into an array slice (for example). Instead, a number of IArrayAllocator classes are available to manage memory allocation when reading array content.

By default, an IReader will allocate each array from the heap. You can change that behavior by calling this method with an IArrayAllocator of choice. For instance, there is a BufferAllocator which will slice an array directly from the buffer where possible. Also available is the record-oriented SliceAllocator, which slices memory from within a pre-allocated heap area, and should be reset by the client code after each record has been read (to avoid unnecessary growth).

See ArrayAllocator for more information.

Reimplemented in AbstractReader.

Referenced by VersionMango::testDecoder().

IArrayAllocator getAllocator  ) 
 

Reimplemented in AbstractReader.

Referenced by UString::VersionMango::read().

void setDecoder IDecoder  d  ) 
 

Bind an IDecoder to the writer. Decoders are intended to be used as a conversion mechanism between various character representations (encodings), or the translation of any data type from one representation to another. Each data type may be configured with a distinct decoder, covering all native types (15 in total).

An appropriate decoder set should be attached to each IReader, and thus be available for subsequent use. A raw binary implementation is attached by default (no encoding).

See module mango.icu.UMango for an example of decoder implementation -- those classes bind the ICU converters to this IO package.

Reimplemented in AbstractReader.

Referenced by VersionMango::testDecoder().


The documentation for this struct was generated from the following file:
Generated on Tue Jan 25 21:18:36 2005 for Mango by doxygen 1.3.6