Tramway SDK
Classes | Public Member Functions | Protected Attributes | List of all members
tram::Pool< T > Class Template Reference

#include <pool.h>

Classes

struct  iterator
 

Public Member Functions

 Pool (std::string name, uint64_t initialSize, bool skipFirst=false)
 
template<typename... Args>
T * AddNew (Args &&... args)
 
void Remove (T *removeptr)
 
T & operator[] (size_t index)
 
T * GetFirst ()
 
T * GetLast ()
 
iterator begin ()
 
iterator end ()
 
size_t GetSize () const
 
size_t size () const
 
size_t index (const T *ptr) const
 
bool validate (const T *ptr) const
 Checks if an object can be accessed through iteration. More...
 

Protected Attributes

std::string poolName
 
uint64_t poolSize
 
uint64_t maxSize
 
T * first
 
T * last
 
T * lastfree
 

Constructor & Destructor Documentation

◆ Pool()

template<typename T >
tram::Pool< T >::Pool ( std::string  name,
uint64_t  initialSize,
bool  skipFirst = false 
)
inline

Member Function Documentation

◆ AddNew()

template<typename T >
template<typename... Args>
T * tram::Pool< T >::AddNew ( Args &&...  args)
inline

◆ begin()

template<typename T >
iterator tram::Pool< T >::begin ( )
inline

◆ end()

template<typename T >
iterator tram::Pool< T >::end ( )
inline

◆ GetFirst()

template<typename T >
T * tram::Pool< T >::GetFirst ( )
inline

◆ GetLast()

template<typename T >
T * tram::Pool< T >::GetLast ( )
inline

◆ GetSize()

template<typename T >
size_t tram::Pool< T >::GetSize ( ) const
inline

◆ index()

template<typename T >
size_t tram::Pool< T >::index ( const T *  ptr) const
inline

◆ operator[]()

template<typename T >
T & tram::Pool< T >::operator[] ( size_t  index)
inline

◆ Remove()

template<typename T >
void tram::Pool< T >::Remove ( T *  removeptr)
inline

◆ size()

template<typename T >
size_t tram::Pool< T >::size ( ) const
inline

◆ validate()

template<typename T >
bool tram::Pool< T >::validate ( const T *  ptr) const
inline

Checks if an object can be accessed through iteration.

Member Data Documentation

◆ first

template<typename T >
T* tram::Pool< T >::first
protected

◆ last

template<typename T >
T* tram::Pool< T >::last
protected

◆ lastfree

template<typename T >
T* tram::Pool< T >::lastfree
protected

◆ maxSize

template<typename T >
uint64_t tram::Pool< T >::maxSize
protected

◆ poolName

template<typename T >
std::string tram::Pool< T >::poolName
protected

◆ poolSize

template<typename T >
uint64_t tram::Pool< T >::poolSize
protected

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