Recast Navigation
Navigation-mesh Toolset for Games
rcVectorBase< T, H > Class Template Reference

Variable-sized storage type. More...

#include <RecastAlloc.h>

Inheritance diagram for rcVectorBase< T, H >:
rcTempVector< int >

Public Types

typedef rcSizeType size_type
 
typedef T value_type
 

Public Member Functions

 rcVectorBase ()
 
 rcVectorBase (const rcVectorBase< T, H > &other)
 
 rcVectorBase (rcSizeType count)
 
 rcVectorBase (rcSizeType count, const T &value)
 
 rcVectorBase (const T *begin, const T *end)
 
 ~rcVectorBase ()
 
bool reserve (rcSizeType size)
 
void assign (rcSizeType count, const T &value)
 
void assign (const T *begin, const T *end)
 
void resize (rcSizeType size)
 
void resize (rcSizeType size, const T &value)
 
void clear ()
 
void push_back (const T &value)
 
void pop_back ()
 
rcSizeType size () const
 
rcSizeType capacity () const
 
bool empty () const
 
const T & operator[] (rcSizeType i) const
 
T & operator[] (rcSizeType i)
 
const T & front () const
 
T & front ()
 
const T & back () const
 
T & back ()
 
const T * data () const
 
T * data ()
 
T * begin ()
 
T * end ()
 
const T * begin () const
 
const T * end () const
 
void swap (rcVectorBase< T, H > &other)
 
rcVectorBaseoperator= (const rcVectorBase< T, H > &other)
 

Description

template<typename T, rcAllocHint H>
class rcVectorBase< T, H >

Variable-sized storage type.

Mimics the interface of std::vector<T> with some notable differences:

  • Uses rcAlloc()/rcFree() to handle storage.
  • No support for a custom allocator.
  • Uses signed size instead of size_t to avoid warnings in for loops: "for (int i = 0; i < foo.size(); i++)"
  • Omits methods of limited utility: insert/erase, (bad performance), at (we don't use exceptions), operator=.
  • assign() and the pre-sizing constructor follow C++11 semantics – they don't construct a temporary if no value is provided.
  • push_back() and resize() support adding values from the current vector. Range-based constructors and assign(begin, end) do not.
  • No specialization for bool.

Member Typedef Documentation

◆ size_type

template<typename T , rcAllocHint H>
typedef rcSizeType rcVectorBase< T, H >::size_type

◆ value_type

template<typename T , rcAllocHint H>
typedef T rcVectorBase< T, H >::value_type

Constructor & Destructor Documentation

◆ rcVectorBase() [1/5]

template<typename T , rcAllocHint H>
rcVectorBase< T, H >::rcVectorBase ( )
inline

◆ rcVectorBase() [2/5]

template<typename T , rcAllocHint H>
rcVectorBase< T, H >::rcVectorBase ( const rcVectorBase< T, H > &  other)
inline

◆ rcVectorBase() [3/5]

template<typename T , rcAllocHint H>
rcVectorBase< T, H >::rcVectorBase ( rcSizeType  count)
inlineexplicit

◆ rcVectorBase() [4/5]

template<typename T , rcAllocHint H>
rcVectorBase< T, H >::rcVectorBase ( rcSizeType  count,
const T &  value 
)
inline

◆ rcVectorBase() [5/5]

template<typename T , rcAllocHint H>
rcVectorBase< T, H >::rcVectorBase ( const T *  begin,
const T *  end 
)
inline

◆ ~rcVectorBase()

template<typename T , rcAllocHint H>
rcVectorBase< T, H >::~rcVectorBase ( )
inline

Member Function Documentation

◆ assign() [1/2]

template<typename T , rcAllocHint H>
void rcVectorBase< T, H >::assign ( const T *  begin,
const T *  end 
)

◆ assign() [2/2]

template<typename T , rcAllocHint H>
void rcVectorBase< T, H >::assign ( rcSizeType  count,
const T &  value 
)
inline

◆ back() [1/2]

template<typename T , rcAllocHint H>
T& rcVectorBase< T, H >::back ( )
inline

◆ back() [2/2]

template<typename T , rcAllocHint H>
const T& rcVectorBase< T, H >::back ( ) const
inline

◆ begin() [1/2]

template<typename T , rcAllocHint H>
T* rcVectorBase< T, H >::begin ( )
inline

◆ begin() [2/2]

template<typename T , rcAllocHint H>
const T* rcVectorBase< T, H >::begin ( ) const
inline

◆ capacity()

template<typename T , rcAllocHint H>
rcSizeType rcVectorBase< T, H >::capacity ( ) const
inline

◆ clear()

template<typename T , rcAllocHint H>
void rcVectorBase< T, H >::clear ( )
inline

◆ data() [1/2]

template<typename T , rcAllocHint H>
T* rcVectorBase< T, H >::data ( )
inline

◆ data() [2/2]

template<typename T , rcAllocHint H>
const T* rcVectorBase< T, H >::data ( ) const
inline

◆ empty()

template<typename T , rcAllocHint H>
bool rcVectorBase< T, H >::empty ( ) const
inline

◆ end() [1/2]

template<typename T , rcAllocHint H>
T* rcVectorBase< T, H >::end ( )
inline

◆ end() [2/2]

template<typename T , rcAllocHint H>
const T* rcVectorBase< T, H >::end ( ) const
inline

◆ front() [1/2]

template<typename T , rcAllocHint H>
T& rcVectorBase< T, H >::front ( )
inline

◆ front() [2/2]

template<typename T , rcAllocHint H>
const T& rcVectorBase< T, H >::front ( ) const
inline

◆ operator=()

template<typename T , rcAllocHint H>
rcVectorBase& rcVectorBase< T, H >::operator= ( const rcVectorBase< T, H > &  other)

◆ operator[]() [1/2]

template<typename T , rcAllocHint H>
T& rcVectorBase< T, H >::operator[] ( rcSizeType  i)
inline

◆ operator[]() [2/2]

template<typename T , rcAllocHint H>
const T& rcVectorBase< T, H >::operator[] ( rcSizeType  i) const
inline

◆ pop_back()

template<typename T , rcAllocHint H>
void rcVectorBase< T, H >::pop_back ( )
inline

◆ push_back()

template<typename T , rcAllocHint H>
void rcVectorBase< T, H >::push_back ( const T &  value)

◆ reserve()

template<typename T , rcAllocHint H>
bool rcVectorBase< T, H >::reserve ( rcSizeType  size)

◆ resize() [1/2]

template<typename T , rcAllocHint H>
void rcVectorBase< T, H >::resize ( rcSizeType  size)
inline

◆ resize() [2/2]

template<typename T , rcAllocHint H>
void rcVectorBase< T, H >::resize ( rcSizeType  size,
const T &  value 
)
inline

◆ size()

template<typename T , rcAllocHint H>
rcSizeType rcVectorBase< T, H >::size ( ) const
inline

◆ swap()

template<typename T , rcAllocHint H>
void rcVectorBase< T, H >::swap ( rcVectorBase< T, H > &  other)

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