54 : _op(oper), _b_func(0), _bt_func(0), _argc(0), _arg1(a1), _args(rv) {
62 _argc = _args->size();
71 _argc = _args->size();
76Clause::Clause() : _op(0), _b_func(0), _bt_func(0), _argc(0), _arg1(0), _args(0) {}
78static inline void delete_rvalue(
rvalue *rv) {
92 for_each(_args->begin(), _args->end(), delete_rvalue);
105 bool relational = (_op && !_b_func && !_bt_func);
107 bool boolean = (!_op && _b_func && !_bt_func);
109 bool basetype = (!_op && !_b_func && _bt_func);
112 return _arg1 && _args;
113 else if (
boolean || basetype)
123 return _op || _b_func;
130 return (_bt_func != 0);
145 assert(_op || _b_func);
154 for (
rvalue_list_iter i = _args->begin(); i != _args->end() && !result; i++) {
155 result = result || btp->
ops((*i)->bvalue(dds), _op);
159 }
else if (_b_func) {
163 (*_b_func)(_argc, argv, dds, &result);
169 throw InternalErr(__FILE__, __LINE__,
"A selection expression must contain only boolean clauses.");
195 (*_bt_func)(_argc, argv, dds,
value);
213 (*value)->set_send_p(
true);
214 (*value)->set_read_p(
true);
221 "Clause::value() was called in a context expecting a BaseType pointer return, but the Clause "
222 "was boolean-valued instead.");
The basic data type for the DODS DAP types.
virtual bool ops(BaseType *b, int op)
Evaluate relational operators.
A class for software fault reporting.
top level DAP object to house generic methods
std::vector< rvalue * > rvalue_list
std::vector< rvalue * >::iterator rvalue_list_iter
BaseType ** build_btp_args(const rvalue_list *args, DDS &dds)
bool value_clause()
Return true if the clause returns a value in a BaseType pointer.
bool boolean_clause()
Return true if the clause returns a boolean value.
bool value(DDS &dds)
Evaluate a clause which returns a boolean value This method must only be evaluated for clauses with r...
bool OK()
Checks the "representation invariant" of a clause.