27 #ifndef EMBB_CONTAINERS_OBJECT_POOL_H_ 28 #define EMBB_CONTAINERS_OBJECT_POOL_H_ 30 #include <embb/base/atomic.h> 31 #include <embb/containers/wait_free_array_value_pool.h> 37 namespace containers {
64 ObjectAllocator object_allocator_;
76 size_t value_pool_size_;
81 ValuePool value_pool_;
93 class ReturningTrueIterator {
95 typedef ReturningTrueIterator self_type;
96 typedef bool value_type;
97 typedef bool& reference;
98 typedef bool* pointer;
99 typedef std::forward_iterator_tag iterator_category;
100 typedef int difference_type;
101 explicit ReturningTrueIterator(
size_t count_value);
102 self_type operator++();
103 self_type operator++(
int);
104 reference operator*();
105 pointer operator->();
114 bool IsContained(
const Type &obj)
const;
115 int GetIndexOfObject(
const Type &obj)
const;
175 template<
typename Param1>
176 Type*
Allocate(Param1
const& param1);
178 template<
typename Param1,
typename Param2>
179 Type*
Allocate(Param1
const& param1, Param2
const& param2);
181 template<
typename Param1,
typename Param2,
typename Param3>
182 Type*
Allocate(Param1
const& param1, Param2
const& param2,
183 Param3
const& param3);
185 template<
typename Param1,
typename Param2,
typename Param3,
typename Param4>
186 Type*
Allocate(Param1
const& param1, Param2
const& param2,
187 Param3
const& param3, Param4
const& param4);
194 #include <embb/containers/internal/object_pool-inl.h> 196 #endif // EMBB_CONTAINERS_OBJECT_POOL_H_ Definition: lock_free_mpmc_queue.h:40
Type * Allocate(...)
Allocates an element from the pool.
void Free(Type *obj)
Returns an element to the pool.
ObjectPool(size_t capacity)
Constructs an object pool with capacity capacity.
Allocator according to the C++ standard.
Definition: memory_allocation.h:525
Pool for thread-safe management of arbitrary objects.
Definition: object_pool.h:59
Wait-free value pool using array construction.
Definition: wait_free_array_value_pool.h:148
size_t GetCapacity()
Returns the capacity of the pool.
bool operator!=(const Duration< Tick > &lhs, const Duration< Tick > &rhs)
Compares two durations (inequality).
Definition: duration.h:183
~ObjectPool()
Destructs the pool.
bool operator==(const Duration< Tick > &lhs, const Duration< Tick > &rhs)
Compares two durations (equality).
Definition: duration.h:166