libdap::D4FilterClause Class Reference

DAP4 filter clauses. More...

`#include <D4FilterClause.h>`

## Public Types

enum | ops { null = 0 , less = SCAN_LESS , greater = SCAN_GREATER , less_equal = SCAN_LESS_EQL , greater_equal = SCAN_GREATER_EQL , equal = SCAN_EQUAL , not_equal = SCAN_NOT_EQUAL , match = SCAN_REGEXP , map , ND }

## Public Member Functions

| D4FilterClause (const D4FilterClause &src)
| D4FilterClause (const ops op, D4RValue *arg1, D4RValue *arg2)
D4FilterClause & | operator= (const D4FilterClause &rhs)
bool | value ()
| Get the value of this relational expression. This version of value() will not work for clauses where one of the rvalues is a function call. This is not currently supported by the DAP4 specification, so it's probably no great loss.
bool | value (DMR &dmr)
| Get the value of this relational expression. This version of value() works for function clauses, although that's not supported by the syntax at this time.

## Friends

class | D4FilterClauseList

## Detailed Description

DAP4 filter clauses.

The DAP4 constraint expression provides a way to filter the values of Sequences (and possibly arrays and coverages, although those are still more ideas than anything at this point). This class holds the operator and operands of one DAP4 constraint's filter clause. The object is built during the parse phase of the constraint evaluation but is not evaluated until the data are sent or interned (read into the DAP4 variable object so that they can be used as input to some process other than directly being sent to a remote client).

For filter clauses that are to be applied to a Sequence, each D4RValue will either be a constant or a BaseType* that will reference one of the Sequences fields. The method 'value()' is effectively the evaluator for the clause and nominally reads values from the rvalue objects.

Note
  Potential optimization: Because Sequences might have an optimized representation as a STL vector of some built in types, there could be a value() method that takes a value and compares it to the clause's constant value using the supplied op.
  The 'ND' and 'map' ops are 'still just an idea' parts.

Definition at line 109 of file D4FilterClause.h.

## Member Enumeration Documentation

## ops

enum libdap::D4FilterClause::ops

Definition at line 111 of file D4FilterClause.h.

## Constructor & Destructor Documentation

## D4FilterClause() [1/2]

libdap::D4FilterClause::D4FilterClause | ( | const ops | op,
|  | D4RValue * | arg1,
|  | D4RValue * | arg2
| ) |  |

inline

Build a D4FilterClause. The clause will take ownership of the two pointer arguments and delete them.

Note
  When comparing an unsigned variable (UInt16) with a constant, at parse time (i.e., when the D4FilterClause is made) check that the constant is >= 0 and store it in an unsigned value at that time. This will avoid having to make the test repeatedly during filter evaluation.
  When parsing a constant, extract the value from the BaseType and store it in a local field, to avoid the overhead of extracting the value and looking up its type over an over.

Parameters

  op | The operator
  arg1 | The left-hand operand
  arg2 | The right-hand operand

Definition at line 163 of file D4FilterClause.h.

## D4FilterClause() [2/2]

libdap::D4FilterClause::D4FilterClause | ( | const D4FilterClause & | src | ) |

inline

Definition at line 169 of file D4FilterClause.h.

## ~D4FilterClause()

virtual libdap::D4FilterClause::~D4FilterClause | ( |  | ) |

inline virtual

Definition at line 180 of file D4FilterClause.h.

## Member Function Documentation

## operator=()

D4FilterClause & libdap::D4FilterClause::operator= | ( | const D4FilterClause & | rhs | ) |

inline

Definition at line 171 of file D4FilterClause.h.

## value() [1/2]

bool libdap::D4FilterClause::value | ( |  | ) |

Get the value of this relational expression. This version of value() will not work for clauses where one of the rvalues is a function call. This is not currently supported by the DAP4 specification, so it's probably no great loss.

Returns
  True if the clause is true, false otherwise.

Definition at line 169 of file D4FilterClause.cc.

## value() [2/2]

bool libdap::D4FilterClause::value | ( | DMR & | dmr | ) |

Get the value of this relational expression. This version of value() works for function clauses, although that's not supported by the syntax at this time.

Parameters

  dmr | The DMR to use when evaluating a function

Returns
  True if the clause is true, false otherwise.

Definition at line 138 of file D4FilterClause.cc.

## Friends And Related Symbol Documentation

## D4FilterClauseList

friend class D4FilterClauseList

friend

Definition at line 143 of file D4FilterClause.h.

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

- D4FilterClause.h
- D4FilterClause.cc