21 #ifndef HX3D_UTILS_POOL 22 #define HX3D_UTILS_POOL 24 #include "hx3d/utils/ptr.hpp" 44 template <
class... Args>
45 Pool(
unsigned int size, Args... args);
70 std::queue<unsigned int> _available;
71 std::set<unsigned int> _locked;
73 std::set<Ptr<T>> _working;
74 std::vector<Ptr<T>> _content;
82 #include "hx3d/utils/_inline/pool.inl.hpp" void release(const Ptr< T > &ptr)
Release a poolable element.
Pool(unsigned int size, Args...args)
Construct a pool with a size and arguments.
const Ptr< T > & take()
Fetch a free poolable element.
Manage poolable elements.
const std::set< Ptr< T > > & getWorking()
Get the locked elements.
std::shared_ptr< T > Ptr
Quick-typing shared ptr.