From bcf2668c86e4a07c8d5ad0ac8ca2eb0383433070 Mon Sep 17 00:00:00 2001 From: daniloaf Date: Tue, 9 Mar 2010 17:59:18 -0300 Subject: [PATCH] some .pxd for stl on Cython/Includes/libcpp. Tests missing --- Cython/Includes/libcpp/deque.pxd | 56 ++++++++++++++++++++++++++++ Cython/Includes/libcpp/pair.pxd | 7 ++++ Cython/Includes/libcpp/queue.pxd | 12 ++++++ Cython/Includes/libcpp/set.pxd | 55 ++++++++++++++++++++++++++++ Cython/Includes/libcpp/stack.pxd | 61 +++++++++++++++++++++++++++++++ Cython/Includes/libcpp/vector.pxd | 57 +++++++++++++++++++++++++++++ 6 files changed, 248 insertions(+) create mode 100644 Cython/Includes/libcpp/deque.pxd create mode 100644 Cython/Includes/libcpp/pair.pxd create mode 100644 Cython/Includes/libcpp/queue.pxd create mode 100644 Cython/Includes/libcpp/set.pxd create mode 100644 Cython/Includes/libcpp/stack.pxd create mode 100644 Cython/Includes/libcpp/vector.pxd 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&) -- 2.26.2