Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Compiler_CFG_Context Class Reference

Arena-backed ownership context for CFG objects. More...

#include <Compiler_CFG.H>

Collaboration diagram for Aleph::Compiler_CFG_Context:
[legend]

Classes

struct  Owned_Object
 Internal tracker for objects with non-trivial destructors. More...
 

Public Member Functions

 Compiler_CFG_Context (const size_t arena_size=AhArenaAllocator::DEFAULT_SIZE)
 Constructs a CFG context.
 
 Compiler_CFG_Context (const Compiler_CFG_Context &)=delete
 
Compiler_CFG_Context & operator= (const Compiler_CFG_Context &)=delete
 
 ~Compiler_CFG_Context () noexcept
 Cleans up the context and all managed objects.
 
template<typename T , typename... Args>
T * make (Args &&...args)
 Allocates and constructs an object in the arena.
 
void reset () noexcept
 Resets the arena and destroys all tracked objects.
 
size_t allocated_size () const noexcept
 Returns currently used bytes.
 

Private Attributes

AhArenaAllocator arena_
 
DynArray< Owned_Object > owned_
 

Detailed Description

Arena-backed ownership context for CFG objects.

Ensures efficient allocation and bulk destruction of CFG-related data.

Definition at line 190 of file Compiler_CFG.H.

Constructor & Destructor Documentation

◆ Compiler_CFG_Context() [1/2]

Aleph::Compiler_CFG_Context::Compiler_CFG_Context ( const size_t  arena_size = AhArenaAllocator::DEFAULT_SIZE)
inlineexplicit

Constructs a CFG context.

Definition at line 204 of file Compiler_CFG.H.

◆ Compiler_CFG_Context() [2/2]

Aleph::Compiler_CFG_Context::Compiler_CFG_Context ( const Compiler_CFG_Context &  )
delete

◆ ~Compiler_CFG_Context()

Aleph::Compiler_CFG_Context::~Compiler_CFG_Context ( )
inlinenoexcept

Cleans up the context and all managed objects.

Definition at line 212 of file Compiler_CFG.H.

References reset().

Member Function Documentation

◆ allocated_size()

size_t Aleph::Compiler_CFG_Context::allocated_size ( ) const
inlinenoexcept

Returns currently used bytes.

Definition at line 246 of file Compiler_CFG.H.

References Aleph::AhArenaAllocator::allocated_size(), and arena_.

◆ make()

template<typename T , typename... Args>
T * Aleph::Compiler_CFG_Context::make ( Args &&...  args)
inline

◆ operator=()

Compiler_CFG_Context & Aleph::Compiler_CFG_Context::operator= ( const Compiler_CFG_Context &  )
delete

◆ reset()

void Aleph::Compiler_CFG_Context::reset ( )
inlinenoexcept

Resets the arena and destroys all tracked objects.

Definition at line 233 of file Compiler_CFG.H.

References Aleph::and, arena_, owned_, and Aleph::AhArenaAllocator::reset().

Referenced by ~Compiler_CFG_Context().

Member Data Documentation

◆ arena_

AhArenaAllocator Aleph::Compiler_CFG_Context::arena_
private

Definition at line 199 of file Compiler_CFG.H.

Referenced by allocated_size(), make(), and reset().

◆ owned_

DynArray<Owned_Object> Aleph::Compiler_CFG_Context::owned_
private

Definition at line 200 of file Compiler_CFG.H.

Referenced by make(), and reset().


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