From a0fef117da6731b46b542f246b86aeefcc4a3c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20K=C4=99dzia?= <pawel.kedzia@pwr.wroc.pl> Date: Fri, 13 May 2011 11:27:40 +0200 Subject: [PATCH] (swig) Some fixes --- swig/libccllexicon.i | 3 +++ swig/libccllexicons.i | 3 +++ swig/libcclmatchrulesequence.i | 4 +++- swig/libccltagrulesequence.i | 1 + swig/libcclwcclfile.i | 8 +++----- swig/libcclwcclfileopsections.i | 2 ++ 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/swig/libccllexicon.i b/swig/libccllexicon.i index 69cc324..c49dd79 100644 --- a/swig/libccllexicon.i +++ b/swig/libccllexicon.i @@ -60,6 +60,9 @@ namespace Wccl { const map_t& map() const; }; + + %template(LexiconPtr) boost::shared_ptr<Wccl::Lexicon>; + %template(ConstLexiconPtr) boost::shared_ptr<const Wccl::Lexicon>; } using namespace boost; diff --git a/swig/libccllexicons.i b/swig/libccllexicons.i index a251379..476a790 100644 --- a/swig/libccllexicons.i +++ b/swig/libccllexicons.i @@ -39,6 +39,9 @@ namespace Wccl { const map_t& get_lexicons() const; }; + + %template(LexiconsPtr) boost::shared_ptr<Wccl::Lexicons>; + %template(ConstLexiconsPtr) boost::shared_ptr<const Wccl::Lexicons>; } using namespace boost; diff --git a/swig/libcclmatchrulesequence.i b/swig/libcclmatchrulesequence.i index 590bd90..eca44e3 100644 --- a/swig/libcclmatchrulesequence.i +++ b/swig/libcclmatchrulesequence.i @@ -14,7 +14,9 @@ %include "std_vector.i" %include "boost_shared_ptr.i" -%template(MatchRuleVector) std::vector<MatchRule>; +%template(MatchRuleVector) std::vector<Wccl::MatchRule>; +%template(MatchRuleSequencePtr) boost::shared_ptr<Wccl::MatchRule>; +%template(ConstMatchRuleSequencePtr) boost::shared_ptr<const Wccl::MatchRule>; namespace Wccl { class MatchRuleSequence : public std::vector<MatchRule>, public Expression { diff --git a/swig/libccltagrulesequence.i b/swig/libccltagrulesequence.i index f85f04f..75aa8d8 100644 --- a/swig/libccltagrulesequence.i +++ b/swig/libccltagrulesequence.i @@ -17,6 +17,7 @@ %template(StdVectorTagRule) std::vector<TagRule>; %template(TagRuleSequencPtr) boost::shared_ptr<Wccl::TagRuleSequence>; +%template(ConstTagRuleSequencPtr) boost::shared_ptr<const Wccl::TagRuleSequence>; namespace Wccl { class TagRuleSequence : public std::vector<TagRule>, public Expression { diff --git a/swig/libcclwcclfile.i b/swig/libcclwcclfile.i index 81dda6a..6311ed8 100644 --- a/swig/libcclwcclfile.i +++ b/swig/libcclwcclfile.i @@ -34,7 +34,7 @@ %nodefaultctor Wccl::WcclFile; -%template(OpSequenceStrSet) Wccl::WcclFileOpSections<Wccl::OpSequence<Wccl::StrSet> >; +%template(WcclFilePtr) boost::shared_ptr<Wccl::WcclFile>; namespace Wccl { class WcclFile @@ -147,8 +147,8 @@ namespace Wccl { /* --------------------------------------------------------------------- */ + // UntypedOpSequence::name_op_v_c_t gen_name_untyped_op_pairs() const; UntypedOpSequence::name_op_v_t gen_name_untyped_op_pairs(); - UntypedOpSequence::name_op_v_c_t gen_name_untyped_op_pairs() const; /* --------------------------------------------------------------------- */ @@ -240,9 +240,7 @@ namespace Wccl { %template(add_section_position) add_section<Position>; %template(add_section_match) add_section<Match>; - /* - void import_lexicon(const boost::shared_ptr<Lexicon>& lexicon); - */ + void import_lexicon(const shared_ptr<Lexicon>& lexicon); /* void set_tag_rules(const shared_ptr<TagRuleSequence>& tag_rules); diff --git a/swig/libcclwcclfileopsections.i b/swig/libcclwcclfileopsections.i index f5ca976..8e8ee40 100644 --- a/swig/libcclwcclfileopsections.i +++ b/swig/libcclwcclfileopsections.i @@ -80,6 +80,8 @@ namespace Wccl { %template(BoolOpSequence) WcclFileOpSections<OpSequence<Bool> >; %template(PositionOpSequence) WcclFileOpSections<OpSequence<Position> >; %template(MatchOpSequence) WcclFileOpSections<OpSequence<Match> >; + + %template(OpSequenceStrSet) Wccl::WcclFileOpSections<Wccl::OpSequence<Wccl::StrSet> >; } using namespace std; -- GitLab