diff --git a/libwccl/ops/predicate.cpp b/libwccl/ops/predicate.cpp new file mode 100644 index 0000000000000000000000000000000000000000..66b0fb2452c85964208da2546cd1862a8369b6e3 --- /dev/null +++ b/libwccl/ops/predicate.cpp @@ -0,0 +1,9 @@ +#include <libwccl/ops/predicate.h> + +namespace Wccl { + +const boost::scoped_ptr< Constant<Bool> > Predicate::True(new Constant<Bool>(Bool(true))); + +const boost::scoped_ptr< Constant<Bool> > Predicate::False(new Constant<Bool>(Bool(false))); + +} /* end ns Wccl */ diff --git a/libwccl/ops/predicate.h b/libwccl/ops/predicate.h new file mode 100644 index 0000000000000000000000000000000000000000..3c34e6be60bfc0e8a25c0aad3c836f5e8b6ed167 --- /dev/null +++ b/libwccl/ops/predicate.h @@ -0,0 +1,30 @@ +#ifndef PREDICATE_H +#define PREDICATE_H + +#include <boost/shared_ptr.hpp> +#include <boost/scoped_ptr.hpp> + +#include <libwccl/values/bool.h> +#include <libwccl/ops/functions.h> +#include <libwccl/ops/constant.h> + +namespace Wccl { + +/** + * Abstract base class for Predicates (operators returning Bool) + */ +class Predicate : public Function<Bool> { +public: + /** + * Constant<Bool> holding true value, to use by predicates when returning value + */ + static const boost::scoped_ptr< Constant<Bool> > True; + /** + * Constant<Bool> holding false value, to use by predicates when returning value + */ + static const boost::scoped_ptr< Constant<Bool> > False; +}; + +} /* end ns Wccl */ + +#endif // PREDICATE_H