template<class C, class T, typename... Args>
bpf::memory::ObjectConstructor class

Template parameters
C source class extends T
T base class (may be equal to C)
Args arguments to the constructor

Contents

Represent a constructor in a C++ class; part of mini-reflection API

Public functions

auto MakeUnique(Args && ... args) const -> UniquePtr<T>
auto MakeShared(Args && ... args) const -> SharedPtr<T>

Function documentation

template<class C, class T, typename... Args>
UniquePtr<T> bpf::memory::ObjectConstructor<C, T, Args>::MakeUnique(Args && ... args) const

Parameters
args arguments to the constructor
Returns new allocated object wrapped in a UniquePtr
Exceptions
MemoryException in case allocation is impossible

Constructs a new unique pointer to the parent object type

template<class C, class T, typename... Args>
SharedPtr<T> bpf::memory::ObjectConstructor<C, T, Args>::MakeShared(Args && ... args) const

Parameters
args arguments to the constructor
Returns new allocated object wrapped in a SharedPtr
Exceptions
MemoryException in case allocation is impossible

Constructs a new shared pointer to the parent object type