From 78575d6e6712673cdb38555a826f116c0f9f16db Mon Sep 17 00:00:00 2001
From: Adam Wardynski <award@.(B-4.4.46a)>
Date: Fri, 11 Mar 2011 16:23:55 +0100
Subject: [PATCH] MatchCondition - ABC for conditions of match operator.

---
 libwccl/ops/match/matchcondition.h | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 libwccl/ops/match/matchcondition.h

diff --git a/libwccl/ops/match/matchcondition.h b/libwccl/ops/match/matchcondition.h
new file mode 100644
index 0000000..6e8fddf
--- /dev/null
+++ b/libwccl/ops/match/matchcondition.h
@@ -0,0 +1,30 @@
+#ifndef LIBWCCL_OPS_MATCH_MATCHCONDITION_H
+#define LIBWCCL_OPS_MATCH_MATCHCONDITION_H
+
+#include <libwccl/ops/funexeccontext.h>
+#include <libwccl/ops/expression.h>
+#include <libwccl/ops/match/matchresult.h>
+
+namespace Wccl {
+
+/**
+ * Abstract base class for conditions of MatchOperator
+ */
+class MatchCondition : public Expression
+{
+public:
+	/**
+	 * @returns Name of the condition.
+	 */
+	virtual std::string name() const = 0;
+	/**
+	 * Applies the condition to the given execution context.
+	 * If match is found, the current iter position "$_" is
+	 * set to position right after the match.
+	 */
+	virtual MatchResult apply(boost::shared_ptr<Position> iter_pos, const FunExecContext& context) const = 0;
+};
+
+} /* end ns Wccl */
+
+#endif // LIBWCCL_OPS_MATCH_MATCHCONDITION_H
-- 
GitLab