nlib
|
The class for realloc
-based implementations of vectors with POD
-type elements.
More...
#include "nn/nlib/ReallocVec.h"
Public Types | |
typedef void *(* | ReallocFunc) (void *, size_t) |
The type for functions corresponding to realloc . | |
Typedef | |
typedef T | value_type |
Element type T. | |
typedef size_t | size_type |
Unsigned integer type (size_t ). | |
typedef ptrdiff_t | difference_type |
Signed integer type (ptrdiff_t ). | |
typedef T & | reference |
T& . | |
typedef const T & | const_reference |
const T& . | |
typedef T * | pointer |
T* . | |
typedef const T * | const_pointer |
const T* . | |
typedef T * | iterator |
Random-access iterator. | |
typedef const T * | const_iterator |
Read-only random-access iterator. | |
typedef std::reverse_iterator< iterator > | reverse_iterator |
std::reverse_iterator<iterator> | |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
std::reverse_iterator<const_iterator> | |
Public Member Functions | |
constexpr | ReallocVec () noexcept |
Uses std::realloc with the default constructor. | |
constexpr | ReallocVec (ReallocFunc func) noexcept |
Enables the user to specify the realloc function with the constructor. More... | |
ReallocFunc | GetRealloc () const noexcept |
Gets the specified realloc function. More... | |
bool | push_back (const T &v) noexcept |
Adds an element to the vector. More... | |
bool | pop_back () noexcept |
Deletes an element from the end of the vector. More... | |
T & | operator[] (size_t idx) |
Gets the nth element, where n is specified by idx. More... | |
const T & | operator[] (size_t idx) const |
See operator[](size_t idx) = . | |
T & | front () |
Gets the first element. More... | |
const T & | front () const |
See front . | |
T & | back () |
Gets the last element. More... | |
const T & | back () const |
See back . | |
iterator | begin () noexcept |
Gets the iterator pointing to the first element. More... | |
const_iterator | begin () const noexcept |
See begin . | |
const_iterator | cbegin () const noexcept |
Gets the read-only iterator pointing to the first element. More... | |
iterator | end () noexcept |
Gets the iterator pointing beyond the last element. More... | |
const_iterator | end () const noexcept |
See end . | |
const_iterator | cend () const noexcept |
Gets the read-only iterator pointing beyond the last element. More... | |
reverse_iterator | rbegin () noexcept |
Gets the reverse iterator pointing to the last element. More... | |
const_reverse_iterator | rbegin () const noexcept |
See rbegin . | |
reverse_iterator | rend () noexcept |
Gets the reverse iterator pointing ahead of the first element. More... | |
const_reverse_iterator | rend () const noexcept |
See rend . | |
const_reverse_iterator | crbegin () const noexcept |
Gets the read-only reverse iterator pointing to the last element. More... | |
const_reverse_iterator | crend () const noexcept |
Gets the read-only iterator pointing ahead of the first element. More... | |
void | swap (ReallocVec &rhs) noexcept |
Swaps vectors. More... | |
size_t | size () const noexcept |
Gets the size of the vector. More... | |
size_t | capacity () const noexcept |
Gets the maximum number of elements that can be stored without reallocating memory. More... | |
bool | empty () const noexcept |
Determines whether the vector is empty. More... | |
bool | reserve (size_t n) noexcept |
Makes it possible to store as many as n elements without reallocating memory. More... | |
bool | resize (size_t n) noexcept |
Changes the number of elements. More... | |
void | clear () noexcept |
Empties the vector. Note that the memory remains allocated. More... | |
void | shrink_to_fit () noexcept |
Adjusts the size of allocated memory to exactly fit the current number of elements. | |
iterator | insert (iterator pos, const T &val) |
Inserts an element in the position specified by pos. More... | |
The class for realloc
-based implementations of vectors with POD
-type elements.
T | The element type. This type must be POD . |
realloc
. Definition at line 18 of file ReallocVec.h.
|
inlineexplicitnoexcept |
Enables the user to specify the realloc
function with the constructor.
[in] | func | The realloc function. |
Definition at line 135 of file ReallocVec.h.
|
inline |
|
inlinenoexcept |
Gets the iterator pointing to the first element.
Definition at line 67 of file ReallocVec.h.
|
inlinenoexcept |
Gets the maximum number of elements that can be stored without reallocating memory.
Definition at line 95 of file ReallocVec.h.
|
inlinenoexcept |
Gets the read-only iterator pointing to the first element.
Definition at line 69 of file ReallocVec.h.
|
inlinenoexcept |
Gets the read-only iterator pointing beyond the last element.
Definition at line 72 of file ReallocVec.h.
|
inlinenoexcept |
Empties the vector. Note that the memory remains allocated.
Empties the vector.
Definition at line 105 of file ReallocVec.h.
|
inlinenoexcept |
Gets the read-only reverse iterator pointing to the last element.
Definition at line 81 of file ReallocVec.h.
|
inlinenoexcept |
Gets the read-only iterator pointing ahead of the first element.
Definition at line 84 of file ReallocVec.h.
|
inlinenoexcept |
Determines whether the vector is empty.
true
if empty. Definition at line 96 of file ReallocVec.h.
|
inlinenoexcept |
Gets the iterator pointing beyond the last element.
Definition at line 70 of file ReallocVec.h.
|
inline |
|
inlinenoexcept |
Gets the specified realloc
function.
realloc
function. Definition at line 45 of file ReallocVec.h.
|
inline |
Inserts an element in the position specified by pos.
[in] | pos | The insertion position. |
[in] | val | The element to insert. |
Definition at line 117 of file ReallocVec.h.
|
inline |
Gets the nth element, where n is specified by idx.
[in] | idx | An index. |
Definition at line 60 of file ReallocVec.h.
|
inlinenoexcept |
Deletes an element from the end of the vector.
true
if deleted successfully. Definition at line 55 of file ReallocVec.h.
|
inlinenoexcept |
Adds an element to the vector.
[in] | v | The element to add. |
true
if added successfully. Definition at line 46 of file ReallocVec.h.
|
inlinenoexcept |
Gets the reverse iterator pointing to the last element.
Definition at line 73 of file ReallocVec.h.
|
inlinenoexcept |
Gets the reverse iterator pointing ahead of the first element.
Definition at line 77 of file ReallocVec.h.
|
inlinenoexcept |
Makes it possible to store as many as n elements without reallocating memory.
[in] | n | Number of elements. |
true
when successful. Definition at line 97 of file ReallocVec.h.
|
inlinenoexcept |
Changes the number of elements.
[in] | n | Number of elements. |
true
when successful.Definition at line 100 of file ReallocVec.h.
|
inlinenoexcept |
Gets the size of the vector.
Definition at line 94 of file ReallocVec.h.
|
inlinenoexcept |
© 2012-2016 Nintendo Co., Ltd. All rights reserved.