From ca9420d06da105a8ce8805f01f77a44fb35d2a10 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20K=C4=99dzia?= <Pawel.Kedzia@pwr.wroc.pl>
Date: Tue, 10 May 2011 10:49:36 +0200
Subject: [PATCH] (swig) Updated wrapper for Wccl::Match

---
 swig/libcclmatch.i | 56 ++++++++++++++++++++++++++++------------------
 1 file changed, 34 insertions(+), 22 deletions(-)

diff --git a/swig/libcclmatch.i b/swig/libcclmatch.i
index 1e3d64b..b1a0ccd 100644
--- a/swig/libcclmatch.i
+++ b/swig/libcclmatch.i
@@ -3,22 +3,24 @@
 
 %module libcclbool
 %{
-  #include <libwccl/values/value.h>
   #include <libwccl/values/match.h>
 %}
 
-%include "std_string.i"
 %include "libcclvalue.i"
-%include "libcclposition.i"
-// %include "libcclmatchdata.i"
-// %include "libccltokenmatch.i"
+%include "libcclmatchdata.i"
+%include "libccltokenmatch.i"
+%include "libcclannotationmatch.i"
+%include "libcclmatchvector.i"
 %include "libcorpus/libcorpusannotatedsentence.i"
 
+%include "std_string.i"
+%include "boost_shared_ptr.i"
+
 %feature("notabstract") Wccl::Match;
 
-namespace Wccl {
-  // class MatchData;
+%template (MatchPtr) boost::shared_ptr<Wccl::Match>;
 
+namespace Wccl {
   class Match : public Value {
   public:
     const char* get_type_name() const { return type_name; }
@@ -26,29 +28,39 @@ namespace Wccl {
     std::string make_var_repr(const std::string &var_name) const {
       return var_repr(var_name);
     }
+    /* --------------------------------------------------------------------- */
 
     Match();
-    // Match(const boost::shared_ptr<MatchData>& data);
-    // Match(const boost::shared_ptr<TokenMatch>& data);
-    // Match(const boost::shared_ptr<AnnotationMatch>& data);
-    // Match(const boost::shared_ptr<MatchVector>& data);
-
-    // Match(const MatchData& data);
-    // Match(const Match& match);
+    /* --------------------------------------------------------------------- */
 
-    // %rename(MatchEq) operator=(const Match& match);
-    // Match& operator=(const Match& match);
+    Match(const boost::shared_ptr<MatchData>& data);
+    Match(const boost::shared_ptr<TokenMatch>& data);
+    Match(const boost::shared_ptr<AnnotationMatch>& data);
+    Match(const boost::shared_ptr<MatchVector>& data);
+    /* --------------------------------------------------------------------- */
+  
+    Match(const MatchData& data);
+    Match(const Match& match);
+    /* --------------------------------------------------------------------- */
+  
+    %rename(OperatorEqMatch) *::operator=(const Match& other);
+    /* --------------------------------------------------------------------- */
 
     // const MatchData& get_value() const;
-    // MatchData& get_value();
+    MatchData& get_value();
+    /* --------------------------------------------------------------------- */
+
+    void set_value(const MatchData& m);
+    /* --------------------------------------------------------------------- */
 
-    // void set_value(const MatchData& m);
-    // bool empty() const;
+    bool empty() const;
+    /* --------------------------------------------------------------------- */
 
-    // virtual Position first_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>&) const;
-    // virtual Position last_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>&) const;
+    int first_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>& s) const;
+    int last_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>& s) const;
+    /* --------------------------------------------------------------------- */
 
-    // std::string to_raw_string() const;
+    std::string to_raw_string() const;
   };
 }
 
-- 
GitLab