1 /* ----------------------------------------------------------------------------- 2 * std_deque.i 3 * 4 * Default std_deque wrapper 5 * ----------------------------------------------------------------------------- */ 6 7 %module std_deque 8 9 %rename(__getitem__) std::deque::getitem; 10 %rename(__setitem__) std::deque::setitem; 11 %rename(__delitem__) std::deque::delitem; 12 %rename(__getslice__) std::deque::getslice; 13 %rename(__setslice__) std::deque::setslice; 14 %rename(__delslice__) std::deque::delslice; 15 16 %extend std::deque { 17 int __len__() { 18 return (int) self->size(); 19 } 20 int __nonzero__() { 21 return ! self->empty(); 22 } 23 void append(const T &x) { 24 self->push_back(x); 25 } 26 }; 27 28 %include <std/_std_deque.i> 29