Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
corpus2
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
corpus2
Commits
2de71d7b
Commit
2de71d7b
authored
13 years ago
by
Paweł Kędzia
Browse files
Options
Downloads
Patches
Plain Diff
Wrapper for Corpus2::Tag
parent
b9a600cc
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
swig/Makefile
+60
-0
60 additions, 0 deletions
swig/Makefile
swig/boost_shared_ptr.i
+25
-0
25 additions, 0 deletions
swig/boost_shared_ptr.i
swig/libcorpustag.i
+58
-0
58 additions, 0 deletions
swig/libcorpustag.i
with
143 additions
and
0 deletions
swig/Makefile
0 → 100644
+
60
−
0
View file @
2de71d7b
CPP
=
g++
SWIG
=
swig
SWIGOPTS_LANG
=
-c
++
-python
PYTHONDIR
=
/usr/include/python2.6
WCCLDIR
=
/usr/local/include/libwccl/
CORPUS2DIR
=
/usr/local/include/libcorpus2/
PWRUTILDIR
=
CORPUS2BIN
=
/usr/local/lib/libcorpus2.so
PWRUTILBIN
=
/usr/local/lib/libpwrutils.so
ANTLRLIB
=
/usr/lib/libantlr-pic.a
CPPFLAGS
=
-fPIC
-O2
CBIN
=
libcorpustag.o
CBINOUT
=
_boost_shared_ptr.so
\
_libcorpustag.so
CWRAP
=
boost_shared_ptr_wrap.cxx
\
libcorpustag_wrap.cxx
CWRAPBIN
=
boost_shared_ptr_wrap.o
\
libcorpustag_wrap.o
PYMODULES
=
boost_shared_ptr.py
\
libcorpustag.py
PYCBIN
=
boost_shared_ptr.pyc
\
libcorpustag.pyc
# -----------------------------------------------------------------------------
all
:
boost_shared_ptr.o $(CBIN)
# Done
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# boost::shared_ptr wrappers
# -----------------------------------------------------------------------------
# shared_ptr
boost_shared_ptr.o
:
$(
SWIG
)
$(
SWIGOPTS_LANG
)
boost_shared_ptr.i
$(
CPP
)
-c
boost_shared_ptr_wrap.cxx
-I
$(
PYTHONDIR
)
$(
CPPFLAGS
)
$(
CPP
)
-shared
boost_shared_ptr_wrap.o
-o
_boost_shared_ptr.so
# -----------------------------------------------------------------------------
# Corpus2 Wrappers
# -----------------------------------------------------------------------------
# Tag
libcorpustag.o
:
$(
SWIG
)
$(
SWIGOPTS_LANG
)
libcorpustag.i
$(
CPP
)
-c
libcorpustag_wrap.cxx
-I
$(
PYTHONDIR
)
$(
CPPFLAGS
)
$(
CPP
)
-shared
libcorpustag_wrap.o
\
$(
PWRUTILBIN
)
$(
CORPUS2BIN
)
-o
_libcorpustag.so
# -----------------------------------------------------------------------------
clean
:
rm
-f
$(
CBIN
)
$(
CBINOUT
)
$(
CWRAP
)
$(
CWRAPBIN
)
$(
PYMODULES
)
$(
PYCBIN
)
This diff is collapsed.
Click to expand it.
swig/boost_shared_ptr.i
0 → 100644
+
25
−
0
View file @
2de71d7b
/**
* Wrapper for boost shared_ptr
*/
#
ifndef
SWIG_BOOST_SHAREDPTR
#
define
SWIG_BOOST_SHAREDPTR
%
module
boost_shared_ptr
%
{
%}
namespace
boost
{
template<class T> class shared_ptr {
public:
shared_ptr();
shared_ptr(T * p);
T* operator->();
private:
T * px;
int pn;
};
}
using
namespace
boost
;
#
endif
/* SWIG_BOOST_SHAREDPTR */
This diff is collapsed.
Click to expand it.
swig/libcorpustag.i
0 → 100644
+
58
−
0
View file @
2de71d7b
#
ifndef
SWIG_LIBCORPUS2_TAG_I
#
define
SWIG_LIBCORPUS2_TAG_I
%
module
libcorpustag
%
{
#include <libcorpus2/tag.h>
#include <boost/cstdint.hpp>
%}
%
include
"
std_string.i
"
%
include
"
std_vector.i
"
/* Typedefs */
%
inline
%
{
typedef std::bitset<64> mask_t;
%}
%
feature
(
"
notabstract
"
)
Corpus2
::
Tag
;
%
rename
(
__op_eq__
)
Corpus2
::
Tag
::
operator
==
(
const
Tag&
other
)
const
;
%
rename
(
__op_lw__
)
Corpus2
::
Tag
::
operator
<
(
const
Tag&
other
)
const
;
namespace
Corpus2
{
class Tag {
public:
Tag();
explicit Tag(mask_t pos);
Tag(mask_t pos, mask_t values);
/* --------------------------------------------------------------------- */
~Tag();
/* --------------------------------------------------------------------- */
bool is_null() const;
int pos_count() const;
int get_pos_index() const;
mask_t get_values() const;
mask_t get_pos() const;
Tag& combine_with(const Tag& other);
Tag get_combined(const Tag& other) const;
Tag& mask_with(const Tag& other);
Tag get_masked(const Tag& other);
std::string raw_dump() const;
bool operator<(const Tag& other) const;
bool operator==(const Tag& other) const;
};
size_t hash_value(const Tag &tag);
}
using
namespace
std
;
using
namespace
Corpus2
;
#
endif
/* SWIG_LIBCORPUS2_TAG_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