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

A typesafe replacement for DYNAMIC_ARRAY. More...

#include <mem_root_array.h>

Inheritance diagram for Mem_root_array< Element_type >:
Mem_root_array_YY< Element_type >

Public Types

typedef Element_type value_type
 Convenience typedef, same typedef name as std::vector. More...
 
typedef super::const_iterator const_iterator
 
- Public Types inherited from Mem_root_array_YY< Element_type >
typedef Element_type value_type
 Convenience typedef, same typedef name as std::vector. More...
 
typedef Element_type * iterator
 Random access iterators to value_type and const value_type. More...
 
typedef const Element_type * const_iterator
 

Public Member Functions

 Mem_root_array (MEM_ROOT *root)
 
 Mem_root_array (MEM_ROOT *root, size_t n)
 
 Mem_root_array (MEM_ROOT *root, size_t n, const value_type &val)
 
 Mem_root_array (MEM_ROOT *root, const_iterator first, const_iterator last)
 Range constructor. More...
 
 Mem_root_array (MEM_ROOT *root, const Mem_root_array &x)
 
 ~Mem_root_array ()
 
- Public Member Functions inherited from Mem_root_array_YY< Element_type >
void init (MEM_ROOT *root)
 
void init_empty_const ()
 Initialize empty array that we aren't going to grow. More...
 
void set_mem_root (MEM_ROOT *new_root)
 Switches mem-root, in case original mem-root was copied. More...
 
Element_type & at (size_t n)
 
const Element_type & at (size_t n) const
 
Element_type & operator[] (size_t n)
 
const Element_type & operator[] (size_t n) const
 
Element_type & back ()
 
const Element_type & back () const
 
Element_type * begin ()
 Returns a pointer to the first element in the array. More...
 
const Element_type * begin () const
 
Element_type * end ()
 Returns a pointer to the past-the-end element in the array. More...
 
const Element_type * end () const
 
const_iterator cbegin () const
 Returns a constant pointer to the first element in the array. More...
 
const_iterator cend () const
 Returns a constant pointer to the past-the-end element in the array. More...
 
void clear ()
 Erases all of the elements. More...
 
void chop (const size_t pos)
 Chops the tail off the array, erasing all tail elements. More...
 
bool reserve (size_t n)
 Reserves space for array elements. More...
 
bool push_back (const Element_type &element)
 Adds a new element at the end of the array, after its current last element. More...
 
bool push_back (Element_type &&element)
 Adds a new element at the end of the array, after its current last element. More...
 
void pop_back ()
 Removes the last element in the array, effectively reducing the container size by one. More...
 
void resize (size_t n, const value_type &val)
 Resizes the container so that it contains n elements. More...
 
void resize (size_t n)
 Same as resize(size_t, const value_type &val), but default-constructs the new elements. More...
 
iterator erase (const_iterator first, const_iterator last)
 Erase all the elements in the specified range. More...
 
iterator erase (const_iterator position)
 Removes a single element from the array. More...
 
iterator erase (size_t ix)
 Removes a single element from the array. More...
 
iterator insert (const_iterator pos, const Element_type &value)
 Insert an element at a given position. More...
 
size_t erase_value (const value_type &val)
 Removes a single element from the array by value. More...
 
iterator erase (iterator position)
 Removes a single element from the array. More...
 
size_t capacity () const
 
size_t element_size () const
 
bool empty () const
 
size_t size () const
 

Private Types

typedef Mem_root_array_YY< Element_type > super
 

Private Member Functions

 Mem_root_array (const Mem_root_array &)
 
Mem_root_arrayoperator= (const Mem_root_array &)
 

Detailed Description

template<typename Element_type>
class Mem_root_array< Element_type >

A typesafe replacement for DYNAMIC_ARRAY.

See also
Mem_root_array_YY.

Member Typedef Documentation

◆ const_iterator

template<typename Element_type>
typedef super::const_iterator Mem_root_array< Element_type >::const_iterator

◆ super

template<typename Element_type>
typedef Mem_root_array_YY<Element_type> Mem_root_array< Element_type >::super
private

◆ value_type

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

Convenience typedef, same typedef name as std::vector.

Constructor & Destructor Documentation

◆ Mem_root_array() [1/6]

template<typename Element_type>
Mem_root_array< Element_type >::Mem_root_array ( MEM_ROOT root)
inlineexplicit

◆ Mem_root_array() [2/6]

template<typename Element_type>
Mem_root_array< Element_type >::Mem_root_array ( MEM_ROOT root,
size_t  n 
)
inline

◆ Mem_root_array() [3/6]

template<typename Element_type>
Mem_root_array< Element_type >::Mem_root_array ( MEM_ROOT root,
size_t  n,
const value_type val 
)
inline

◆ Mem_root_array() [4/6]

template<typename Element_type>
Mem_root_array< Element_type >::Mem_root_array ( MEM_ROOT root,
const_iterator  first,
const_iterator  last 
)
inline

Range constructor.

Constructs a container with as many elements as the range [first,last), with each element constructed from its corresponding element in that range, in the same order.

Parameters
rootMEM_ROOT to use for memory allocation.
firstiterator that points to the first element to copy
lastiterator that points to the element after the last one to copy

◆ Mem_root_array() [5/6]

template<typename Element_type>
Mem_root_array< Element_type >::Mem_root_array ( MEM_ROOT root,
const Mem_root_array< Element_type > &  x 
)
inline

◆ ~Mem_root_array()

template<typename Element_type>
Mem_root_array< Element_type >::~Mem_root_array ( )
inline

◆ Mem_root_array() [6/6]

template<typename Element_type>
Mem_root_array< Element_type >::Mem_root_array ( const Mem_root_array< Element_type > &  )
private

Member Function Documentation

◆ operator=()

template<typename Element_type>
Mem_root_array& Mem_root_array< Element_type >::operator= ( const Mem_root_array< Element_type > &  )
private

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