PlayRho  1.1.0
An Interactive Real-Time-Oriented C++ Physics Engine & Library
playrho::AllocatedArray< T, Deleter > Class Template Reference

Allocated Array. More...

#include <AllocatedArray.hpp>

Collaboration diagram for playrho::AllocatedArray< T, Deleter >:
[legend]

Public Types

using size_type = std::size_t
 Size type.
 
using value_type = T
 Value type.
 
using const_value_type = const value_type
 Constant value type.
 
using reference = value_type &
 Reference type.
 
using const_reference = const value_type &
 Constant reference type.
 
using pointer = value_type *
 Pointer type.
 
using const_pointer = const value_type *
 Constant pointer type.
 
using difference_type = std::ptrdiff_t
 Difference type.
 
using deleter_type = Deleter
 Deleter type.
 
using iterator = pointer
 Iterator alias.
 
using const_iterator = const_pointer
 Constant iterator alias.
 

Public Member Functions

constexpr AllocatedArray (size_type max_size, pointer data, deleter_type deleter=noop_deleter)
 Initializing constructor.
 
 ~AllocatedArray () noexcept
 Destructor.
 
 AllocatedArray (const AllocatedArray &copy)=delete
 
 AllocatedArray (AllocatedArray &&other) noexcept
 Move constructor.
 
size_type size () const noexcept
 Gets the current size of this array.
 
size_type max_size () const noexcept
 Gets the maximum size this array can possibly get to.
 
bool empty () const noexcept
 Determines whether this array is empty.
 
pointer data () const noexcept
 Gets a direct pointer to this array's memory.
 
reference operator[] (size_type i)
 Indexed operator.
 
const_reference operator[] (size_type i) const
 Indexed operator.
 
iterator begin ()
 Gets the "begin" iterator value for this array.
 
iterator end ()
 Gets the "end" iterator value for this array.
 
const_iterator begin () const
 Gets the "begin" iterator value for this array.
 
const_iterator end () const
 Gets the "end" iterator value for this array.
 
const_iterator cbegin () const
 Gets the "begin" iterator value for this array.
 
const_iterator cend () const
 Gets the "end" iterator value for this array.
 
reference back () noexcept
 Gets a reference to the "back" element of this array. More...
 
const_reference back () const noexcept
 Gets a reference to the "back" element of this array. More...
 
void clear () noexcept
 Clears this array.
 
void push_back (const_reference value)
 Push "back" the given value.
 
void pop_back () noexcept
 Pop "back".
 

Static Private Member Functions

static void noop_deleter (void *)
 No-op deleter method.
 

Private Attributes

size_type m_max_size = 0
 Max size. 8-bytes.
 
size_type m_size = 0
 Current size. 8-bytes.
 
pointer m_data = nullptr
 Pointer to allocated data space. 8-bytes.
 
deleter_type m_deleter
 Deleter. 8-bytes (with default Deleter).
 

Detailed Description

template<typename T, typename Deleter = std::function<void(void*)>>
class playrho::AllocatedArray< T, Deleter >

Allocated Array.

Member Function Documentation

◆ back() [1/2]

template<typename T , typename Deleter = std::function<void(void*)>>
const_reference playrho::AllocatedArray< T, Deleter >::back ( ) const
inlinenoexcept

Gets a reference to the "back" element of this array.

Warning
Behavior is undefined if the size of this array is less than 1.

◆ back() [2/2]

template<typename T , typename Deleter = std::function<void(void*)>>
reference playrho::AllocatedArray< T, Deleter >::back ( )
inlinenoexcept

Gets a reference to the "back" element of this array.

Warning
Behavior is undefined if the size of this array is less than 1.

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