Pyrogenesis  trunk
Public Member Functions | Public Attributes | Private Types | Private Member Functions | List of all members
SparseGrid< T > Class Template Reference

Similar to Grid, except optimised for sparse usage (the grid is subdivided into buckets whose contents are only initialised on demand, to save on memset cost). More...

#include <Grid.h>

Public Member Functions

 SparseGrid (u16 w, u16 h)
 
 ~SparseGrid ()
 
void reset ()
 
void set (int i, int j, const T &value)
 
Tget (int i, int j)
 

Public Attributes

u16 m_W
 
u16 m_H
 
u16 m_BW
 
u16 m_BH
 
T ** m_Data
 
size_t m_DirtyID
 

Private Types

enum  { BucketBits = 4, BucketSize = 1 << BucketBits }
 

Private Member Functions

 NONCOPYABLE (SparseGrid)
 
TGetBucket (int i, int j)
 

Detailed Description

template<typename T>
class SparseGrid< T >

Similar to Grid, except optimised for sparse usage (the grid is subdivided into buckets whose contents are only initialised on demand, to save on memset cost).

Member Enumeration Documentation

template<typename T >
anonymous enum
private
Enumerator
BucketBits 
BucketSize 

Constructor & Destructor Documentation

template<typename T >
SparseGrid< T >::SparseGrid ( u16  w,
u16  h 
)
inline
template<typename T >
SparseGrid< T >::~SparseGrid ( )
inline

Member Function Documentation

template<typename T >
T& SparseGrid< T >::get ( int  i,
int  j 
)
inline
template<typename T >
T* SparseGrid< T >::GetBucket ( int  i,
int  j 
)
inlineprivate
template<typename T >
SparseGrid< T >::NONCOPYABLE ( SparseGrid< T )
private
template<typename T >
void SparseGrid< T >::reset ( )
inline
template<typename T >
void SparseGrid< T >::set ( int  i,
int  j,
const T value 
)
inline

Member Data Documentation

template<typename T >
u16 SparseGrid< T >::m_BH
template<typename T >
u16 SparseGrid< T >::m_BW
template<typename T >
T** SparseGrid< T >::m_Data
template<typename T >
size_t SparseGrid< T >::m_DirtyID
template<typename T >
u16 SparseGrid< T >::m_H
template<typename T >
u16 SparseGrid< T >::m_W

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