Loading...
Searching...
No Matches
by::memoryHaver Class Referenceabstract

Abstract interface for objects that own memory. More...

#include <memoryHaver.hpp>

Inheritance diagram for by::memoryHaver:
by::allocator by::pool by::chunk by::chunks by::watcher

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.
 

Detailed Description

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?

"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.

len and size

Allocatable memory size is expressed as size, while allocated memory is expressed as len. Control is based solely on void* and byte units.

Remarks
memoryHaver derivatives manage different memory sizes Note that memoryHaver derived classes each manage different sizes of memory.

Member Function Documentation

◆ _get()

virtual void * by::memoryHaver::_get ( nidx n)
protectedpure virtual

Internal method to get a pointer to memory at a specific index.

Parameters
nThe index of the memory block to retrieve.
Returns
A void pointer to the memory block.

Implemented in by::chunk, and by::pool.

◆ has()

virtual nbool by::memoryHaver::has ( const instance & it) const
pure virtual

Checks if this memory manager "owns" or contains the given instance.

Parameters
itThe instance to check for.
Returns
true if the instance is managed by this memoryHaver, false otherwise.

Implemented in by::chunk, and by::chunks.

◆ rel()

virtual nbool by::memoryHaver::rel ( )
pure virtual

Implemented in by::pool.


The documentation for this class was generated from the following file: