PLearn 0.1
|
#include <IntStream.h>
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 |
Definition at line 58 of file IntStream.h.
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.
{}
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; }
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.
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.
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; }
long PLearn::IntStream::pos [protected] |
Definition at line 61 of file IntStream.h.
Referenced by PLearn::FilesIntStream::read_current(), PLearn::FilesIntStream::reopen(), and PLearn::FilesIntStream::seek().