4
%include <std_container.i>
8
%define %std_deque_methods(deque...)
9
%std_sequence_methods(deque)
12
void push_front(const value_type& x);
15
%define %std_deque_methods_val(deque...)
16
%std_sequence_methods_val(deque)
19
void push_front(value_type x);
22
// ------------------------------------------------------------------------
25
// const declarations are used to guess the intent of the function being
26
// exported; therefore, the following rationale is applied:
28
// -- f(std::deque<T>), f(const std::deque<T>&):
29
// the parameter being read-only, either a sequence or a
30
// previously wrapped std::deque<T> can be passed.
31
// -- f(std::deque<T>&), f(std::deque<T>*):
32
// the parameter may be modified; therefore, only a wrapped std::deque
34
// -- std::deque<T> f(), const std::deque<T>& f():
35
// the deque is returned by copy; therefore, a sequence of T:s
36
// is returned which is most easily used in other functions
37
// -- std::deque<T>& f(), std::deque<T>* f():
38
// the deque is returned by reference; therefore, a wrapped std::deque
40
// -- const std::deque<T>* f(), f(const std::deque<T>*):
41
// for consistency, they expect and return a plain deque pointer.
42
// ------------------------------------------------------------------------
52
template<class _Tp, class _Alloc = std::allocator<_Tp> >
55
typedef size_t size_type;
56
typedef ptrdiff_t difference_type;
57
typedef _Tp value_type;
58
typedef value_type* pointer;
59
typedef const value_type* const_pointer;
60
typedef value_type& reference;
61
typedef const value_type& const_reference;
62
typedef _Alloc allocator_type;
64
%traits_swigtype(_Tp);
66
%fragment(SWIG_Traits_frag(std::deque<_Tp, _Alloc >), "header",
67
fragment=SWIG_Traits_frag(_Tp),
68
fragment="StdDequeTraits") {
70
template <> struct traits<std::deque<_Tp, _Alloc > > {
71
typedef pointer_category category;
72
static const char* type_name() {
73
return "std::deque<" #_Tp " >";
79
%typemap_traits_ptr(SWIG_TYPECHECK_DEQUE, std::deque<_Tp, _Alloc >);
81
%std_deque_methods(deque);
83
#ifdef %swig_deque_methods
84
// Add swig/language extra methods
85
%swig_deque_methods(std::deque<_Tp, _Alloc >);
89
template<class _Tp, class _Alloc >
90
class deque<_Tp*, _Alloc > {
92
typedef size_t size_type;
93
typedef ptrdiff_t difference_type;
94
typedef _Tp* value_type;
95
typedef value_type* pointer;
96
typedef const value_type* const_pointer;
97
typedef value_type reference;
98
typedef value_type const_reference;
99
typedef _Alloc allocator_type;
101
%traits_swigtype(_Tp);
103
%fragment(SWIG_Traits_frag(std::deque<_Tp*, _Alloc >), "header",
104
fragment=SWIG_Traits_frag(_Tp),
105
fragment="StdDequeTraits") {
107
template <> struct traits<std::deque<_Tp*, _Alloc > > {
108
typedef value_category category;
109
static const char* type_name() {
110
return "std::deque<" #_Tp " * >";
116
%typemap_traits_ptr(SWIG_TYPECHECK_DEQUE, std::deque<_Tp*, _Alloc >);
118
%std_deque_methods_val(std::deque<_Tp*, _Alloc >);
120
#ifdef %swig_deque_methods_val
121
// Add swig/language extra methods
122
%swig_deque_methods_val(std::deque<_Tp*, _Alloc >);