#include <PtrManager.h>
|
uint32_t | size (void) const |
| Return the number of managed objects.
|
|
T * | at (uint32_t n) const |
|
|
template<typename U > |
U * | take (std::unique_ptr< U > &&o) |
|
std::unique_ptr< T > | release (T *ptr) |
|
template<typename T>
class coco::PtrManager< T >
Definition at line 28 of file PtrManager.h.
◆ at()
◆ release()
Definition at line 46 of file PtrManager.h.
47 {
48 for (auto it = _ptrs.begin(); it != _ptrs.end(); ++it)
49 {
50 if (it->get() == ptr)
51 {
52 std::unique_ptr<T> res = std::move(*it);
53 _ptrs.erase(it);
54 return res;
55 }
56 }
57
58 throw std::invalid_argument{"ptr"};
59 }
◆ size()
Return the number of managed objects.
Definition at line 32 of file PtrManager.h.
32{ return _ptrs.size(); }
◆ take()
template<typename T >
template<typename U >
Definition at line 38 of file PtrManager.h.
39 {
40 auto res = o.get();
41 _ptrs.emplace_back(std::move(o));
42 return res;
43 }
The documentation for this class was generated from the following file: