From 76e9ee550a93c88dca0a90a4542faab26ac0491f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20K=C4=99dzia?= <Pawel.Kedzia@pwr.wroc.pl>
Date: Fri, 6 May 2011 12:55:24 +0200
Subject: [PATCH] (swig) Wccl::Operator fixed

---
 swig/libccloperator.i | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/swig/libccloperator.i b/swig/libccloperator.i
index 609d917..f6e5b52 100644
--- a/swig/libccloperator.i
+++ b/swig/libccloperator.i
@@ -21,31 +21,33 @@
 
 %feature("notabstract") Wccl::Operator;
 
-%rename(__op_cop__) Wccl::Operator::operator=(const Operator& other);
-%rename(__op_fun__) Wccl::Operator::operator()(const SentenceContext& sentence_context);
-
 namespace Wccl {
   template <class T> class Operator : public FunctionalOperator {
   public:
     Operator();
-    Operator& operator=(const Operator& other);
-/*
-    Operator(const boost::shared_ptr<const Function<T> >& body, const Variables& variables);
-*/
-
     Operator(const Operator& other, bool clean = false);
 
+    /* --------------------------------------------------------------------- */
+    %rename(OperatorEq) *::operator=(const Operator& other);
+
+    /* --------------------------------------------------------------------- */
+    %rename(OpFun) operator()(const SentenceContext& sentence_context);
     boost::shared_ptr<const T> operator()(const SentenceContext& sentence_context);
+
+    /* --------------------------------------------------------------------- */
     boost::shared_ptr<const T> apply(const SentenceContext& sentence_context);
     boost::shared_ptr<T> copy_apply(const SentenceContext& sentence_context);
     boost::shared_ptr<const Value> base_apply(const SentenceContext& sc);
     
+    /* --------------------------------------------------------------------- */
     Operator clone() const;
     Operator clone_clean() const;
     
+    /* --------------------------------------------------------------------- */
     boost::shared_ptr<Operator<T> > clone_ptr() const;
     boost::shared_ptr<Operator<T> > clone_clean_ptr() const;
 
+    /* --------------------------------------------------------------------- */
     std::string to_string(const Corpus2::Tagset& tagset) const;
 
   protected:
@@ -58,10 +60,10 @@ namespace Wccl {
   %template (StrSetOperator) Operator<StrSet>;
   %template (PositionOperator) Operator<Position>;
 
-  %template (SharedPtrBoolOperator) boost::shared_ptr<Operator<Bool> >;
-  %template (SharedPtrTSetOperator) boost::shared_ptr<Operator<TSet> >;
-  %template (SharedPtrStrSetOperator) boost::shared_ptr<Operator<StrSet> >;
-  %template (SharedPtrPositionOperator) boost::shared_ptr<Operator<Position> >;
+  %template (BoolOperatorPtr) shared_ptr<Wccl::Operator<Bool> >;
+  %template (TSetOperatorPtr) shared_ptr<Wccl::Operator<TSet> >;
+  %template (StrSetOperatorPtr) shared_ptr<Wccl::Operator<StrSet> >;
+  %template (PositionOperatorPtr) shared_ptr<Wccl::Operator<Position> >;
 }
 
 using namespace boost;
-- 
GitLab