summaryrefslogtreecommitdiff
path: root/devtools/swigwin-1.3.34/Lib/ocaml/std_deque.i
blob: 44815ebda01a1e2c36679ae2a0b3a09c45cb3032 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* -----------------------------------------------------------------------------
 * See the LICENSE file for information on copyright, usage and redistribution
 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
 *
 * std_deque.i
 *
 * Default std_deque wrapper
 * ----------------------------------------------------------------------------- */

%module std_deque

%rename(__getitem__) std::deque::getitem;
%rename(__setitem__) std::deque::setitem;
%rename(__delitem__) std::deque::delitem;
%rename(__getslice__) std::deque::getslice;
%rename(__setslice__) std::deque::setslice;
%rename(__delslice__) std::deque::delslice;

%extend std::deque {
   int __len__() {
       return (int) self->size();
   }
   int __nonzero__() {
       return ! self->empty();
   }
   void append(const T &x) {
       self->push_back(x);
   }
};

%include <_std_deque.i>