16#ifndef BIFROSTGRAPH_EXECUTOR_FACTORY_H
17#define BIFROSTGRAPH_EXECUTOR_FACTORY_H
57template <
typename T,
typename... Args>
59 Owner<T> owner{
new T(std::forward<Args>(args)...)};
60 if (!owner || !owner->isValid()) {
61 throw std::logic_error(
62 "makeOwner<T>(...) failed: "
63 "the newly allocated object was invalid.");
103template <
typename T,
typename... Args>
105 Owner<T> owner{
new T(std::forward<Args>(args)...), d};
106 if (!owner || !owner->isValid()) {
107 throw std::logic_error(
108 "makeOwner<T>(DeleterFunc<T>, ...) failed: "
109 "the newly allocated object was invalid.");
115#define EXECUTOR_DECLARE_MAKE_OWNER_FRIENDSHIP() \
116 template <typename T, typename... Args> \
117 friend BifrostGraph::Executor::Owner<T> BifrostGraph::Executor::makeOwner(Args&&... args); \
118 template <typename T, typename... Args> \
119 friend BifrostGraph::Executor::Owner<T> BifrostGraph::Executor::makeOwner( \
120 void (*deleterFunc)(T * p), Args&&... args)
BifrostGraph Executor Owner helper class.
Owner< T > makeOwner(Args &&... args)
Create a new T object, constructed from the given arguments, and validate it with the expression T::i...
void(*)(P *p) DeleterFunc
The signature for the custom pointer deleter of a pointee p. This is the custom deleter type to use w...
The Owner<T> class template represents ownership of an object pointer. It indicates that the pointed ...