RavEngine
Loading...
Searching...
No Matches
rcVectorBase< T, H > Class Template Reference

#include <RecastAlloc.h>

Inheritance diagram for rcVectorBase< T, H >:
[legend]

Public Types

typedef rcSizeType size_type
 
typedef T value_type
 

Public Member Functions

 rcVectorBase (const rcVectorBase< T, H > &other)
 
 rcVectorBase (rcSizeType count)
 
 rcVectorBase (rcSizeType count, const T &value)
 
 rcVectorBase (const T *begin, const T *end)
 
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)
 
rcVectorBase & operator= (const rcVectorBase< T, H > &other)
 

Detailed 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.

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