BIE::RecordInputStream Class Reference
Record input streams are used to read a series of records from one or more sources.
More...
#include <RecordInputStream.h>
List of all members.
|
Public Member Functions |
| | ~RecordInputStream () |
| | Virtual destructor.
|
| virtual bool | nextRecord () |
| | Gets the next record from the input stream.
|
|
virtual bool | eos () |
| | Returns true if the end of this, or an inherited stream has been reached.
|
|
virtual bool | error () |
| | Returns true if an error has occured in this, or an inherited stream.
|
|
bool | isRootStream () |
| | Returns true if the stream is a root stream.
|
|
RecordInputStream * | deleteField (string fieldname) |
| | Produces a new stream with the specified field masked out.
|
|
RecordInputStream * | deleteField (int fieldindex) |
| | Produces a new stream with the specified field masked out.
|
| RecordInputStream * | deleteRange (int startfield, int endfield) |
| | Deletes a range of fields & inherits all other buffers from the existing stream.
|
| RecordInputStream * | joinWithStream (int position, RecordInputStream *stream) |
| | Stream Concatination.
|
| RecordInputStream * | selectFields (RecordType *selection) |
| | Creates a new stream containing only the fields specified by the type descriptor.
|
| RecordInputStream * | selectFields (vector< int > *selection) |
| | Creates a new input stream containing only the fields specified by the field indices.
|
| RecordInputStream * | selectFields (vector< string > *selection) |
| | Creates a new stream containing only the fields specified by the field names.
|
|
RecordInputStream * | renameField (string oldname, string newname) |
| | Renames the specified field.
|
|
RecordInputStream * | renameField (int fieldindex, string newname) |
| | Renames the specified field.
|
| RecordInputStream * | moveField (string fieldname, int newposition) |
| | Moves a field (specified by name) to a new position (specified by index) and "slides" the fields in between to fill in the vacated position.
|
| RecordInputStream * | moveField (int oldposition, int newposition) |
| | Moves a field (specified by index) to a new position (specified by index) and "slides" the fields in between to fill in the vacated position.
|
| RecordInputStream * | filterWith (int position, RecordStreamFilter *filter) |
| | Pipes the input through a filter which can add new fields based on the values of the fields in the existing stream.
|
|
virtual string | toString () |
| | Returns a string representation of the stream.
|
|
These methods return the value contained in the buffer.
The type of the field must match the type required by the method and the buffer must have a value.
|
|
string | getStringValue (int fieldindex) |
|
int | getIntValue (int fieldindex) |
|
double | getRealValue (int fieldindex) |
|
bool | getBoolValue (int fieldindex) |
|
string | getStringValue (string fieldname) |
|
int | getIntValue (string fieldname) |
|
double | getRealValue (string fieldname) |
|
bool | getBoolValue (string fieldname) |
|
vector< int > | getIntArrayValue (int fieldindex) |
|
vector< double > | getRealArrayValue (int fieldindex) |
|
vector< bool > | getBoolArrayValue (int fieldindex) |
Protected Member Functions |
|
void | noLongerRoot () |
| | Called when another stream inherits part of the buffer of this stream.
|
| void | setAsRoot () |
| | Called when a stream becomes a root stream (at creation time or after an inheriting stream is deleted).
|
Protected Attributes |
|
vector< RecordInputStream * > | ris_inherited |
| | A list of the streams this stream inherits.
|
Friends |
|
class | boost::serialization::access |
Detailed Description
Record input streams are used to read a series of records from one or more sources.
New record input streams can be created by reading from a data source (e.g. a file, or a network socket), by concatenating two streams, and by inheriting and modifying an existing stream.
Inheriting streams constructs an implicit tree structure, in which the leaves are raw data sources, nodes with two children are where streams are combined, and nodes with one child modify the stream in some way. Data is always pulled from the 'root' stream in this tree - this is done by recursively calling the nextRecord() method (calls recurse in a depth first manner). Requiring that a node is only inherited at most once (each node has at most one parent) means that only one node controls the flow of data (trees branch towards the source).
This class implements all operations on streams - field deletion, filtering, selection, etc. All reader classes are subclasses of this class.
Constructor & Destructor Documentation
| BIE::RecordInputStream::~RecordInputStream |
( |
|
) |
|
Virtual destructor.
Frees memory and makes inherited streams root streams again.
Member Function Documentation
| virtual bool BIE::RecordInputStream::nextRecord |
( |
|
) |
[virtual] |
| RecordInputStream* BIE::RecordInputStream::deleteRange |
( |
int |
startfield, |
|
|
int |
endfield | |
|
) |
| | |
Deletes a range of fields & inherits all other buffers from the existing stream.
Stream Concatination.
The stream is "inserted" into the existing stream at the specified position.
Creates a new stream containing only the fields specified by the type descriptor.
All the fields in the type descriptor must be present for this call to succeed. Both field name and field type must match.
| RecordInputStream* BIE::RecordInputStream::selectFields |
( |
vector< int > * |
selection |
) |
|
Creates a new input stream containing only the fields specified by the field indices.
All indices must be within the bounds of the buffer. No duplicate indices are allowed.
| RecordInputStream* BIE::RecordInputStream::selectFields |
( |
vector< string > * |
selection |
) |
|
Creates a new stream containing only the fields specified by the field names.
A NoSuchFieldException is thrown if a name is not present in the buffer type. No duplicate names are allowed.
| RecordInputStream* BIE::RecordInputStream::moveField |
( |
string |
fieldname, |
|
|
int |
newposition | |
|
) |
| | |
Moves a field (specified by name) to a new position (specified by index) and "slides" the fields in between to fill in the vacated position.
| RecordInputStream* BIE::RecordInputStream::moveField |
( |
int |
oldposition, |
|
|
int |
newposition | |
|
) |
| | |
Moves a field (specified by index) to a new position (specified by index) and "slides" the fields in between to fill in the vacated position.
Pipes the input through a filter which can add new fields based on the values of the fields in the existing stream.
The filter must be "useable".
| void BIE::RecordInputStream::setAsRoot |
( |
|
) |
[protected] |
Called when a stream becomes a root stream (at creation time or after an inheriting stream is deleted).
The documentation for this class was generated from the following file: