casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casa::TBFilterRule Class Reference

Rule that can be used to filter rows based upon field values. More...

#include <TBFilterRules.qo.h>

Public Member Functions

 TBFilterRule (casacore::String field, tb::Comparator comparator, TBData *value, TBData *value2=NULL, bool isNot=false, bool anyField=false)
 Constructor that takes the rule parameters. More...
 
 ~TBFilterRule ()
 
casacore::String getField ()
 Returns the field this rule applies to, or blank if it applies to any field. More...
 
tb::Comparator getComparator ()
 Returns this rule's comparator. More...
 
TBDatagetValue ()
 Returns this rule's value. More...
 
TBDatagetValue2 ()
 Returns this rule's second value, or blank if it doesn't have one. More...
 
bool getIsNot ()
 Returns true if this rule is negated (i.e., "not equal" rather than "equal"), false otherwise. More...
 
bool getAnyField ()
 Returns true if this rule applies to any field, false otherwise. More...
 
bool equals (TBFilterRule *r)
 Returns true if this rule is equal to the given rule, false otherwise. More...
 
int rowPasses (TBTable *table, int row)
 Checks the given row in the given table. More...
 

Private Member Functions

int anyFieldPasses (TBTable *table, int row)
 Checks all fields in the given row. More...
 

Private Attributes

casacore::String field
 This rule's field. More...
 
tb::Comparator comparator
 This rule's comparator. More...
 
TBDatavalue
 This rule's value. More...
 
TBDatavalue2
 This rule's second value. More...
 
bool isNot
 Indicates whether this rule is negated or not. More...
 
bool anyField
 Indicates whether this rule applies to any field or not. More...
 

Detailed Description

Rule that can be used to filter rows based upon field values.

Synopsis

A TBFilterRule is a single rule that consists of a field, a Comparator, and the rule parameters. A rule consists of one comparator and at least one value. A rule can be negated (i.e., "not equal"), or applied to any field (i.e., any field with a value > 5).

Definition at line 54 of file TBFilterRules.qo.h.

Constructor & Destructor Documentation

casa::TBFilterRule::TBFilterRule ( casacore::String  field,
tb::Comparator  comparator,
TBData value,
TBData value2 = NULL,
bool  isNot = false,
bool  anyField = false 
)

Constructor that takes the rule parameters.

value should be the value being compared against; value2 can only be NULL if the comparator only takes one argument. isNot should be true for negated rules, false otherwise. anyField should be true if the rule applies to any field, false otherwise. The rule "owns" value and value2 in that, upon deletion, they are deleted as well.

casa::TBFilterRule::~TBFilterRule ( )

Member Function Documentation

int casa::TBFilterRule::anyFieldPasses ( TBTable table,
int  row 
)
private

Checks all fields in the given row.

If any of the fields pass, the index of the first field to pass is returned; otherwise, -1 is returned.

bool casa::TBFilterRule::equals ( TBFilterRule r)

Returns true if this rule is equal to the given rule, false otherwise.

bool casa::TBFilterRule::getAnyField ( )

Returns true if this rule applies to any field, false otherwise.

tb::Comparator casa::TBFilterRule::getComparator ( )

Returns this rule's comparator.

casacore::String casa::TBFilterRule::getField ( )

Returns the field this rule applies to, or blank if it applies to any field.

bool casa::TBFilterRule::getIsNot ( )

Returns true if this rule is negated (i.e., "not equal" rather than "equal"), false otherwise.

TBData* casa::TBFilterRule::getValue ( )

Returns this rule's value.

TBData* casa::TBFilterRule::getValue2 ( )

Returns this rule's second value, or blank if it doesn't have one.

int casa::TBFilterRule::rowPasses ( TBTable table,
int  row 
)

Checks the given row in the given table.

If the row passes, the index of the first field to pass is returned; if the row does not pass, -1 is returned.

Member Data Documentation

bool casa::TBFilterRule::anyField
private

Indicates whether this rule applies to any field or not.

Definition at line 114 of file TBFilterRules.qo.h.

tb::Comparator casa::TBFilterRule::comparator
private

This rule's comparator.

Definition at line 102 of file TBFilterRules.qo.h.

casacore::String casa::TBFilterRule::field
private

This rule's field.

Definition at line 99 of file TBFilterRules.qo.h.

bool casa::TBFilterRule::isNot
private

Indicates whether this rule is negated or not.

Definition at line 111 of file TBFilterRules.qo.h.

TBData* casa::TBFilterRule::value
private

This rule's value.

Definition at line 105 of file TBFilterRules.qo.h.

TBData* casa::TBFilterRule::value2
private

This rule's second value.

Definition at line 108 of file TBFilterRules.qo.h.


The documentation for this class was generated from the following file: