Newer
Older
#ifndef LIBWCCL_OPS_OR_H
#define LIBWCCL_OPS_OR_H
#include <boost/foreach.hpp>
#define foreach BOOST_FOREACH
#include <libwccl/ops/logicalpredicate.h>
namespace Wccl {
/**
* Operator that realises logical predicate "or"
*/
class Or : public LogicalPredicate
{
public:
Or(const boost::shared_ptr<BoolFunctionPtrVector>& expressions)
: LogicalPredicate(expressions)
{
}
protected :
typedef FunctionBase::BaseRetValPtr BaseRetValPtr ;
/**
* "Or" predicate evaluates expressions one by one in order from left to right,
* and True is returned once an expression evaluating to True is found.
* If all of the expressions were False, False is returned.
*/
virtual BaseRetValPtr apply_internal(const SentenceContext&) const;
virtual const std::string raw_operator_name() const;
};
} /* end ns Wccl */