StormByte 2.0.0
C++26 foundation of the StormByte suite
 
Loading...
Searching...
No Matches
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 pointers.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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

Namespaces

namespace  StormByte
 Root namespace of the StormByte suite.
 
namespace  StormByte::Safe
 Types that are safe to pass across a DLL boundary: owners and polymorphic clones on Base's heap.
 
namespace  StormByte::Safe::Heap
 Allocate and free raw blocks on Base's heap.
 

Functions

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

Variables

template<class T >
class STORMBYTE_PUBLIC_TYPE StormByte::Safe::Shared
 
template<class T >
class STORMBYTE_PUBLIC_TYPE StormByte::Safe::Unique
 
template<class T >
class STORMBYTE_PUBLIC_TYPE StormByte::Safe::Weak
 

Detailed Description

DLL-safe shared and unique owners.

Storage is on Base's heap.

StormByte::Safe::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.