In file Clause.h:

struct Clause

Holds a section of a constraint expression.

int _op
The relational operator, if any
bool_func _b_func
A pointer to a valid boolean function
btp_func _bt_func
A pointer to a valid function that returns a pointer to a BaseType
bool OK()
Checks the "representation invariant" of a clause.
bool boolean_clause()
Return true if the clause returns a boolean value.
bool value_clause()
Return true if the clause returns a value in a BaseType pointer.
bool value(const string &dataset, DDS &dds)
Evaluate a clause which returns a boolean value
bool value(const string &dataset, DDS &dds, BaseType **value)
Evaluate a clause that returns a value via a BaseType pointer.

Documentation

The selection part of a a DODS constraint expression may contain one or more clauses, separated by ampersands (\&). This is modeled in the DDS class structure as a singly-linked list of Clause objects. In addition, a constraint expression may be a single function call, also represented in the DDS using an instance of Clause. Each clause object can contain a representation of one of three possible forms: \begin{enumerate} \item A relational clause, where an operator tests the relation between two operands. This kind of clause evaluates to a boolean value. For example: #a > b#. \item A boolean function, where some function operates on arguments in the clause to return a boolean value. For example, consider a scalar A and a list L. The clause #find(A,L)# might return TRUE if A is a member of L (if the #find()# function is defined). \item A clause that returns a pointer to a DODS BaseType value. This is a clause that evaluates to some data value (be it scalar or vector). For example, #sig0()# might be included in the constraint expression parser to calculate density from pressure, temperature, and salinity. In this case, #sig0(p,t,s)# would be a clause that evaluates to a data value. \end{enumerate} This might be a bit confusing; in the first, and by far more common, form of constraint expressions (CEs) only the first two types of clauses may appear. In the second form of the CE only the last type of clause may occur. The Clause class, however, can store them all. The Clause object holds the constraint expression \emph{after} it has been parsed. The parser renders the relational operator into an integer, and the functions into pointers.
bool OK()
Checks the "representation invariant" of a clause.

bool boolean_clause()
Return true if the clause returns a boolean value.

bool value_clause()
Return true if the clause returns a value in a BaseType pointer.

bool value(const string &dataset, DDS &dds)
Evaluate a clause which returns a boolean value

bool value(const string &dataset, DDS &dds, BaseType **value)
Evaluate a clause that returns a value via a BaseType pointer.

See Also:
DDS::parse_constraint

alphabetic index hierarchy of classes


generated by doc++