StormByte 2.0.0
C++26 foundation of the StormByte suite
 
Loading...
Searching...
No Matches
safe_pointers.hxx File Reference

DLL-safe shared and unique owners. More...

#include <StormByte/type_traits.hxx>
#include <StormByte/visibility.h>
#include <compare>
#include <cstddef>
#include <functional>
#include <memory>
#include <type_traits>
#include <utility>
#include <StormByte/safe_pointers.txx>
Include dependency graph for safe_pointers.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  StormByte::Heap::ObjectDeleter
 Destroy T and return its block to Free. More...
 
struct  StormByte::Heap::Allocator< T >
 std::shared_ptr allocator that uses Allocate / Free. More...
 
class  StormByte::Shared< T >
 Shared owner of a T allocated on Base's heap. More...
 
class  StormByte::Unique< T >
 Unique owner of a T allocated on Base's heap. More...
 
class  StormByte::Weak< T >
 Non-owning observer of a Shared control block. More...
 
struct  std::hash< StormByte::Shared< T > >
 
struct  std::hash< StormByte::Unique< T > >
 

Namespaces

namespace  StormByte
 Root namespace of the StormByte suite.
 
namespace  StormByte::Heap
 Allocate and free raw blocks on Base's heap.
 

Functions

void * StormByte::Heap::Allocate (std::size_t bytes)
 Allocate bytes on Base's heap.
 
void StormByte::Heap::Free (void *pointer) noexcept
 Release a block obtained from Allocate.
 
template<class T , class... Args>
Shared< T > StormByte::Heap::MakeShared (Args &&... args)
 Construct T on Base's heap and wrap it in Shared.
 
template<class T , class... Args>
Unique< T > StormByte::Heap::MakeUnique (Args &&... args)
 Construct T on Base's heap and wrap it in Unique.
 
template<class T , class U >
Shared< T > StormByte::StaticPointerCast (const Shared< U > &from) noexcept
 static_cast of the stored pointer.
 
template<class T , class U >
Shared< T > StormByte::DynamicPointerCast (const Shared< U > &from) noexcept
 dynamic_cast of the stored pointer.
 
template<class T , class U >
Shared< T > StormByte::ConstPointerCast (const Shared< U > &from) noexcept
 const_cast of the stored pointer.
 
template<class T , class U >
Shared< T > StormByte::ReinterpretPointerCast (const Shared< U > &from) noexcept
 reinterpret_cast of the stored pointer.
 

Detailed Description

DLL-safe shared and unique owners.

Storage is on Base's heap.

StormByte::Heap is not a public header. Allocate / Free are exported from the StormByte library and defined in a private translation unit that is not installed.