MySQL 9.1.0
Source Code Documentation
|
A wrapper class which provides array bounds checking. More...
#include <sql_array.h>
Public Types | |
typedef Element_type | value_type |
typedef Element_type * | iterator |
typedef const Element_type * | const_iterator |
Public Member Functions | |
Bounds_checked_array () | |
Bounds_checked_array (Element_type *el, size_t size_arg) | |
template<class T , size_t N> | |
Bounds_checked_array (std::array< T, N > &arr) | |
Bounds_checked_array | Clone (MEM_ROOT *mem_root) const |
Make a copy of '*this'. Allocate memory for m_array on 'mem_root'. More... | |
void | reset () |
void | reset (Element_type *array, size_t size) |
void | resize (size_t new_size) |
Set a new bound on the array. More... | |
Bounds_checked_array | prefix (size_t new_size) |
Like resize(), but returns a new view of the array without modifying this one. More... | |
Element_type * | data () |
const Element_type * | data () const |
Element_type & | operator[] (size_t n) |
const Element_type & | operator[] (size_t n) const |
iterator | begin () |
begin : Returns a pointer to the first element in the array. More... | |
iterator | end () |
end : Returns a pointer to the past-the-end element in the array. More... | |
const_iterator | begin () const |
begin : Returns a pointer to the first element in the array. More... | |
const_iterator | end () const |
end : Returns a pointer to the past-the-end element in the array. More... | |
const_iterator | cbegin () const |
Returns a pointer to the first element in the array. More... | |
const_iterator | cend () const |
Returns a pointer to the past-the-end element in the array. More... | |
Bounds_checked_array | without_back () const |
size_t | element_size () const |
size_t | size () const |
bool | empty () const |
bool | is_null () const |
void | pop_front () |
Element_type * | array () const |
bool | operator== (const Bounds_checked_array< Element_type > &rhs) const |
bool | operator!= (const Bounds_checked_array< Element_type > &rhs) const |
Static Public Member Functions | |
static Bounds_checked_array | Alloc (MEM_ROOT *mem_root, size_t size) |
Private Attributes | |
Element_type * | m_array |
size_t | m_size |
A wrapper class which provides array bounds checking.
We do not own the array, we simply have a pointer to the first element, and a length.
This is roughly analogous to C++20's std::span.
Element_type | The type of the elements of the container. |
typedef const Element_type* Bounds_checked_array< Element_type >::const_iterator |
typedef Element_type* Bounds_checked_array< Element_type >::iterator |
typedef Element_type Bounds_checked_array< Element_type >::value_type |
|
inline |
|
inline |
|
inlineexplicit |
|
inlinestatic |
|
inline |
|
inline |
begin : Returns a pointer to the first element in the array.
|
inline |
begin : Returns a pointer to the first element in the array.
|
inline |
Returns a pointer to the first element in the array.
|
inline |
Returns a pointer to the past-the-end element in the array.
|
inline |
Make a copy of '*this'. Allocate memory for m_array on 'mem_root'.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
end : Returns a pointer to the past-the-end element in the array.
|
inline |
end : Returns a pointer to the past-the-end element in the array.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Like resize(), but returns a new view of the array without modifying this one.
|
inline |
|
inline |
|
inline |
Set a new bound on the array.
Does not resize the underlying array, so the new size must be smaller than or equal to the current size.
|
inline |
|
inline |
|
private |
|
private |