isolate language independent STD/STL/C++ code + more documentation + cleaning
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6382 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
0f6ae6977d
commit
dc4409a1f1
50 changed files with 3502 additions and 3408 deletions
145
Lib/std/std_pair.i
Normal file
145
Lib/std/std_pair.i
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
%include <std_common.i>
|
||||
|
||||
%{
|
||||
#include <utility>
|
||||
%}
|
||||
|
||||
|
||||
namespace std {
|
||||
template <class T, class U > struct pair {
|
||||
typedef T fisrt_type;
|
||||
typedef U second_type;
|
||||
|
||||
%traits_swigtype(T);
|
||||
%traits_swigtype(U);
|
||||
|
||||
%fragment(SWIG_Traits_frag(std::pair<T,U >), "header",
|
||||
fragment=SWIG_Traits_frag(T),
|
||||
fragment=SWIG_Traits_frag(U),
|
||||
fragment="StdPairTraits") {
|
||||
namespace swig {
|
||||
template <> struct traits<std::pair<T,U > > {
|
||||
typedef pointer_category category;
|
||||
static const char* type_name() {
|
||||
return "std::pair<" #T "," #U " >";
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
%typemap_traits_ptr(SWIG_TYPECHECK_PAIR, std::pair<T,U >);
|
||||
|
||||
pair();
|
||||
pair(T __a, U __b);
|
||||
pair(const pair& __p);
|
||||
|
||||
T first;
|
||||
U second;
|
||||
|
||||
%swig_pair_methods(std::pair<T,U >)
|
||||
};
|
||||
|
||||
// ***
|
||||
// The following specializations should dissapear or get
|
||||
// simplified when a 'const SWIGTYPE*&' can be defined
|
||||
// ***
|
||||
template <class T, class U > struct pair<T, U*> {
|
||||
typedef T fisrt_type;
|
||||
typedef U* second_type;
|
||||
|
||||
%traits_swigtype(T);
|
||||
%traits_swigtype(U);
|
||||
|
||||
%fragment(SWIG_Traits_frag(std::pair<T,U* >), "header",
|
||||
fragment=SWIG_Traits_frag(T),
|
||||
fragment=SWIG_Traits_frag(U),
|
||||
fragment="StdPairTraits") {
|
||||
namespace swig {
|
||||
template <> struct traits<std::pair<T,U* > > {
|
||||
typedef pointer_category category;
|
||||
static const char* type_name() {
|
||||
return "std::pair<" #T "," #U " * >";
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
%typemap_traits_ptr(SWIG_TYPECHECK_PAIR, std::pair<T,U* >);
|
||||
|
||||
pair();
|
||||
pair(T __a, U* __b);
|
||||
pair(const pair& __p);
|
||||
|
||||
T first;
|
||||
U* second;
|
||||
|
||||
%swig_pair_methods(std::pair<T,U*>)
|
||||
};
|
||||
|
||||
template <class T, class U > struct pair<T*, U> {
|
||||
typedef T* fisrt_type;
|
||||
typedef U second_type;
|
||||
|
||||
%traits_swigtype(T);
|
||||
%traits_swigtype(U);
|
||||
|
||||
%fragment(SWIG_Traits_frag(std::pair<T*,U >), "header",
|
||||
fragment=SWIG_Traits_frag(T),
|
||||
fragment=SWIG_Traits_frag(U),
|
||||
fragment="StdPairTraits") {
|
||||
namespace swig {
|
||||
template <> struct traits<std::pair<T*,U > > {
|
||||
typedef pointer_category category;
|
||||
static const char* type_name() {
|
||||
return "std::pair<" #T " *," #U " >";
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
%typemap_traits_ptr(SWIG_TYPECHECK_PAIR, std::pair<T*,U >);
|
||||
|
||||
pair();
|
||||
pair(T* __a, U __b);
|
||||
pair(const pair& __p);
|
||||
|
||||
T* first;
|
||||
U second;
|
||||
|
||||
%swig_pair_methods(std::pair<T*,U >)
|
||||
};
|
||||
|
||||
template <class T, class U > struct pair<T*, U*> {
|
||||
typedef T* fisrt_type;
|
||||
typedef U* second_type;
|
||||
|
||||
%traits_swigtype(T);
|
||||
%traits_swigtype(U);
|
||||
|
||||
%fragment(SWIG_Traits_frag(std::pair<T*,U* >), "header",
|
||||
fragment=SWIG_Traits_frag(T),
|
||||
fragment=SWIG_Traits_frag(U),
|
||||
fragment="StdPairTraits") {
|
||||
namespace swig {
|
||||
template <> struct traits<std::pair<T*,U* > > {
|
||||
typedef pointer_category category;
|
||||
static const char* type_name() {
|
||||
return "std::pair<" #T " *," #U " * >";
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
%typemap_traits(SWIG_TYPECHECK_PAIR, std::pair<T*,U* >);
|
||||
|
||||
pair();
|
||||
pair(T* __a, U* __b);
|
||||
pair(const pair& __p);
|
||||
|
||||
T* first;
|
||||
U* second;
|
||||
|
||||
%swig_pair_methods(std::pair<T*,U*>)
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue