#include <IntStream.h>
Inheritance diagram for PLearn::FilesIntStream:
Public Member Functions | |
FilesIntStream (int nfiles, const char *files[]) | |
virtual void | seek (long position) |
move to given position | |
virtual int | next () |
return next available int from the stream and increment position | |
virtual int | current () |
return next available int from the stream | |
virtual long | size () |
total length of the stream | |
virtual void | reopen () |
virtual | ~FilesIntStream () |
Protected Member Functions | |
FilesIntStream (FilesIntStream &x) | |
disallow a copy | |
void | read_current () |
read from current current_file at next_pos_in_current_file into current_value | |
Protected Attributes | |
int | n_files |
number of files | |
const char ** | file_names |
names of each of the files; | |
FILE ** | fp |
pointers to each of the files; | |
int | current_file |
between 0 and n_files-1 | |
int | next_pos_in_current_file |
position within current file | |
int * | sizes |
int | total_size |
sum_i sizes[i] | |
int | current_value |
just read at current position |
|
disallow a copy
Definition at line 133 of file IntStream.h. References PLERROR. |
|
Definition at line 123 of file IntStream.cc. References file_names, fp, n_files, PLERROR, read_current(), sizes, and total_size. |
|
Definition at line 237 of file IntStream.cc. |
|
return next available int from the stream
Reimplemented from PLearn::IntStream. Definition at line 226 of file IntStream.cc. References current_value. |
|
return next available int from the stream and increment position
Reimplemented from PLearn::IntStream. Definition at line 218 of file IntStream.cc. References current_value, and read_current(). |
|
read from current current_file at next_pos_in_current_file into current_value
Definition at line 157 of file IntStream.cc. References current_file, current_value, file_names, fp, n_files, next_pos_in_current_file, PLERROR, PLearn::reverse_int(), seek(), sizes, and total_size. Referenced by FilesIntStream(), next(), and seek(). |
|
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 from PLearn::IntStream. Definition at line 142 of file IntStream.cc. References file_names, fp, n_files, PLERROR, and seek(). |
|
move to given position
Reimplemented from PLearn::IntStream. Definition at line 195 of file IntStream.cc. References current_file, file_names, fp, n_files, next_pos_in_current_file, PLERROR, read_current(), sizes, and total_size. Referenced by read_current(), and reopen(). |
|
total length of the stream
Reimplemented from PLearn::IntStream. Definition at line 232 of file IntStream.cc. References total_size. |
|
between 0 and n_files-1
Definition at line 127 of file IntStream.h. Referenced by read_current(), and seek(). |
|
just read at current position
Definition at line 131 of file IntStream.h. Referenced by current(), next(), and read_current(). |
|
names of each of the files;
Definition at line 125 of file IntStream.h. Referenced by FilesIntStream(), read_current(), reopen(), and seek(). |
|
pointers to each of the files;
Definition at line 126 of file IntStream.h. Referenced by FilesIntStream(), read_current(), reopen(), seek(), and ~FilesIntStream(). |
|
number of files
Definition at line 124 of file IntStream.h. Referenced by FilesIntStream(), read_current(), reopen(), seek(), and ~FilesIntStream(). |
|
position within current file
Definition at line 128 of file IntStream.h. Referenced by read_current(), and seek(). |
|
Definition at line 129 of file IntStream.h. Referenced by FilesIntStream(), read_current(), seek(), and ~FilesIntStream(). |
|
sum_i sizes[i]
Definition at line 130 of file IntStream.h. Referenced by FilesIntStream(), read_current(), seek(), and size(). |