MySQL  8.0.17
Source Code Documentation
Bounds_checked_array< Element_type > Class Template Reference

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)
 
void reset ()
 
void reset (Element_type *array, size_t size)
 
void resize (size_t new_size)
 Set a new bound on the array. More...
 
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...
 
size_t element_size () const
 
size_t size () 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
 

Private Attributes

Element_type * m_array
 
size_t m_size
 

Detailed Description

template<typename Element_type>
class Bounds_checked_array< Element_type >

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.

Remarks
We want the compiler-generated versions of:
  • the copy CTOR (memberwise initialization)
  • the assignment operator (memberwise assignment)
Template Parameters
Element_typeThe type of the elements of the container.

Member Typedef Documentation

◆ const_iterator

template<typename Element_type>
typedef const Element_type* Bounds_checked_array< Element_type >::const_iterator

◆ iterator

template<typename Element_type>
typedef Element_type* Bounds_checked_array< Element_type >::iterator

◆ value_type

template<typename Element_type>
typedef Element_type Bounds_checked_array< Element_type >::value_type

Constructor & Destructor Documentation

◆ Bounds_checked_array() [1/2]

template<typename Element_type>
Bounds_checked_array< Element_type >::Bounds_checked_array ( )
inline

◆ Bounds_checked_array() [2/2]

template<typename Element_type>
Bounds_checked_array< Element_type >::Bounds_checked_array ( Element_type *  el,
size_t  size_arg 
)
inline

Member Function Documentation

◆ array()

template<typename Element_type>
Element_type* Bounds_checked_array< Element_type >::array ( ) const
inline

◆ begin() [1/2]

template<typename Element_type>
iterator Bounds_checked_array< Element_type >::begin ( void  )
inline

begin : Returns a pointer to the first element in the array.

◆ begin() [2/2]

template<typename Element_type>
const_iterator Bounds_checked_array< Element_type >::begin ( void  ) const
inline

begin : Returns a pointer to the first element in the array.

◆ element_size()

template<typename Element_type>
size_t Bounds_checked_array< Element_type >::element_size ( ) const
inline

◆ end() [1/2]

template<typename Element_type>
iterator Bounds_checked_array< Element_type >::end ( void  )
inline

end : Returns a pointer to the past-the-end element in the array.

◆ end() [2/2]

template<typename Element_type>
const_iterator Bounds_checked_array< Element_type >::end ( void  ) const
inline

end : Returns a pointer to the past-the-end element in the array.

◆ is_null()

template<typename Element_type>
bool Bounds_checked_array< Element_type >::is_null ( ) const
inline

◆ operator!=()

template<typename Element_type>
bool Bounds_checked_array< Element_type >::operator!= ( const Bounds_checked_array< Element_type > &  rhs) const
inline

◆ operator==()

template<typename Element_type>
bool Bounds_checked_array< Element_type >::operator== ( const Bounds_checked_array< Element_type > &  rhs) const
inline

◆ operator[]() [1/2]

template<typename Element_type>
Element_type& Bounds_checked_array< Element_type >::operator[] ( size_t  n)
inline

◆ operator[]() [2/2]

template<typename Element_type>
const Element_type& Bounds_checked_array< Element_type >::operator[] ( size_t  n) const
inline

◆ pop_front()

template<typename Element_type>
void Bounds_checked_array< Element_type >::pop_front ( )
inline

◆ reset() [1/2]

template<typename Element_type>
void Bounds_checked_array< Element_type >::reset ( void  )
inline

◆ reset() [2/2]

template<typename Element_type>
void Bounds_checked_array< Element_type >::reset ( Element_type *  array,
size_t  size 
)
inline

◆ resize()

template<typename Element_type>
void Bounds_checked_array< Element_type >::resize ( size_t  new_size)
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.

◆ size()

template<typename Element_type>
size_t Bounds_checked_array< Element_type >::size ( ) const
inline

Member Data Documentation

◆ m_array

template<typename Element_type>
Element_type* Bounds_checked_array< Element_type >::m_array
private

◆ m_size

template<typename Element_type>
size_t Bounds_checked_array< Element_type >::m_size
private

The documentation for this class was generated from the following file: