Skip to content
Snippets Groups Projects
or.h 818 B
Newer Older
#ifndef OR_H
#define 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 */
#endif // OR_H