
#include <cklists.h>


Public Member Functions | |
| CkPagedVector () | |
| CkPagedVector (int nEntries) | |
| ~CkPagedVector () | |
| void | init (int nEntries) |
| T & | operator[] (unsigned int i) |
| T | get (unsigned int i) |
| void | pupPage (PUP::er &p, int pg) |
| void | pup (PUP::er &p) |
Private Types | |
| enum | { pageSize = 256u } |
| This is the number of array entries per page. More... | |
Private Member Functions | |
| void | allocatePages (int nEntries) |
| void | allocatePage (int pg) |
Private Attributes | |
| T ** | pages |
| int | nPages |
Useful for saving memory when storing a long array with few used entries. Should be almost as fast as a regular vector.
When nothing is used, this reduces storage space by a factor of pageSize*sizeof(T)/sizeof(T*). For example, an array of 64-bit ints of length 1M takes 8MB; with paging it takes just 32KB, plus 2KB for each used block.
The class T must have a pup routine, a default constructor, and a copy constructor.
Definition at line 571 of file cklists.h.
anonymous enum [private] |
| CkPagedVector< T >::CkPagedVector | ( | ) | [inline] |
| CkPagedVector< T >::CkPagedVector | ( | int | nEntries | ) | [inline] |
| CkPagedVector< T >::~CkPagedVector | ( | ) | [inline] |
| void CkPagedVector< T >::allocatePages | ( | int | nEntries | ) | [inline, private] |
Definition at line 579 of file cklists.h.
Referenced by CkPagedVector< AmpiOtherElement >::init(), and CkPagedVector< AmpiOtherElement >::pup().
| void CkPagedVector< T >::allocatePage | ( | int | pg | ) | [inline, private] |
Definition at line 584 of file cklists.h.
Referenced by CkPagedVector< AmpiOtherElement >::operator[](), and CkPagedVector< AmpiOtherElement >::pupPage().
| void CkPagedVector< T >::init | ( | int | nEntries | ) | [inline] |
Definition at line 599 of file cklists.h.
Referenced by CkPagedVector< AmpiOtherElement >::CkPagedVector(), and AmpiSeqQ::init().
| T& CkPagedVector< T >::operator[] | ( | unsigned int | i | ) | [inline] |
| T CkPagedVector< T >::get | ( | unsigned int | i | ) | [inline] |
| void CkPagedVector< T >::pupPage | ( | PUP::er & | p, | |
| int | pg | |||
| ) | [inline] |
| void CkPagedVector< T >::pup | ( | PUP::er & | p | ) | [inline] |
T** CkPagedVector< T >::pages [private] |
Definition at line 577 of file cklists.h.
Referenced by CkPagedVector< AmpiOtherElement >::allocatePage(), CkPagedVector< AmpiOtherElement >::allocatePages(), CkPagedVector< AmpiOtherElement >::get(), CkPagedVector< AmpiOtherElement >::operator[](), CkPagedVector< AmpiOtherElement >::pup(), CkPagedVector< AmpiOtherElement >::pupPage(), and CkPagedVector< AmpiOtherElement >::~CkPagedVector().
int CkPagedVector< T >::nPages [private] |
Definition at line 578 of file cklists.h.
Referenced by CkPagedVector< AmpiOtherElement >::allocatePages(), CkPagedVector< AmpiOtherElement >::pup(), and CkPagedVector< AmpiOtherElement >::~CkPagedVector().
1.5.5