1/* ----------------------------------------------------------------------------- 2 * See the LICENSE file for information on copyright, usage and redistribution 3 * of SWIG, and the README file for authors - http://www.swig.org/release.html. 4 * 5 * std_deque.i 6 * 7 * Default std_deque wrapper 8 * ----------------------------------------------------------------------------- */ 9 10%module std_deque 11 12%rename(__getitem__) std::deque::getitem; 13%rename(__setitem__) std::deque::setitem; 14%rename(__delitem__) std::deque::delitem; 15%rename(__getslice__) std::deque::getslice; 16%rename(__setslice__) std::deque::setslice; 17%rename(__delslice__) std::deque::delslice; 18 19%extend std::deque { 20 int __len__() { 21 return (int) self->size(); 22 } 23 int __nonzero__() { 24 return ! self->empty(); 25 } 26 void append(const T &x) { 27 self->push_back(x); 28 } 29}; 30 31%include <std/_std_deque.i> 32