LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Internal memory chunk; like a std::vector, but does not construct. More...
Public Member Functions | |
MemoryChunk_t (Allocator_t &alloc, size_type n) | |
MemoryChunk_t (const MemoryChunk_t &)=delete | |
Can't copy. More... | |
MemoryChunk_t (MemoryChunk_t &&) | |
Move constructor. More... | |
~MemoryChunk_t () | |
MemoryChunk_t & | operator= (const MemoryChunk_t &)=delete |
Can't assign. More... | |
MemoryChunk_t & | operator= (MemoryChunk_t &&) |
Move assignment. More... | |
size_type | size () const |
Returns the number of elements in this pool. More... | |
size_type | available () const |
Returns the number of free elements in this pool. More... | |
size_type | used () const |
Returns the number of used elements in this pool. More... | |
bool | full () const |
Returns whether the chunk is full. More... | |
pointer | get () |
Returns a pointer to a free item, or nullptr if none is available. More... | |
pointer | get (size_t n) |
Returns a pointer to n free items, or nullptr if not available. More... | |
Public Attributes | |
Allocator_t * | allocator |
reference to the allocator to be used More... | |
pointer | begin = nullptr |
start of the pool More... | |
pointer | end = nullptr |
end of the pool More... | |
pointer | free = nullptr |
first unused element of the pool More... | |
Private Member Functions | |
MemoryChunk_t () | |
< Default constructor (does nothing) More... | |
Internal memory chunk; like a std::vector, but does not construct.
Definition at line 327 of file BulkAllocator.h.
|
inline |
Definition at line 336 of file BulkAllocator.h.
References util::begin(), and n.
|
delete |
Can't copy.
lar::details::bulk_allocator::BulkAllocatorBase< T >::MemoryChunk_t::MemoryChunk_t | ( | MemoryChunk_t && | from | ) |
Move constructor.
Definition at line 395 of file BulkAllocator.h.
References util::begin(), and util::end().
|
inline |
Definition at line 345 of file BulkAllocator.h.
References util::size().
|
inlineprivate |
< Default constructor (does nothing)
Definition at line 377 of file BulkAllocator.h.
|
inline |
Returns the number of free elements in this pool.
Definition at line 355 of file BulkAllocator.h.
|
inline |
Returns whether the chunk is full.
Definition at line 361 of file BulkAllocator.h.
|
inline |
Returns a pointer to a free item, or nullptr if none is available.
Definition at line 364 of file BulkAllocator.h.
|
inline |
Returns a pointer to n free items, or nullptr if not available.
Definition at line 367 of file BulkAllocator.h.
References util::end().
|
delete |
Can't assign.
BulkAllocatorBase< T >::MemoryChunk_t & lar::details::bulk_allocator::BulkAllocatorBase< T >::MemoryChunk_t::operator= | ( | MemoryChunk_t && | from | ) |
Move assignment.
Definition at line 404 of file BulkAllocator.h.
References util::begin(), and util::end().
|
inline |
Returns the number of elements in this pool.
Definition at line 352 of file BulkAllocator.h.
References util::begin().
|
inline |
Returns the number of used elements in this pool.
Definition at line 358 of file BulkAllocator.h.
References util::begin().
Allocator_t* lar::details::bulk_allocator::BulkAllocatorBase< T >::MemoryChunk_t::allocator |
reference to the allocator to be used
Definition at line 329 of file BulkAllocator.h.
pointer lar::details::bulk_allocator::BulkAllocatorBase< T >::MemoryChunk_t::begin = nullptr |
start of the pool
Definition at line 331 of file BulkAllocator.h.
pointer lar::details::bulk_allocator::BulkAllocatorBase< T >::MemoryChunk_t::end = nullptr |
end of the pool
Definition at line 332 of file BulkAllocator.h.
pointer lar::details::bulk_allocator::BulkAllocatorBase< T >::MemoryChunk_t::free = nullptr |
first unused element of the pool
Constructor: allocates memory
Definition at line 333 of file BulkAllocator.h.