Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
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

◆ anonymous enum

template<typename T >
anonymous enum
private
Enumerator
BucketBits 
BucketSize 

Constructor & Destructor Documentation

◆ SparseGrid()

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

◆ ~SparseGrid()

template<typename T >
SparseGrid< T >::~SparseGrid ( )
inline

Member Function Documentation

◆ get()

template<typename T >
T & SparseGrid< T >::get ( int  i,
int  j 
)
inline

◆ GetBucket()

template<typename T >
T * SparseGrid< T >::GetBucket ( int  i,
int  j 
)
inlineprivate

◆ NONCOPYABLE()

template<typename T >
SparseGrid< T >::NONCOPYABLE ( SparseGrid< T )
private

◆ reset()

template<typename T >
void SparseGrid< T >::reset ( )
inline

◆ set()

template<typename T >
void SparseGrid< T >::set ( int  i,
int  j,
const T value 
)
inline

Member Data Documentation

◆ m_BH

template<typename T >
u16 SparseGrid< T >::m_BH

◆ m_BW

template<typename T >
u16 SparseGrid< T >::m_BW

◆ m_Data

template<typename T >
T** SparseGrid< T >::m_Data

◆ m_DirtyID

template<typename T >
size_t SparseGrid< T >::m_DirtyID

◆ m_H

template<typename T >
u16 SparseGrid< T >::m_H

◆ m_W

template<typename T >
u16 SparseGrid< T >::m_W

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