add guards for swig/language extra methods and comments
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6386 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
3e0de3c3d9
commit
024efdb6f6
12 changed files with 85 additions and 14 deletions
|
|
@ -1,3 +1,9 @@
|
||||||
%include <pystdcommon.swg>
|
%include <pystdcommon.swg>
|
||||||
%include <std/std_common.i>
|
%include <std/std_common.i>
|
||||||
|
|
||||||
|
//
|
||||||
|
// Generates the traits for all the known primitive
|
||||||
|
// C++ types (int, double, ...)
|
||||||
|
//
|
||||||
|
%apply_cpptypes(%traits_ptypen);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,11 @@ namespace std {
|
||||||
|
|
||||||
|
|
||||||
%ignore pop();
|
%ignore pop();
|
||||||
%swig_basic_string(std::basic_string<_CharT>);
|
|
||||||
|
#ifdef %swig_basic_string
|
||||||
|
// Add swig/language extra methods
|
||||||
|
%swig_basic_string(std::basic_string<_CharT >);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||||
iterator
|
iterator
|
||||||
|
|
|
||||||
|
|
@ -152,8 +152,6 @@ namespace swig {
|
||||||
}
|
}
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
%apply_cpptypes(%traits_ptypen);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Generate the typemaps for a class that has 'value' traits
|
Generate the typemaps for a class that has 'value' traits
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,11 @@ namespace std {
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_DEQUE, std::deque<T >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_DEQUE, std::deque<T >);
|
||||||
|
|
||||||
%std_deque_methods(deque);
|
%std_deque_methods(deque);
|
||||||
|
|
||||||
|
#ifdef %swig_deque_methods
|
||||||
|
// Add swig/language extra methods
|
||||||
%swig_deque_methods(std::deque<T >);
|
%swig_deque_methods(std::deque<T >);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T > class deque<T*> {
|
template<class T > class deque<T*> {
|
||||||
|
|
@ -108,7 +112,11 @@ namespace std {
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_DEQUE, std::deque<T* >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_DEQUE, std::deque<T* >);
|
||||||
|
|
||||||
%std_deque_methods_val(std::deque<T* >);
|
%std_deque_methods_val(std::deque<T* >);
|
||||||
|
|
||||||
|
#ifdef %swig_deque_methods_val
|
||||||
|
// Add swig/language extra methods
|
||||||
%swig_deque_methods_val(std::deque<T* >);
|
%swig_deque_methods_val(std::deque<T* >);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,11 @@ namespace std {
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_LIST, std::list<T >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_LIST, std::list<T >);
|
||||||
|
|
||||||
%std_list_methods(list);
|
%std_list_methods(list);
|
||||||
|
|
||||||
|
#ifdef %swig_list_methods
|
||||||
|
// Add swig/language extra methods
|
||||||
%swig_list_methods(std::list<T >);
|
%swig_list_methods(std::list<T >);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T > class list<T*> {
|
template<class T > class list<T*> {
|
||||||
|
|
@ -120,7 +124,11 @@ namespace std {
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_LIST, std::list<T* >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_LIST, std::list<T* >);
|
||||||
|
|
||||||
%std_list_methods_val(list);
|
%std_list_methods_val(list);
|
||||||
|
|
||||||
|
#ifdef %swig_list_methods_val
|
||||||
|
// Add swig/language extra methods
|
||||||
%swig_list_methods_val(std::list<T* >);
|
%swig_list_methods_val(std::list<T* >);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,11 @@ namespace std {
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_MAP, std::map<K, T >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_MAP, std::map<K, T >);
|
||||||
|
|
||||||
%std_map_methods(map);
|
%std_map_methods(map);
|
||||||
|
|
||||||
|
#ifdef %swig_map_methods
|
||||||
|
// Add swig/language extra methods
|
||||||
%swig_map_methods(std::map<K, T >);
|
%swig_map_methods(std::map<K, T >);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,10 @@ namespace std {
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_MULTIMAP, std::multimap<K, T >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_MULTIMAP, std::multimap<K, T >);
|
||||||
|
|
||||||
%std_multimap_methods(multimap);
|
%std_multimap_methods(multimap);
|
||||||
|
|
||||||
|
#ifdef %swig_multimap_methods
|
||||||
|
// Add swig/language extra methods
|
||||||
%swig_multimap_methods(std::multimap<K, T >);
|
%swig_multimap_methods(std::multimap<K, T >);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,11 @@ namespace std {
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_MULTISET, std::multiset<T >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_MULTISET, std::multiset<T >);
|
||||||
|
|
||||||
%std_multiset_methods(multiset);
|
%std_multiset_methods(multiset);
|
||||||
%swig_container_methods(std::multiset<T >);
|
|
||||||
|
#ifdef %swig_multiset_methods
|
||||||
|
// Add swig/language extra methods
|
||||||
|
%swig_multiset_methods(std::multiset<T >);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,10 @@ namespace std {
|
||||||
T first;
|
T first;
|
||||||
U second;
|
U second;
|
||||||
|
|
||||||
|
#ifdef %swig_pair_methods
|
||||||
|
// Add swig/language extra methods
|
||||||
%swig_pair_methods(std::pair<T,U >)
|
%swig_pair_methods(std::pair<T,U >)
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
// ***
|
// ***
|
||||||
|
|
@ -73,7 +76,10 @@ namespace std {
|
||||||
T first;
|
T first;
|
||||||
U* second;
|
U* second;
|
||||||
|
|
||||||
|
#ifdef %swig_pair_methods
|
||||||
|
// Add swig/language extra methods
|
||||||
%swig_pair_methods(std::pair<T,U*>)
|
%swig_pair_methods(std::pair<T,U*>)
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T, class U > struct pair<T*, U> {
|
template <class T, class U > struct pair<T*, U> {
|
||||||
|
|
@ -106,7 +112,10 @@ namespace std {
|
||||||
T* first;
|
T* first;
|
||||||
U second;
|
U second;
|
||||||
|
|
||||||
|
#ifdef %swig_pair_methods
|
||||||
|
// Add swig/language extra methods
|
||||||
%swig_pair_methods(std::pair<T*,U >)
|
%swig_pair_methods(std::pair<T*,U >)
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T, class U > struct pair<T*, U*> {
|
template <class T, class U > struct pair<T*, U*> {
|
||||||
|
|
@ -138,8 +147,11 @@ namespace std {
|
||||||
|
|
||||||
T* first;
|
T* first;
|
||||||
U* second;
|
U* second;
|
||||||
|
|
||||||
|
#ifdef %swig_pair_methods
|
||||||
|
// Add swig/language extra methods
|
||||||
%swig_pair_methods(std::pair<T*,U*>)
|
%swig_pair_methods(std::pair<T*,U*>)
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,10 @@ namespace std {
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_SET, std::set<T >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_SET, std::set<T >);
|
||||||
|
|
||||||
%std_set_methods(set);
|
%std_set_methods(set);
|
||||||
|
|
||||||
|
#ifdef %swig_set_methods
|
||||||
|
// Add swig/language extra methods
|
||||||
%swig_set_methods(std::set<T >);
|
%swig_set_methods(std::set<T >);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,18 +87,13 @@ namespace std {
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<T >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<T >);
|
||||||
|
|
||||||
%std_vector_methods(vector);
|
%std_vector_methods(vector);
|
||||||
|
|
||||||
|
#ifdef %swig_vector_methods
|
||||||
|
// Add swig/language extra methods
|
||||||
%swig_vector_methods(std::vector<T >);
|
%swig_vector_methods(std::vector<T >);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
// bool specialization
|
|
||||||
%extend vector<bool> {
|
|
||||||
void flip()
|
|
||||||
{
|
|
||||||
self->flip();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ***
|
// ***
|
||||||
// This specialization should dissapear or get simplified when
|
// This specialization should dissapear or get simplified when
|
||||||
// a 'const SWIGTYPE*&' can be defined
|
// a 'const SWIGTYPE*&' can be defined
|
||||||
|
|
@ -131,11 +126,23 @@ namespace std {
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<T* >);
|
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<T* >);
|
||||||
|
|
||||||
%std_vector_methods_val(vector);
|
%std_vector_methods_val(vector);
|
||||||
|
|
||||||
|
#ifdef %swig_vector_methods_val
|
||||||
|
// Add swig/language extra methods
|
||||||
%swig_vector_methods_val(std::vector<T* >);
|
%swig_vector_methods_val(std::vector<T* >);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
// ***
|
// ***
|
||||||
// ***
|
// ***
|
||||||
|
// bool specialization
|
||||||
|
%extend vector<bool> {
|
||||||
|
void flip()
|
||||||
|
{
|
||||||
|
self->flip();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template<class T > class vector<bool> {
|
template<class T > class vector<bool> {
|
||||||
public:
|
public:
|
||||||
typedef size_t size_type;
|
typedef size_t size_type;
|
||||||
|
|
@ -164,7 +171,11 @@ namespace std {
|
||||||
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<bool>);
|
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<bool>);
|
||||||
|
|
||||||
%std_vector_methods_val(vector<bool>);
|
%std_vector_methods_val(vector<bool>);
|
||||||
|
|
||||||
|
#ifdef %swig_vector_methods_val
|
||||||
|
// Add swig/language extra methods
|
||||||
%swig_vector_methods_val(std::vector<bool>);
|
%swig_vector_methods_val(std::vector<bool>);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,11 @@ namespace std {
|
||||||
%typemap_traits(SWIG_TYPECHECK_VECTOR, std::vector<T,A >);
|
%typemap_traits(SWIG_TYPECHECK_VECTOR, std::vector<T,A >);
|
||||||
|
|
||||||
%std_vector_methods(vector<T,A >);
|
%std_vector_methods(vector<T,A >);
|
||||||
|
|
||||||
|
#ifdef %swig_vector_methods
|
||||||
|
// Add swig/language extra methods
|
||||||
%swig_vector_methods(std::vector<T,A >);
|
%swig_vector_methods(std::vector<T,A >);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -122,7 +126,11 @@ namespace std {
|
||||||
%typemap_traits(SWIG_TYPECHECK_VECTOR, std::vector<T*,A >);
|
%typemap_traits(SWIG_TYPECHECK_VECTOR, std::vector<T*,A >);
|
||||||
|
|
||||||
%std_vector_methods_val(vector);
|
%std_vector_methods_val(vector);
|
||||||
|
|
||||||
|
#ifdef %swig_vector_methods
|
||||||
|
// Add swig/language extra methods
|
||||||
%swig_vector_methods_val(std::vector<T*,A >);
|
%swig_vector_methods_val(std::vector<T*,A >);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue