BIE |
BIE::RecordStreamFilter Class ReferenceRecordStreamFilter objects can insert new fields into a stream by performing some computation on existing fields. More...
Inheritance diagram for BIE::RecordStreamFilter:
![]()
Collaboration diagram for BIE::RecordStreamFilter:
![]()
Detailed DescriptionRecordStreamFilter objects can insert new fields into a stream by performing some computation on existing fields.This class defines the interface to all filters (and implements much of the functionality). Using filters: Once a filter has been created, the filter must be hooked up to a stream. This involves the following steps: -- Connection The inputs to the filter are connected to fields in the stream the filter is going to be attached to using the connect() methods. Inputs can be either a scalar or a set - meaning that one stream field, or one or more stream fields can be connected respectively. If the filter input is a single field and is already connected the existing connection is overwritten. If the filter input field is a set field then the stream field is added to the set (unless already in it). Filter inputs are typed and the type must match with the stream field being connected. Connections can be deleted using the disconnect() methods. Stream fields can be specified by name or index, and filter inputs also by name or index (starting at 1). -- Output field renaming Filters give default names to their output fields, but these might clash with field names in the stream being filtered (for instance, if the same filter was used more than once on the same stream). Output fields are renamed using the renameOutputField() methods. -- Attaching to the stream The final stage attaches the stream to the filter - this is done using the filterWith() methods in the stream classes. -- Writing a filter class Subclasses need only implement code which defines the input and output, implements a constructor, and performs the computation. -- Defining input and output Filter input and output is defined using arrays of structures that are terminated with a NULL structure (all fields set to zero). For each input, the filter class must specify the name, the BasicType, and the format (set or scalar, where true corresponds to set). For each output, the filter class should specify the default name of the output, and the BasicType. The arrays defining the input and output must exist for the lifetime of the filter, since they are used (not copied) by this class. If the inputs and outputs do not vary, then these arrays should be both const and static* -- Writing a constructor: All subclass constructors must call the initialize() method in the constructor. Three variables are passed to this method - the array describing the input to the filter, the array describing the output from the filter, and the stream which is to be filtered. -- Performing the computation. The computation should set the values of the filter output fields. The methods set<Type>Output will set the value of output fields. To read input field values, use the get<Type>Input methods. When an input is a set input, then the index of the item in the set must must also be specified. Member Function Documentation
Connects a field from the incoming stream to an input of the filter. The first argument is the name of the field in the incoming stream, and the second is the name of the field in the filter.
Connects a field from the incoming stream to an input of the filter. The first argument is the index of the field in the incoming stream, and the second is the name of the field in the filter.
Connects a field from the incoming stream to an input of the filter. The first argument is the name of the field in the incoming stream, and the second is the index of the field in the filter.
Connects a field from the incoming stream to an input of the filter. The first argument is the index of the field in the incoming stream, and the second is the index of the field in the filter.
Disconnects a stream field from a filter input. 1st argument: stream field name, 2nd argument: filter input name.
Disconnects a stream field from a filter input. 1st argument: stream field index, 2nd argument: filter input name.
Disconnects a stream field from a filter input. 1st argument: stream field name, 2nd argument: filter input index.
Disconnects a stream field from a filter input. 1st argument: stream field index, 2nd argument: filter input index.
Renames an output field. Output fields are assigned default names which may have to be changed to aboid clashes with the stream input. 1st argument: index of output field, 2nd argument: the new name.
Renames an output field. Output fields are assigned default names which may have to be changed to aboid clashes with the stream input. 1st argument: the old name, 2nd argument: the new name.
Returns the number of connections an input has (this can only be one or zero for scalars, but can be larger for set inputs).
Returns the number of connections an input has (this can only be one or zero for scalars, but can be larger for set inputs).
Returns true if the output field names of the filter clash with names in the stream type.
The default definition of a "useable filter" is: the filter is not already being used, all inputs are connected and output names do not clash. Certain filters might have more specific requirements, and they can override this method.
Called when new input is available by the inheriting stream, this fills the filter output buffers.
Implemented in BIE::AdditionFilter, BIE::SubtractionFilter, BIE::ProductFilter, BIE::DivisionFilter, BIE::PowerFilter, BIE::MPIStreamFilter, BIE::SumFilter, BIE::AverageFilter, BIE::StatisticsFilter, BIE::QuantileFilter, BIE::MaxFilter, BIE::MinFilter, BIE::PSanityFilter, BIE::RPhiFilter, BIE::AbsFilter, BIE::LogFilter, BIE::LogBaseNFilter, BIE::ScaleFilter, BIE::CosineFilter, BIE::SineFilter, BIE::MuFilter, and BIE::InverseMuFilter.
This puts a filter to use by attaching it to a stream. The filter must be in a useable state, with inputs connected, no name clashes etc.
Initialize: Called by subclasses (ie actual filters) to initialize variables in this class. The input and output specifications are arrays of structures terminated with a null record (all zero).
These methods get the value of a scalar filter input. Either the input name or input index can be used to specify the input field. An attempt to access a set input with these methods will result in a TypeException.
These methods get the value of a member of a set input. Either the input name or input index can be used to specify the input field. An attempt to access a scalar variable with these methods will result in a TypeException.
The documentation for this class was generated from the following file:
Send suggestions, questions, and feedback to WEINBERG at ASTRO dot UMASS dot EDU. Documentation generated at Fri Mar 26 00:35:13 2010 by
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||