Base class of data structures with linear memory usage. More...
#include <tpie/util.h>
Inherited by tpie::internal_stack_vector_base< T, child_t >.
Static Public Member Functions | |
static memory_size_type | memory_usage (memory_size_type size) |
Return the number of bytes required to create a data structure supporting a given number of elements. More... | |
static memory_size_type | memory_fits (memory_size_type memory) |
Return the maximum number of elements that can be contained in in the structure when it is allowed to fill a given number of bytes. More... | |
Base class of data structures with linear memory usage.
Uses CRTP to defer the definition of memory_coefficient and memory_overhead which must be implemented in the subclass.
Defines two static methods, memory_usage and memory_fits, that determine the amount of memory used and the number of items for a given memory amount, respectively.
|
inlinestatic |
Return the maximum number of elements that can be contained in in the structure when it is allowed to fill a given number of bytes.
memory | The number of bytes the structure is allowed to occupy |
|
inlinestatic |
Return the number of bytes required to create a data structure supporting a given number of elements.
size | The number of elements to support |