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:
Marcelo Matus 2004-10-10 17:58:14 +00:00
commit 024efdb6f6
12 changed files with 85 additions and 14 deletions

View file

@ -1,3 +1,9 @@
%include <pystdcommon.swg>
%include <std/std_common.i>
//
// Generates the traits for all the known primitive
// C++ types (int, double, ...)
//
%apply_cpptypes(%traits_ptypen);

View file

@ -177,7 +177,11 @@ namespace std {
%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
iterator

View file

@ -152,8 +152,6 @@ namespace swig {
}
%enddef
%apply_cpptypes(%traits_ptypen);
/*
Generate the typemaps for a class that has 'value' traits
*/

View file

@ -77,7 +77,11 @@ namespace std {
%typemap_traits_ptr(SWIG_TYPECHECK_DEQUE, std::deque<T >);
%std_deque_methods(deque);
#ifdef %swig_deque_methods
// Add swig/language extra methods
%swig_deque_methods(std::deque<T >);
#endif
};
template<class T > class deque<T*> {
@ -108,7 +112,11 @@ namespace std {
%typemap_traits_ptr(SWIG_TYPECHECK_DEQUE, 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* >);
#endif
};
}

View file

@ -89,7 +89,11 @@ namespace std {
%typemap_traits_ptr(SWIG_TYPECHECK_LIST, std::list<T >);
%std_list_methods(list);
#ifdef %swig_list_methods
// Add swig/language extra methods
%swig_list_methods(std::list<T >);
#endif
};
template<class T > class list<T*> {
@ -120,7 +124,11 @@ namespace std {
%typemap_traits_ptr(SWIG_TYPECHECK_LIST, std::list<T* >);
%std_list_methods_val(list);
#ifdef %swig_list_methods_val
// Add swig/language extra methods
%swig_list_methods_val(std::list<T* >);
#endif
};
}

View file

@ -112,7 +112,11 @@ namespace std {
%typemap_traits_ptr(SWIG_TYPECHECK_MAP, std::map<K, T >);
%std_map_methods(map);
#ifdef %swig_map_methods
// Add swig/language extra methods
%swig_map_methods(std::map<K, T >);
#endif
};
}

View file

@ -75,6 +75,10 @@ namespace std {
%typemap_traits_ptr(SWIG_TYPECHECK_MULTIMAP, std::multimap<K, T >);
%std_multimap_methods(multimap);
#ifdef %swig_multimap_methods
// Add swig/language extra methods
%swig_multimap_methods(std::multimap<K, T >);
#endif
};
}

View file

@ -72,7 +72,11 @@ namespace std {
%typemap_traits_ptr(SWIG_TYPECHECK_MULTISET, std::multiset<T >);
%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
};
}

View file

@ -36,7 +36,10 @@ namespace std {
T first;
U second;
#ifdef %swig_pair_methods
// Add swig/language extra methods
%swig_pair_methods(std::pair<T,U >)
#endif
};
// ***
@ -73,7 +76,10 @@ namespace std {
T first;
U* second;
#ifdef %swig_pair_methods
// Add swig/language extra methods
%swig_pair_methods(std::pair<T,U*>)
#endif
};
template <class T, class U > struct pair<T*, U> {
@ -106,7 +112,10 @@ namespace std {
T* first;
U second;
#ifdef %swig_pair_methods
// Add swig/language extra methods
%swig_pair_methods(std::pair<T*,U >)
#endif
};
template <class T, class U > struct pair<T*, U*> {
@ -138,8 +147,11 @@ namespace std {
T* first;
U* second;
#ifdef %swig_pair_methods
// Add swig/language extra methods
%swig_pair_methods(std::pair<T*,U*>)
#endif
};
}

View file

@ -93,6 +93,10 @@ namespace std {
%typemap_traits_ptr(SWIG_TYPECHECK_SET, std::set<T >);
%std_set_methods(set);
#ifdef %swig_set_methods
// Add swig/language extra methods
%swig_set_methods(std::set<T >);
#endif
};
}

View file

@ -87,18 +87,13 @@ namespace std {
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<T >);
%std_vector_methods(vector);
#ifdef %swig_vector_methods
// Add swig/language extra methods
%swig_vector_methods(std::vector<T >);
#endif
};
// bool specialization
%extend vector<bool> {
void flip()
{
self->flip();
}
}
// ***
// This specialization should dissapear or get simplified when
// a 'const SWIGTYPE*&' can be defined
@ -131,11 +126,23 @@ namespace std {
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<T* >);
%std_vector_methods_val(vector);
#ifdef %swig_vector_methods_val
// Add swig/language extra methods
%swig_vector_methods_val(std::vector<T* >);
#endif
};
// ***
// ***
// bool specialization
%extend vector<bool> {
void flip()
{
self->flip();
}
}
template<class T > class vector<bool> {
public:
typedef size_t size_type;
@ -164,7 +171,11 @@ namespace std {
%typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::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>);
#endif
};
}

View file

@ -86,7 +86,11 @@ namespace std {
%typemap_traits(SWIG_TYPECHECK_VECTOR, std::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 >);
#endif
};
@ -122,7 +126,11 @@ namespace std {
%typemap_traits(SWIG_TYPECHECK_VECTOR, std::vector<T*,A >);
%std_vector_methods_val(vector);
#ifdef %swig_vector_methods
// Add swig/language extra methods
%swig_vector_methods_val(std::vector<T*,A >);
#endif
};