Support Forum       G3D Web Page     
Public Member Functions | List of all members
G3D::SmallArray< T, N > Class Template Reference

Embeds N elements to reduce allocation time and increase memory coherence when working with arrays of arrays. More...

Public Member Functions

 SmallArray ()
 
template<int J>
void append (const SmallArray< T, J > &other)
 
void append (const T &v)
 
void append (const T &v, const T &v2)
 
void append (const T &v, const T &v2, const T &v3)
 
void append (const T &v, const T &v2, const T &v3, const T &v4)
 
void clear (bool shrinkIfNecessary=true)
 
void clearAndSetMemoryManager (shared_ptr< MemoryManager > &m)
 
bool contains (const T &value) const
 
void fastRemove (int i, bool shrinkIfNecessary=false)
 
int findIndex (const T &v)
 Find the index of v or -1 if not found. More...
 
const T & last () const
 
T & last ()
 
T & next ()
 
template<int MIN_ELEMENTS>
SmallArray< T, N > & operator= (const Array< T, MIN_ELEMENTS > &src)
 
T & operator[] (int i)
 
const T & operator[] (int i) const
 
pop ()
 
void popDiscard ()
 
void push (const T &v)
 
void resize (int n, bool shrinkIfNecessary=true)
 
int size () const
 

Detailed Description

template<class T, int N>
class G3D::SmallArray< T, N >

Embeds N elements to reduce allocation time and increase memory coherence when working with arrays of arrays.

Offers a limited subset of the functionality of G3D::Array.

Constructor & Destructor Documentation

◆ SmallArray()

template<class T, int N>
G3D::SmallArray< T, N >::SmallArray ( )
inline

Member Function Documentation

◆ append() [1/5]

template<class T, int N>
template<int J>
void G3D::SmallArray< T, N >::append ( const SmallArray< T, J > &  other)
inline

◆ append() [2/5]

template<class T, int N>
void G3D::SmallArray< T, N >::append ( const T &  v)
inline

◆ append() [3/5]

template<class T, int N>
void G3D::SmallArray< T, N >::append ( const T &  v,
const T &  v2 
)
inline

◆ append() [4/5]

template<class T, int N>
void G3D::SmallArray< T, N >::append ( const T &  v,
const T &  v2,
const T &  v3 
)
inline

◆ append() [5/5]

template<class T, int N>
void G3D::SmallArray< T, N >::append ( const T &  v,
const T &  v2,
const T &  v3,
const T &  v4 
)
inline

◆ clear()

template<class T, int N>
void G3D::SmallArray< T, N >::clear ( bool  shrinkIfNecessary = true)
inline

◆ clearAndSetMemoryManager()

template<class T, int N>
void G3D::SmallArray< T, N >::clearAndSetMemoryManager ( shared_ptr< MemoryManager > &  m)
inline

◆ contains()

template<class T, int N>
bool G3D::SmallArray< T, N >::contains ( const T &  value) const
inline

◆ fastRemove()

template<class T, int N>
void G3D::SmallArray< T, N >::fastRemove ( int  i,
bool  shrinkIfNecessary = false 
)
inline

◆ findIndex()

template<class T, int N>
int G3D::SmallArray< T, N >::findIndex ( const T &  v)
inline

Find the index of v or -1 if not found.

◆ last() [1/2]

template<class T, int N>
const T& G3D::SmallArray< T, N >::last ( ) const
inline

◆ last() [2/2]

template<class T, int N>
T& G3D::SmallArray< T, N >::last ( )
inline

◆ next()

template<class T, int N>
T& G3D::SmallArray< T, N >::next ( )
inline

◆ operator=()

template<class T, int N>
template<int MIN_ELEMENTS>
SmallArray<T, N>& G3D::SmallArray< T, N >::operator= ( const Array< T, MIN_ELEMENTS > &  src)
inline

◆ operator[]() [1/2]

template<class T, int N>
T& G3D::SmallArray< T, N >::operator[] ( int  i)
inline

◆ operator[]() [2/2]

template<class T, int N>
const T& G3D::SmallArray< T, N >::operator[] ( int  i) const
inline

◆ pop()

template<class T, int N>
T G3D::SmallArray< T, N >::pop ( )
inline

◆ popDiscard()

template<class T, int N>
void G3D::SmallArray< T, N >::popDiscard ( )
inline

◆ push()

template<class T, int N>
void G3D::SmallArray< T, N >::push ( const T &  v)
inline

◆ resize()

template<class T, int N>
void G3D::SmallArray< T, N >::resize ( int  n,
bool  shrinkIfNecessary = true 
)
inline

◆ size()

template<class T, int N>
int G3D::SmallArray< T, N >::size ( ) const
inline

documentation generated on Wed Nov 24 2021 08:02:00 using doxygen 1.8.15