PLearn 0.1
Public Member Functions | Protected Attributes
PLearn::IntStream Class Reference

#include <IntStream.h>

Inheritance diagram for PLearn::IntStream:
Inheritance graph
[legend]
Collaboration diagram for PLearn::IntStream:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 IntStream (int p=0)
virtual void seek (long position)
 move to given position
virtual int next ()
 return currently available int from the stream (at currente position) and THEN increment position to NEXT item
virtual int current ()
 return next available int from the stream
virtual long size ()
 total length of the stream
virtual int position ()
 current position (= size if we are past the last read element)
virtual long remaining ()
 remaining int's (INCLUDING the current one), = 0 if none left to read
virtual void reopen ()
virtual ~IntStream ()

Protected Attributes

long pos

Detailed Description

Definition at line 58 of file IntStream.h.


Constructor & Destructor Documentation

PLearn::IntStream::IntStream ( int  p = 0) [inline]

Definition at line 64 of file IntStream.h.

: pos(p) {}
virtual PLearn::IntStream::~IntStream ( ) [inline, virtual]

Definition at line 91 of file IntStream.h.

{}

Member Function Documentation

virtual int PLearn::IntStream::current ( ) [inline, virtual]

return next available int from the stream

Reimplemented in PLearn::FilesIntStream, and PLearn::InMemoryIntStream.

Definition at line 74 of file IntStream.h.

{ return 0; }
virtual int PLearn::IntStream::next ( ) [inline, virtual]

return currently available int from the stream (at currente position) and THEN increment position to NEXT item

Reimplemented in PLearn::FilesIntStream, and PLearn::InMemoryIntStream.

Definition at line 71 of file IntStream.h.

Referenced by PLearn::InMemoryIntStream::InMemoryIntStream().

{ return 0; }

Here is the caller graph for this function:

virtual int PLearn::IntStream::position ( ) [inline, virtual]

current position (= size if we are past the last read element)

Definition at line 80 of file IntStream.h.

{ return pos; }
virtual long PLearn::IntStream::remaining ( ) [inline, virtual]

remaining int's (INCLUDING the current one), = 0 if none left to read

Definition at line 83 of file IntStream.h.

{ return size()-position(); }
virtual void PLearn::IntStream::reopen ( ) [inline, virtual]

Re-open all the file pointers and seek(position()). This is useful when a forked child process wants access to the same stream without interfering with parent

Reimplemented in PLearn::FilesIntStream.

Definition at line 89 of file IntStream.h.

{}
virtual void PLearn::IntStream::seek ( long  position) [inline, virtual]

move to given position

Reimplemented in PLearn::FilesIntStream, and PLearn::InMemoryIntStream.

Definition at line 67 of file IntStream.h.

References PLERROR.

{ if (position!=0) PLERROR("IntStream::position should be 0"); }
virtual long PLearn::IntStream::size ( ) [inline, virtual]

total length of the stream

Reimplemented in PLearn::FilesIntStream, and PLearn::InMemoryIntStream.

Definition at line 77 of file IntStream.h.

Referenced by PLearn::InMemoryIntStream::InMemoryIntStream().

{ return 0; }

Here is the caller graph for this function:


Member Data Documentation

long PLearn::IntStream::pos [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines