From: daniloaf Date: Tue, 9 Mar 2010 20:59:18 +0000 (-0300) Subject: some .pxd for stl on Cython/Includes/libcpp. Tests missing X-Git-Tag: 0.13.beta0~326 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bcf2668c86e4a07c8d5ad0ac8ca2eb0383433070;p=cython.git some .pxd for stl on Cython/Includes/libcpp. Tests missing --- diff --git a/Cython/Includes/libcpp/deque.pxd b/Cython/Includes/libcpp/deque.pxd new file mode 100644 index 00000000..45f4ae1b --- /dev/null +++ b/Cython/Includes/libcpp/deque.pxd @@ -0,0 +1,56 @@ +from pair cimport pair + +cdef extern from "" namespace "std": + cdef cppclass deque[T]: + cppclass iterator: + T operator*() + iterator operator++() + bint operator==(iterator) + bint operator!=(iterator) + cppclass const_iterator(iterator): + pass + cppclass reverse_iterator(iterator): + pass + cppclass const_reverse_iterator(iterator): + pass + deque() + deque(deque&) + deque(size_t, T& val = T()) + #deque(input_iterator, input_iterator) + TYPE& operator[]( size_type index ) + const TYPE& operator[]( size_type index ) const + #deque& operator=(deque&) + bool operator==(deque&, deque&) + bool operator!=(deque&, deque&) + bool operator<(deque&, deque&) + bool operator>(deque&, deque&) + bool operator<=(deque&, deque&) + bool operator>=(deque&, deque&) + void assign(size_t, TYPE&) + void assign(input_iterator, input_iterator) + T& at(size_t) + T& back() + iterator begin() + const_iterator begin() + void clear() + bool empty() + iterator end() + const_iterator end() + iterator erase(iterator) + iterator erase(iterator, iterator) + T& front() + iterator insert(iterator, T&) + void insert(iterator, size_t, T&) + void insert(iterator, input_iterator, input_iterator) + size_t max_size() + void pop_back() + void pop_front() + void push_back(T&) + void push_front(T&) + reverse_iterator rbegin() + const_reverse_iterator rbegin() + reverse_iterator rend() + const_reverse_iterator rend() + void resize(size_t, T val = T()) + size_t size() + void swap(deque&) diff --git a/Cython/Includes/libcpp/pair.pxd b/Cython/Includes/libcpp/pair.pxd new file mode 100644 index 00000000..ceeeda03 --- /dev/null +++ b/Cython/Includes/libcpp/pair.pxd @@ -0,0 +1,7 @@ +cdef extern from "pair.h": + cdef cppclass pair[T, U]: + T first + U second + pair() + pair(T&, U&) + diff --git a/Cython/Includes/libcpp/queue.pxd b/Cython/Includes/libcpp/queue.pxd new file mode 100644 index 00000000..a92472a8 --- /dev/null +++ b/Cython/Includes/libcpp/queue.pxd @@ -0,0 +1,12 @@ +from pair cimport pair + +cdef extern from "" namespace "std": + cdef cppclass queue[T]: + queue() + #queue(Container&) + T& back() + bool empty() + T& front() + void pop() + void push(T&) + size_t size() diff --git a/Cython/Includes/libcpp/set.pxd b/Cython/Includes/libcpp/set.pxd new file mode 100644 index 00000000..eb4a9562 --- /dev/null +++ b/Cython/Includes/libcpp/set.pxd @@ -0,0 +1,55 @@ +from pair cimport pair + +cdef extern from "" namespace "std": + cdef cppclass set[T]: + cppclass iterator: + T operator*() + iterator operator++() + bint operator==(iterator) + bint operator!=(iterator) + cppclass const_iterator(iterator): + pass + cppclass reverse_iterator(iterator): + pass + cppclass const_reverse_iterator(iterator): + pass + set() + set(set&) + #set set(key_compare&) + #set& operator=(set&) + bool operator==(set&, set&) + bool operator!=(set&, set&) + bool operator<(set&, set&) + bool operator>(set&, set&) + bool operator<=(set&, set&) + bool operator>=(set&, set&) + iterator begin() + const_iterator begin() + void clear() + #size_t count(key_type&) + bool empty() + iterator end() + const_iterator end() + #pair[iterator, iterator] equal_range(key_type&) + #pair[const_iterator, const_iterator] equal_range(key_type&) + void erase(iterator) + void erase(iterator, iterator) + #size_t erase(key_type&) + #iterator find(key_type&) + #const_iterator find(key_type&) + #pair[iterator, bool] insert(T&) + iterator insert(iterator, T&) + #void insert(input_iterator, input_iterator) + #key_compare key_comp() + #iterator lower_bound(key_type&) + #const_iterator lower_bound(key_type&) + size_t max_size() + reverse_iterator rbegin() + const_reverse_iterator rbegin() + reverse_iterator rend() + const_reverse_iterator rend() + size_t size() + void swap(set&) + #iterator upper_bound(key_type&) + #const_iterator upper_bound(key_type&) + #value_compare value_comp() diff --git a/Cython/Includes/libcpp/stack.pxd b/Cython/Includes/libcpp/stack.pxd new file mode 100644 index 00000000..8d5854aa --- /dev/null +++ b/Cython/Includes/libcpp/stack.pxd @@ -0,0 +1,61 @@ +from pair cimport pair + +cdef extern from "" namespace "std": + cdef cppclass list[T]: + cppclass iterator: + T operator*() + iterator operator++() + bint operator==(iterator) + bint operator!=(iterator) + cppclass const_iterator(iterator): + pass + cppclass reverse_iterator(iterator): + pass + cppclass const_reverse_iterator(iterator): + pass + list() + list(list&) + list(size_t, T&) + #list operator=(list&) + bool operator==(list&, list&) + bool operator!=(list&, list&) + bool operator<(list&, list&) + bool operator>(list&, list&) + bool operator<=(list&, list&) + bool operator>=(list&, list&) + void assign(size_t, T&) + T& back() + iterator begin() + const_iterator begin() + bool empty() + iterator end() + const_iterator end() + iterator erase(iterator) + iterator erase(iterator, iterator) + T& front() + iterator insert(iterator, T&) + void insert(iterator, size_t, T&) + size_t max_size() + void merge(list&) + #voide merge(list&, BinPred) + void pop_back() + void pop_front() + void push_back(T&) + void push_front(T&) + reverse_iterator rbegin() + const_reverse_iterator rbegin() + void remove(T&) + #void remove_if(UnPred) + reverse_iterator rend() + const_reverse_iterator rend() + void resize(size_t, T&) + void reverse() + size_t size() + void sort() + #void sort(BinPred) + void splice(iterator, list&) + void splice(iterator, list&, iterator) + void splice(iterator, list&, iterator, iterator) + void swap(list&) + void unique() + #void unique(BinPred) diff --git a/Cython/Includes/libcpp/vector.pxd b/Cython/Includes/libcpp/vector.pxd new file mode 100644 index 00000000..6002faba --- /dev/null +++ b/Cython/Includes/libcpp/vector.pxd @@ -0,0 +1,57 @@ +from pair cimport pair + +cdef extern from "" namespace "std": + cdef cppclass vector[T]: + cppclass iterator: + T operator*() + iterator operator++() + bint operator==(iterator) + bint operator!=(iterator) + cppclass const_iterator(iterator): + pass + cppclass reverse_iterator(iterator): + pass + cppclass const_reverse_iterator(iterator): + pass + #cppclass input_iterator(iterator): + # pass + vector() + #vector(vector&) + #vector(size_t, T&) + #vector[input_iterator](input_iterator, input_iterator) + T& operator[](size_t) + #vector& operator=(vector&) + bool operator==(vector&, vector&) + bool operator!=(vector&, vector&) + bool operator<(vector&, vector&) + bool operator>(vector&, vector&) + bool operator<=(vector&, vector&) + bool operator>=(vector&, vector&) + void assign(size_t, T&) + #void assign(input_iterator, input_iterator) + T& at(size_t) + T& back() + iterator begin() + const_iterator begin() + size_t capacity() + void clear() + bool empty() + iterator end() + const_iterator end() + iterator erase(iterator) + iterator erase(iterator, iterator) + T& front() + iterator insert(iterator, T&) + void insert(iterator, size_t, T&) + void insert(iterator, iterator, iterator) + size_t max_size() + void pop_back() + void push_back(T&) + reverse_iterator rbegin() + const_reverse_iterator rbegin() + reverse_iterator rend() + const_reverse_iterator rend() + void reserve(size_t) + void resize(size_t, T) + size_t size() + void swap(vector&)