Go to the documentation of this file. 23 #ifndef ICL_CORE_VECTOR_WRAPPER_H_INCLUDED 24 #define ICL_CORE_VECTOR_WRAPPER_H_INCLUDED 29 #define ICL_CORE_WRAP_VECTOR_HEADER(TWrapper, TVector, access, wrapped) \ 30 typedef TVector::value_type value_type; \ 31 typedef TVector::allocator_type allocator_type; \ 32 typedef TVector::size_type size_type; \ 33 typedef TVector::difference_type difference_type; \ 34 typedef TVector::reference reference; \ 35 typedef TVector::const_reference const_reference; \ 36 typedef TVector::pointer pointer; \ 37 typedef TVector::const_pointer const_pointer; \ 38 typedef TVector::iterator iterator; \ 39 typedef TVector::const_iterator const_iterator; \ 40 typedef TVector::reverse_iterator reverse_iterator; \ 41 typedef TVector::const_reverse_iterator const_reverse_iterator 48 #define ICL_CORE_WRAP_VECTOR_HEADER_TYPENAME(TWrapper, TVector, access, wrapped) \ 49 typedef typename TVector::value_type value_type; \ 50 typedef typename TVector::allocator_type allocator_type; \ 51 typedef typename TVector::size_type size_type; \ 52 typedef typename TVector::difference_type difference_type; \ 53 typedef typename TVector::reference reference; \ 54 typedef typename TVector::const_reference const_reference; \ 55 typedef typename TVector::pointer pointer; \ 56 typedef typename TVector::const_pointer const_pointer; \ 57 typedef typename TVector::iterator iterator; \ 58 typedef typename TVector::const_iterator const_iterator; \ 59 typedef typename TVector::reverse_iterator reverse_iterator; \ 60 typedef typename TVector::const_reverse_iterator const_reverse_iterator 67 #define ICL_CORE_WRAP_VECTOR_BODY(TWrapper, TVector, access, wrapped) \ 68 void assign(size_type count, const value_type& value) \ 69 { wrapped.assign(count, value); } \ 70 template <class TInputIterator> \ 71 void assign(TInputIterator first, TInputIterator last) \ 72 { wrapped.template assign<TInputIterator>(first, last); } \ 73 allocator_type get_allocator() const \ 74 { return wrapped.get_allocator(); } \ 76 reference at(size_type pos) { return wrapped.at(pos); } \ 77 const_reference at(size_type pos) const { return wrapped.at(pos); } \ 78 reference operator [] (size_type pos) { return wrapped[pos]; } \ 79 const_reference operator [] (size_type pos) const \ 80 { return wrapped[pos]; } \ 82 reference front() { return wrapped.front(); } \ 83 const_reference front() const { return wrapped.front(); } \ 84 reference back() { return wrapped.back(); } \ 85 const_reference back() const { return wrapped.back(); } \ 86 iterator begin() { return wrapped.begin(); } \ 87 const_iterator begin() const { return wrapped.begin(); } \ 88 iterator end() { return wrapped.end(); } \ 89 const_iterator end() const { return wrapped.end(); } \ 90 reverse_iterator rbegin() { return wrapped.rbegin(); } \ 91 const_reverse_iterator rbegin() const { return wrapped.rbegin(); } \ 92 reverse_iterator rend() { return wrapped.rend(); } \ 93 const_reverse_iterator rend() const { return wrapped.rend(); } \ 95 bool empty() const { return wrapped.empty(); } \ 96 size_type size() const { return wrapped.size(); } \ 97 size_type max_size() const { return wrapped.max_size(); } \ 98 void reserve(size_type size) { wrapped.reserve(size); } \ 99 size_type capacity() const { return wrapped.capacity(); } \ 101 void clear() { wrapped.clear(); } \ 102 iterator insert(iterator pos, const value_type& value) \ 103 { return wrapped.insert(pos, value); } \ 104 void insert(iterator pos, size_type count, const value_type& value) \ 105 { wrapped.insert(pos, count, value); } \ 106 template <class TInputIterator> \ 107 void insert(iterator pos, TInputIterator first, TInputIterator last) \ 108 { wrapped.template insert<TInputIterator>(pos, first, last); } \ 110 iterator erase(iterator pos) { return wrapped.erase(pos); } \ 111 iterator erase(iterator first, iterator last) \ 112 { return wrapped.erase(first, last); } \ 113 void push_back(const value_type& value) { wrapped.push_back(value); } \ 114 void pop_back() { wrapped.pop_back(); } \ 115 void resize(size_type count, value_type value = value_type()) \ 116 { wrapped.resize(count, value); } \ 117 void swap(TWrapper& other) { wrapped.swap(other.wrapped); } \ 125 #define ICL_CORE_WRAP_VECTOR_CTOR(TWrapper, TVector, access, wrapped) \ 126 TWrapper(const TVector& other) : wrapped(other) { } \ 127 explicit TWrapper(const allocator_type& alloc = allocator_type()) \ 130 explicit TWrapper(size_type count, \ 131 const value_type& value = value_type()) \ 132 : wrapped(count, value) \ 134 template <class TInputIterator> \ 135 TWrapper(TInputIterator first, TInputIterator last, \ 136 const allocator_type& alloc = allocator_type()) \ 137 : wrapped(first, last, alloc) \ 145 #define ICL_CORE_WRAP_VECTOR_CTOR_INIT(TWrapper, TVector, access, wrapped, ...) \ 146 TWrapper(const TVector& other) \ 147 : wrapped(other), __VA_ARGS__ \ 149 explicit TWrapper(const allocator_type& alloc = allocator_type()) \ 150 : wrapped(alloc), __VA_ARGS__ \ 152 explicit TWrapper(size_type count, \ 153 const value_type& value = value_type()) \ 154 : wrapped(count, value), __VA_ARGS__ \ 156 template <class TInputIterator> \ 157 TWrapper(TInputIterator first, TInputIterator last, \ 158 const allocator_type& alloc = allocator_type()) \ 159 : wrapped(first, last, alloc), __VA_ARGS__ \ 184 #define ICL_CORE_WRAP_VECTOR(TWrapper, TVector, access, wrapped) \ 185 ICL_CORE_WRAP_VECTOR_HEADER(TWrapper, TVector, acccess, wrapped); \ 186 ICL_CORE_WRAP_VECTOR_CTOR(TWrapper, TVector, access, wrapped) \ 187 ICL_CORE_WRAP_VECTOR_BODY(TWrapper, TVector, access, wrapped) 211 #define ICL_CORE_WRAP_VECTOR_TYPENAME(TWrapper, TVector, access, wrapped) \ 212 ICL_CORE_WRAP_VECTOR_HEADER_TYPENAME(TWrapper, TVector, acccess, wrapped); \ 213 ICL_CORE_WRAP_VECTOR_CTOR(TWrapper, TVector, access, wrapped) \ 214 ICL_CORE_WRAP_VECTOR_BODY(TWrapper, TVector, access, wrapped) 239 #define ICL_CORE_WRAP_VECTOR_INIT(TWrapper, TVector, access, wrapped, ...) \ 240 ICL_CORE_WRAP_VECTOR_HEADER(TWrapper, TVector, access, wrapped); \ 241 ICL_CORE_WRAP_VECTOR_CTOR_INIT(TWrapper, TVector, access, wrapped, __VA_ARGS__) \ 242 ICL_CORE_WRAP_VECTOR_BODY(TWrapper, TVector, access, wrapped) 268 #define ICL_CORE_WRAP_VECTOR_TYPENAME_INIT(TWrapper, TVector, access, wrapped, ...) \ 269 ICL_CORE_WRAP_VECTOR_HEADER_TYPENAME(TWrapper, TVector, access, wrapped); \ 270 ICL_CORE_WRAP_VECTOR_CTOR_INIT(TWrapper, TVector, access, wrapped, __VA_ARGS__) \ 271 ICL_CORE_WRAP_VECTOR_BODY(TWrapper, TVector, access, wrapped) 275 #endif // ICL_CORE_VECTOR_WRAPPER_H_INCLUDED
fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:58