FastUIDraw
|
A c_array is a wrapper over a C pointer with a size parameter to facilitate bounds checking and provide an STL-like iterator interface. More...
#include <c_array.hpp>
Public Types | |
typedef const_pointer | const_iterator |
iterator typedef to const_pointer | |
typedef T * | const_pointer |
STL compliant typedef; notice that const_pointer is type T* and not const T*. This is because a c_array is just a HOLDER of a pointer and a length and thus the contents of the value behind the pointer are not part of the value of a c_array. | |
typedef T & | const_reference |
STL compliant typedef; notice that const_pointer is type T& and not const T&. This is because a c_array is just a HOLDER of a pointer and a length and thus the contents of the value behind the pointer are not part of the value of a c_array. | |
typedef ptrdiff_t | difference_type |
STL compliant typedef. | |
typedef pointer | iterator |
iterator typedef to pointer | |
typedef T * | pointer |
STL compliant typedef. | |
typedef T & | reference |
STL compliant typedef. | |
typedef size_t | size_type |
STL compliant typedef. | |
typedef T | value_type |
STL compliant typedef. | |
Public Member Functions | |
c_array (void) | |
template<typename U > | |
c_array (U *pptr, size_type sz) | |
template<typename U , size_type N> | |
c_array (vecN< U, N > &pptr) | |
template<typename U , size_type N> | |
c_array (const vecN< U, N > &pptr) | |
template<typename U > | |
c_array (const c_array< U > &obj) | |
c_array (range_type< iterator > R) | |
reference | back (size_type I) const |
reference | back (void) const |
iterator | begin (void) const |
T * | c_ptr (void) const |
template<typename S > | |
c_array< S > | const_cast_pointer (void) const |
bool | empty (void) const |
iterator | end (void) const |
T * | end_c_ptr (void) const |
c_array< typename unvecN< T >::type > | flatten_array (void) const |
reference | front (void) const |
reference | operator[] (size_type j) const |
void | pop_back (void) |
void | pop_front (void) |
range_type< iterator > | range (void) const |
template<typename S > | |
c_array< S > | reinterpret_pointer (void) const |
void | reset (void) |
template<typename U > | |
bool | same_data (const c_array< U > &rhs) const |
size_type | size (void) const |
c_array | sub_array (size_type pos, size_type length) const |
c_array | sub_array (size_type pos) const |
template<typename I > | |
c_array | sub_array (range_type< I > R) const |
Friends | |
template<typename > | |
class | c_array |
A c_array is a wrapper over a C pointer with a size parameter to facilitate bounds checking and provide an STL-like iterator interface.
Definition at line 43 of file c_array.hpp.
|
inline |
Default ctor, initializing the pointer as nullptr with size 0.
Definition at line 115 of file c_array.hpp.
|
inline |
Ctor initializing the pointer and size
pptr | pointer value |
sz | size, must be no more than the number of elements that pptr points to. |
Definition at line 126 of file c_array.hpp.
|
inline |
Ctor from a vecN, size is the size of the fixed size array
pptr | fixed size array that c_array references, must be in scope as until c_array is changed |
Definition at line 139 of file c_array.hpp.
|
inline |
Ctor from a vecN, size is the size of the fixed size array
pptr | fixed size array that c_array references, must be in scope as until c_array is changed |
Definition at line 152 of file c_array.hpp.
|
inline |
Ctor from another c_array object.
U | type U* must be convertible to type T* AND the size of U must be the same as the size of T |
obj | value from which to copy |
Definition at line 167 of file c_array.hpp.
|
inline |
Ctor from a range of pointers.
R | R.m_begin will be the pointer and R.m_end - R.m_begin the size. |
Definition at line 178 of file c_array.hpp.
|
inline |
Equivalent to
I | index from the back to retrieve, I=0 corrseponds to the back of the array. |
Definition at line 325 of file c_array.hpp.
|
inline |
STL compliant function.
Definition at line 335 of file c_array.hpp.
|
inline |
STL compliant function.
Definition at line 292 of file c_array.hpp.
|
inline |
Pointer of the c_array.
Definition at line 242 of file c_array.hpp.
|
inline |
Const style cast for c_array. It is required that the sizeof(T) is the same as sizeof(S).
S | type to which to be const casted |
Definition at line 218 of file c_array.hpp.
|
inline |
STL compliant function.
Definition at line 274 of file c_array.hpp.
|
inline |
STL compliant function.
Definition at line 301 of file c_array.hpp.
|
inline |
Pointer to the element one past the last element of the c_array.
Definition at line 252 of file c_array.hpp.
|
inline |
For when T is vecN<S, N> for a type S, flattens the c_array<T> into a c_array<S> refering to the same data.
Definition at line 231 of file c_array.hpp.
|
inline |
STL compliant function.
Definition at line 344 of file c_array.hpp.
|
inline |
Access named element of c_array, under debug build also performs bounds checking.
j | index |
Definition at line 263 of file c_array.hpp.
|
inline |
Provided as a conveniance, equivalent to
It is an error to call this when size() is 0.
Definition at line 406 of file c_array.hpp.
|
inline |
Provided as a conveniance, equivalent to
It is an error to call this when size() is 0.
Definition at line 420 of file c_array.hpp.
|
inline |
Returns the range of the c_array as an iterator range.
Definition at line 311 of file c_array.hpp.
|
inline |
Reinterpret style cast for c_array. It is required that the sizeof(T)*size() evenly divides sizeof(S).
S | type to which to be reinterpreted casted |
Definition at line 202 of file c_array.hpp.
|
inline |
Resets the c_array object to be equivalent to a nullptr, i.e. c_ptr() will return nullptr and size() will return 0.
Definition at line 189 of file c_array.hpp.
|
inline |
Returns true if and only if the passed the c_array references exactly the same data as this c_array.
rhs | c_array to which to compare |
Definition at line 435 of file c_array.hpp.
|
inline |
STL compliant function.
Definition at line 283 of file c_array.hpp.
|
inline |
Returns a sub-array
pos | position of returned sub-array to start, i.e. returned c_array's c_ptr() will return this->c_ptr()+pos. It is an error if pos is negative. |
length | length of sub array to return, note that it is an error if length+pos>size() or if length is negative. |
Definition at line 360 of file c_array.hpp.
|
inline |
|
inline |
Returns a sub-array, equivalent to
I | type convertible to size_type |
R | range of returned sub-array |
Definition at line 393 of file c_array.hpp.