Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
1c08da81
Commit
1c08da81
authored
13 years ago
by
Paweł Kędzia
Browse files
Options
Downloads
Patches
Plain Diff
(swig) Added wrappers for Wccl::FunctionalOpSequence, Wccl::UntypedOpSequence, Wccl::OpSequence
parent
a1b3d9e3
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
swig/Makefile
+13
-0
13 additions, 0 deletions
swig/Makefile
swig/libcclfunctionalopsequence.i
+203
-0
203 additions, 0 deletions
swig/libcclfunctionalopsequence.i
with
216 additions
and
0 deletions
swig/Makefile
+
13
−
0
View file @
1c08da81
...
...
@@ -37,6 +37,7 @@ CBIN=libcclvalue.o \
libccltagrule.o
\
libccltagrulesequence.o
\
libcclmatchrule.o
\
libcclfunctionalopsequence.o
\
wccl.o
CBINOUT
=
_libcclvalue.so
\
...
...
@@ -62,6 +63,7 @@ CBINOUT=_libcclvalue.so \
_libccltagrulesequence.so
\
_libcclmatchrule.so
\
_wccl.so
\
_libcclfunctionalopsequence.so
\
_boost_shared_ptr.so
CWRAP
=
libcclvalue_wrap.cxx
\
...
...
@@ -87,6 +89,7 @@ CWRAP=libcclvalue_wrap.cxx \
libccltagrulesequence_wrap.cxx
\
libcclmatchrule_wrap.cxx
\
wccl_wrap.cxx
\
libcclfunctionalopsequence_wrap.cxx
\
boost_shared_ptr_wrap.cxx
CWRAPBIN
=
libcclvalue_wrap.o
\
...
...
@@ -112,6 +115,7 @@ CWRAPBIN=libcclvalue_wrap.o \
libccltagrulesequence_wrap.o
\
libcclmatchrule_wrap.o
\
wccl_wrap.o
\
libcclfunctionalopsequence_wrap.o
\
boost_shared_ptr_wrap.o
PYMODULES
=
libcclvalue.py
\
...
...
@@ -137,6 +141,7 @@ PYMODULES=libcclvalue.py \
libccltagrulesequence.py
\
libcclmatchrule.py
\
wccl.py
\
libcclfunctionalopsequence.py
\
boost_shared_ptr.py
PYCBIN
=
libcclvalue.pyc
\
...
...
@@ -162,6 +167,7 @@ PYCBIN=libcclvalue.pyc \
libccltagrulesequence.pyc
\
libcclmatchrule.pyc
\
wccl.pyc
\
libcclfunctionalopsequence.pyc
\
boost_shared_ptr.pyc
all
:
boost_shared_ptr.o $(CBIN)
...
...
@@ -341,6 +347,13 @@ libcclmatchrule.o:
$(
CPP
)
-shared
libcclmatchrule_wrap.o
\
$(
CCLBIN
)
$(
ANTLRLIB
)
-o
_libcclmatchrule.so
# FunctionalOpSequence
libcclfunctionalopsequence.o
:
$(
SWIG
)
$(
SWIGOPTS_LANG
)
libcclfunctionalopsequence.i
$(
CPP
)
-c
libcclfunctionalopsequence_wrap.cxx
-I
$(
PYTHONDIR
)
-I
$(
WCCLDIR
)
$(
CPPFLAGS
)
$(
CPP
)
-shared
libcclfunctionalopsequence_wrap.o
\
$(
CCLBIN
)
$(
ANTLRLIB
)
-o
_libcclfunctionalopsequence.so
# -----------------------------------------------------------------------------
# Wccl Library
wccl.o
:
...
...
This diff is collapsed.
Click to expand it.
swig/libcclfunctionalopsequence.i
0 → 100644
+
203
−
0
View file @
1c08da81
#
ifndef
SWIG_LIBWCCL_FUNCTIONALOPSEQUENCE_I
#
define
SWIG_LIBWCCL_FUNCTIONALOPSEQUENCE_I
%
module
libcclfunctionalopsequence
%
{
#include <libwccl/ops/opsequence.h>
%}
%
include
"
libccloperator.i
"
%
include
"
libcclexpression.i
"
%
include
"
libcclfunctionaloperator.i
"
%
include
"
std_pair.i
"
%
include
"
std_string.i
"
%
include
"
std_vector.i
"
%
nodefaultctor
Wccl
::
FunctionalOpSequence
;
%
template
(
fun_op_ptr_t
)
boost
::
shared_ptr
<
FunctionalOperator
>
;
%
template
(
fun_op_ptr_c_t
)
boost
::
shared_ptr
<
const
FunctionalOperator
>
;
%
template
(
name_op_pair_t
)
std
::
pair
<
std
::
string
,
boost
::
shared_ptr
<
FunctionalOperator
>
>
;
%
template
(
name_op_pair_c_t
)
std
::
pair
<
std
::
string
,
boost
::
shared_ptr
<
const
FunctionalOperator
>
>
;
%
template
(
name_op_v_t
)
std
::
vector
<
std
::
pair
<
std
::
string
,
boost
::
shared_ptr
<
FunctionalOperator
>
>
>
;
%
template
(
name_op_v_c_t
)
std
::
vector
<
std
::
pair
<
std
::
string
,
boost
::
shared_ptr
<
const
FunctionalOperator
>
>
>
;
namespace
Wccl
{
class FunctionalOpSequence : public Expression {
public:
typedef shared_ptr<FunctionalOperator> fun_op_ptr_t;
typedef shared_ptr<const FunctionalOperator> fun_op_ptr_c_t;
typedef std::pair<std::string, fun_op_ptr_t> name_op_pair_t;
typedef std::pair<std::string, fun_op_ptr_c_t> name_op_pair_c_t;
typedef std::vector<name_op_pair_t> name_op_v_t;
typedef std::vector<name_op_pair_c_t> name_op_v_c_t;
/* --------------------------------------------------------------------- */
std::string name() const;
/* --------------------------------------------------------------------- */
virtual size_t size() const = 0;
virtual bool empty() const = 0;
/* --------------------------------------------------------------------- */
virtual FunctionalOperator& get(size_t idx) = 0;
virtual const FunctionalOperator& get(size_t idx) const = 0;
/* --------------------------------------------------------------------- */
virtual fun_op_ptr_t get_untyped_ptr(size_t idx) = 0;
virtual fun_op_ptr_c_t get_untyped_ptr(size_t idx) const = 0;
/* --------------------------------------------------------------------- */
name_op_v_t& add_name_op_pairs_untyped(name_op_v_t& pairs);
name_op_v_c_t& add_name_op_pairs_untyped(name_op_v_c_t& pairs) const;
/* --------------------------------------------------------------------- */
name_op_v_t gen_name_op_pairs_untyped();
name_op_v_c_t gen_name_op_pairs_untyped() const;
/* --------------------------------------------------------------------- */
std::string gen_op_name(size_t idx) const;
/* --------------------------------------------------------------------- */
name_op_pair_t gen_name_op_pair_untyped(size_t idx);
name_op_pair_c_t gen_name_op_pair_untyped(size_t idx) const;
/* --------------------------------------------------------------------- */
shared_ptr<FunctionalOpSequence> clone() const;
/* --------------------------------------------------------------------- */
virtual ~FunctionalOpSequence();
/* --------------------------------------------------------------------- */
protected:
FunctionalOpSequence(const std::string& name);
virtual FunctionalOpSequence* clone_internal() const = 0;
}; // FunctionalOpSequence
/* ----------------------------------------------------------------------- */
class UntypedOpSequence : public FunctionalOpSequence {
public:
typedef FunctionalOperator op_t;
UntypedOpSequence(const std::string& name);
/* --------------------------------------------------------------------- */
bool empty() const;
size_t size() const;
/* --------------------------------------------------------------------- */
void append(const fun_op_ptr_t& op);
/* --------------------------------------------------------------------- */
op_t& get(size_t idx);
const op_t& get(size_t idx) const;
/* --------------------------------------------------------------------- */
fun_op_ptr_t get_untyped_ptr(size_t idx);
fun_op_ptr_c_t get_untyped_ptr(size_t idx) const;
/* --------------------------------------------------------------------- */
fun_op_ptr_t get_ptr(size_t idx);
fun_op_ptr_c_t get_ptr(size_t idx) const;
/* --------------------------------------------------------------------- */
name_op_v_t& add_name_op_pairs(name_op_v_t& pairs);
name_op_v_c_t& add_name_op_pairs(name_op_v_c_t& pairs) const;
/* --------------------------------------------------------------------- */
name_op_v_t gen_name_op_pairs();
name_op_v_c_t gen_name_op_pairs() const;
/* --------------------------------------------------------------------- */
name_op_pair_t gen_name_op_pair(size_t idx);
name_op_pair_c_t gen_name_op_pair(size_t idx) const;
/* --------------------------------------------------------------------- */
std::string to_string(const Corpus2::Tagset& tagset) const;
/* --------------------------------------------------------------------- */
UntypedOpSequence(const UntypedOpSequence& seq);
/* --------------------------------------------------------------------- */
shared_ptr<UntypedOpSequence> clone() const;
/* --------------------------------------------------------------------- */
protected:
std::ostream& write_to(std::ostream& ostream) const;
UntypedOpSequence* clone_internal() const;
}; // UntypedOpSequence
/* ----------------------------------------------------------------------- */
%rename(op_t) Wccl::Operator<T>;
%rename(op_ptr_t) boost::shared_ptr<Wccl::Operator<T> >;
%rename(op_ptr_c_t) boost::shared_ptr<const Wccl::Operator<T> >;
template<class T> class OpSequence : public FunctionalOpSequence {
public:
typedef Operator<T> op_t;
typedef typename shared_ptr<Operator<T> > op_ptr_t;
typedef typename shared_ptr<const Operator<T> > op_ptr_c_t;
typedef typename std::pair<std::string, op_ptr_t> name_op_pair_t;
typedef typename std::pair<std::string, op_ptr_c_t> name_op_pair_c_t;
typedef typename std::vector<name_op_pair_t> name_op_v_t;
typedef typename std::vector<name_op_pair_c_t> name_op_v_c_t;
/* --------------------------------------------------------------------- */
OpSequence(const std::string& name);
/* --------------------------------------------------------------------- */
bool empty() const;
size_t size() const;
/* --------------------------------------------------------------------- */
void append(const op_ptr_t& op);
/* --------------------------------------------------------------------- */
op_t& get(size_t idx);
const op_t& get(size_t idx) const;
/* --------------------------------------------------------------------- */
op_ptr_t get_ptr(size_t idx);
op_ptr_c_t get_ptr(size_t idx) const;
/* --------------------------------------------------------------------- */
FunctionalOpSequence::fun_op_ptr_t get_untyped_ptr(size_t idx);
FunctionalOpSequence::fun_op_ptr_c_t get_untyped_ptr(size_t idx) const;
/* --------------------------------------------------------------------- */
name_op_v_t gen_name_op_pairs();
name_op_v_c_t gen_name_op_pairs() const;
/* --------------------------------------------------------------------- */
name_op_v_t& add_name_op_pairs(name_op_v_t& pairs);
name_op_v_c_t& add_name_op_pairs(name_op_v_c_t& pairs) const;
/* --------------------------------------------------------------------- */
name_op_pair_t gen_name_op_pair(size_t idx);
name_op_pair_c_t gen_name_op_pair(size_t idx) const;
/* --------------------------------------------------------------------- */
std::string to_string(const Corpus2::Tagset& tagset) const;
/* --------------------------------------------------------------------- */
OpSequence(const OpSequence<T>& seq);
/* --------------------------------------------------------------------- */
shared_ptr<OpSequence<T> > clone() const;
/* --------------------------------------------------------------------- */
protected:
std::ostream& write_to(std::ostream& os) const;
virtual OpSequence<T>* clone_internal() const;
}; // OpSequence
}
using
namespace
boost
;
using
namespace
Wccl
;
using
namespace
std
;
#
endif
/* SWIG_LIBWCCL_FUNCTIONALOPSEQUENCE_I */
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment