Template Class ObjectPool

Nested Relationships

Nested Types

Class Documentation

template<typename T, int CAPACITY = 1>
class ObjectPool

Public Types

using Index_t = int

Public Functions

inline Iterator begin()
inline Iterator end()
inline ObjectPool()
inline ~ObjectPool()
inline Index_t reserve()
inline Index_t construct()
template<typename ...Args>
inline Index_t construct(Args&&... args)
inline Index_t add(const T &element)
inline void remove(Index_t index, bool destruct = false)
inline T &operator[](Index_t index)
inline Iterator iterator(Index_t index)
inline size_t size() const
inline size_t capacity() const
inline T *allocate()
inline T *create()
template<typename ...Args>
inline T *create(Args&&... args)
inline void free(T *ptr, bool destruct)
inline void free(T *ptr)
inline T *insert(const T &element)
inline T *get(Index_t index)
inline T *get(T *ptr)
inline Iterator iterator(T *ptr)
inline Index_t pointerToIndex(T *ptr)
inline T *indexToPointer(Index_t index)

Public Static Attributes

static constexpr int NO_INDEX = -1

Protected Functions

inline Index_t nextFree()
inline char *getFirstPtr() const
inline char *getLastPtr() const
class Iterator

Public Functions

inline Iterator(Index_t index, ObjectPool<T, CAPACITY> &pool)
inline T &operator*()
inline T *operator->()
inline Iterator &operator++()
inline Iterator operator++(int)
inline bool operator!=(const Iterator &other) const
inline bool operator==(const Iterator &other) const