Abstract interface for objects that own memory. More...
#include <memoryHaver.hpp>
Public Member Functions | |
| virtual nbool | has (const instance &it) const =0 |
| Checks if this memory manager "owns" or contains the given instance. | |
| nbool | has (const instance *it) const BY_SIDE_FUNC(has) |
| virtual ncnt | len () const =0 |
| virtual ncnt | size () const =0 |
| virtual nbool | rel ()=0 |
| nbool | isFull () const |
| nbool | isCapable () const |
Protected Member Functions | |
| virtual void * | _get (nidx n)=0 |
| Internal method to get a pointer to memory at a specific index. | |
Abstract interface for objects that own memory.
Base interface for classes that directly or indirectly own memory in the memory pool and can READ that memory. Defines interfaces for querying memory size and state.
"Indirect ownership" means the object doesn't directly allocate and use memory, but internal member variables handle it. If memory allocation must be done through internal members, the class should only inherit memoryHaver. If allocation is also possible, inherit allocator.
Allocatable memory size is expressed as size, while allocated memory is expressed as len. Control is based solely on void* and byte units.
Checks if this memory manager "owns" or contains the given instance.
| it | The instance to check for. |
Implemented in by::chunk, and by::chunks.