MySQL 8.4.2
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 >:
[legend]

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_array (MEM_ROOT *root)
 
 Mem_root_array (Mem_root_array &&other)
 Move constructor and assignment. More...
 
Mem_root_arrayoperator= (Mem_root_array &&other)
 
 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 (std::initializer_list< Element_type > elements)
 
 ~Mem_root_array ()
 
 Mem_root_array (const Mem_root_array &)=delete
 
Mem_root_arrayoperator= (const Mem_root_array &)=delete
 
- 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...
 
Element_type * data ()
 
const Element_type * data () const
 
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...
 
template<typename... Args>
bool emplace_back (Args &&... args)
 Constructs an element at the back of the array in-place. More...
 
bool push_front (const Element_type &element)
 Adds a new element at the beginning of the array. More...
 
bool push_front (Element_type &&element)
 Adds a new element at the front of the array. 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
 

Additional Inherited Members

- Protected Attributes inherited from Mem_root_array_YY< Element_type >
MEM_ROOTm_root
 
Element_type * m_array
 
size_t m_size
 
size_t m_capacity
 

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/9]

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

◆ Mem_root_array() [2/9]

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

◆ Mem_root_array() [3/9]

template<typename Element_type >
Mem_root_array< Element_type >::Mem_root_array ( Mem_root_array< Element_type > &&  other)
inline

Move constructor and assignment.

◆ Mem_root_array() [4/9]

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

◆ Mem_root_array() [5/9]

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() [6/9]

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() [7/9]

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() [8/9]

template<typename Element_type >
Mem_root_array< Element_type >::Mem_root_array ( std::initializer_list< Element_type >  elements)
inline

◆ ~Mem_root_array()

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

◆ Mem_root_array() [9/9]

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

Member Function Documentation

◆ operator=() [1/2]

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

◆ operator=() [2/2]

template<typename Element_type >
Mem_root_array & Mem_root_array< Element_type >::operator= ( Mem_root_array< Element_type > &&  other)
inline

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