ug4
ug::PageContainer< T, MAX_PAGE_SIZE, Allocator > Class Template Reference

#include <page_container.h>

Public Types

typedef Allocator allocator_type
 
typedef Allocator::const_reference const_reference
 
typedef Allocator::difference_type difference_type
 
typedef Allocator::reference reference
 
typedef Allocator::size_type size_type
 

Public Member Functions

size_t capacity () const
 
void clear ()
 
PageContaineroperator= (const PageContainer &pc)
 
T & operator[] (size_t ind)
 
const T & operator[] (size_t ind) const
 
 PageContainer ()
 
 PageContainer (const PageContainer &pc)
 
void reserve (size_t size)
 
void resize (size_t size, const T &val=T())
 
size_t size () const
 
void swap (PageContainer &pc)
 
 ~PageContainer ()
 

Private Member Functions

void assign_container (const PageContainer &pc)
 
T * get_page (size_t ind) const
 returns the page in which the data for the given index lies More...
 
size_t get_page_index (size_t ind) const
 returns the index of the page in which the data for the given index lies More...
 
size_t get_page_offset (size_t ind) const
 returns the offset that a index has in its page More...
 

Private Attributes

Allocator m_alloc
 
const size_t m_numPageEntries
 
std::vector< T * > m_pages
 
size_t m_size
 

Member Typedef Documentation

◆ allocator_type

template<class T , int MAX_PAGE_SIZE = 4096, class Allocator = std::allocator<T>>
typedef Allocator ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::allocator_type

◆ const_reference

template<class T , int MAX_PAGE_SIZE = 4096, class Allocator = std::allocator<T>>
typedef Allocator::const_reference ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::const_reference

◆ difference_type

template<class T , int MAX_PAGE_SIZE = 4096, class Allocator = std::allocator<T>>
typedef Allocator::difference_type ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::difference_type

◆ reference

template<class T , int MAX_PAGE_SIZE = 4096, class Allocator = std::allocator<T>>
typedef Allocator::reference ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::reference

◆ size_type

template<class T , int MAX_PAGE_SIZE = 4096, class Allocator = std::allocator<T>>
typedef Allocator::size_type ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::size_type

Constructor & Destructor Documentation

◆ PageContainer() [1/2]

template<class T , int MAX_PAGE_SIZE, class Allocator >
ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::PageContainer

◆ PageContainer() [2/2]

template<class T , int MAX_PAGE_SIZE, class Allocator >
ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::PageContainer ( const PageContainer< T, MAX_PAGE_SIZE, Allocator > &  pc)

◆ ~PageContainer()

template<class T , int MAX_PAGE_SIZE, class Allocator >
ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::~PageContainer

Member Function Documentation

◆ assign_container()

template<class T , int MAX_PAGE_SIZE, class Allocator >
void ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::assign_container ( const PageContainer< T, MAX_PAGE_SIZE, Allocator > &  pc)
private

◆ capacity()

template<class T , int MAX_PAGE_SIZE, class Allocator >
size_t ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::capacity
inline

◆ clear()

template<class T , int MAX_PAGE_SIZE, class Allocator >
void ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::clear

References resize().

◆ get_page()

template<class T , int MAX_PAGE_SIZE, class Allocator >
T * ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::get_page ( size_t  ind) const
inlineprivate

returns the page in which the data for the given index lies

Referenced by ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::assign_container().

◆ get_page_index()

template<class T , int MAX_PAGE_SIZE, class Allocator >
size_t ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::get_page_index ( size_t  ind) const
inlineprivate

returns the index of the page in which the data for the given index lies

◆ get_page_offset()

template<class T , int MAX_PAGE_SIZE, class Allocator >
size_t ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::get_page_offset ( size_t  ind) const
inlineprivate

returns the offset that a index has in its page

◆ operator=()

template<class T , int MAX_PAGE_SIZE, class Allocator >
PageContainer< T, MAX_PAGE_SIZE, Allocator > & ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::operator= ( const PageContainer< T, MAX_PAGE_SIZE, Allocator > &  pc)

◆ operator[]() [1/2]

template<class T , int MAX_PAGE_SIZE, class Allocator >
T & ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::operator[] ( size_t  ind)
inline

◆ operator[]() [2/2]

template<class T , int MAX_PAGE_SIZE, class Allocator >
const T & ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::operator[] ( size_t  ind) const
inline

◆ reserve()

template<class T , int MAX_PAGE_SIZE, class Allocator >
void ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::reserve ( size_t  size)

◆ resize()

template<class T , int MAX_PAGE_SIZE, class Allocator >
void ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::resize ( size_t  size,
const T &  val = T() 
)

◆ size()

template<class T , int MAX_PAGE_SIZE, class Allocator >
size_t ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::size
inline

◆ swap()

template<class T , int MAX_PAGE_SIZE, class Allocator >
void ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::swap ( PageContainer< T, MAX_PAGE_SIZE, Allocator > &  pc)

Member Data Documentation

◆ m_alloc

template<class T , int MAX_PAGE_SIZE = 4096, class Allocator = std::allocator<T>>
Allocator ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::m_alloc
private

◆ m_numPageEntries

template<class T , int MAX_PAGE_SIZE = 4096, class Allocator = std::allocator<T>>
const size_t ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::m_numPageEntries
private

◆ m_pages

template<class T , int MAX_PAGE_SIZE = 4096, class Allocator = std::allocator<T>>
std::vector<T*> ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::m_pages
private

◆ m_size

template<class T , int MAX_PAGE_SIZE = 4096, class Allocator = std::allocator<T>>
size_t ug::PageContainer< T, MAX_PAGE_SIZE, Allocator >::m_size
private

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