Raven Engine v0.1
Loading...
Searching...
No Matches
Scope.h File Reference

Defines scoped and allocator-aware smart pointers for Raven. More...

Classes

class  Raven::Scope< T >
 Exclusive-ownership smart pointer. More...
class  Raven::ScopeWithAllocator< T >
 Scoped smart pointer that uses a specific allocator. More...

Namespaces

namespace  Raven

Enumerations

enum class  Raven::AllocatorType { Raven::AllocatorType::None , Raven::AllocatorType::Stack , Raven::AllocatorType::Malevolent }
 Types of allocators supported by ScopeWithAllocator. More...

Functions

template<typename T, typename... Args>
Scope< T > Raven::CreateScope (Args &&... args)
 Helper to create a Scope<T> by constructing T in-place.
template<typename T, typename... Args>
ScopeWithAllocator< T > Raven::CreateScopeWithAllocator (usize objectCount, Args &&... args)
 Creates a ScopeWithAllocator using default allocator selection.
template<typename T, typename Allocator, typename... Args>
ScopeWithAllocator< T > Raven::CreateScopeWithAllocator (Allocator *allocator, Args &&... args)
 Creates a ScopeWithAllocator with explicit allocator.

Detailed Description

Defines scoped and allocator-aware smart pointers for Raven.

Provides two RAII types:

  • Scope<T>: exclusive-ownership smart pointer, similar to std::unique_ptr.
  • ScopeWithAllocator<T>: allocator-aware scoped pointer that uses StackAllocator or MalevolentAllocator based on traits or explicit allocator. Includes helper functions CreateScope and CreateScopeWithAllocator for easy instantiation.
See also
AllocatorTraits.h, MemoryManager.h, MalevolentAllocator.h, StackAllocator.h
Author
PhilikusHD