openMSX
Classes | Public Types | Public Member Functions | List of all members
ObjectPool< T > Class Template Reference

#include <ObjectPool.hh>

Inheritance diagram for ObjectPool< T >:
Inheritance graph
[legend]

Classes

struct  EmplaceResult
 

Public Types

using Index = uint32_t
 

Public Member Functions

template<typename... Args>
EmplaceResult emplace (Args &&...args)
 
const T & operator[] (Index idx) const
 
T & operator[] (Index idx)
 
void remove (Index idx)
 
void remove (const T *ptr)
 
Index ptr2Index (const T *ptr) const
 
Index capacity () const
 

Detailed Description

template<typename T>
class ObjectPool< T >

Definition at line 54 of file ObjectPool.hh.

Member Typedef Documentation

◆ Index

template<typename T >
using ObjectPool< T >::Index = uint32_t

Definition at line 57 of file ObjectPool.hh.

Member Function Documentation

◆ capacity()

template<typename T >
Index ObjectPool< T >::capacity ( ) const
inline

Definition at line 120 of file ObjectPool.hh.

Referenced by TEST_CASE().

◆ emplace()

template<typename T >
template<typename... Args>
EmplaceResult ObjectPool< T >::emplace ( Args &&...  args)
inline

Definition at line 76 of file ObjectPool.hh.

Referenced by TEST_CASE().

◆ operator[]() [1/2]

template<typename T >
T & ObjectPool< T >::operator[] ( Index  idx)
inline

Definition at line 94 of file ObjectPool.hh.

◆ operator[]() [2/2]

template<typename T >
const T & ObjectPool< T >::operator[] ( Index  idx) const
inline

Definition at line 93 of file ObjectPool.hh.

◆ ptr2Index()

template<typename T >
Index ObjectPool< T >::ptr2Index ( const T *  ptr) const
inline

Definition at line 107 of file ObjectPool.hh.

References begin(), end(), UNREACHABLE, and xrange().

Referenced by ObjectPool< T >::remove().

◆ remove() [1/2]

template<typename T >
void ObjectPool< T >::remove ( const T *  ptr)
inline

Definition at line 103 of file ObjectPool.hh.

References ObjectPool< T >::ptr2Index(), and ObjectPool< T >::remove().

◆ remove() [2/2]

template<typename T >
void ObjectPool< T >::remove ( Index  idx)
inline

Definition at line 96 of file ObjectPool.hh.

Referenced by ObjectPool< T >::remove(), and TEST_CASE().


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