28 static handle_of_t<T> BackendHandle(
const T& instance);
29 static handle_of_t<T>* BackendHandleAddress(T& instance);
30 template <
typename... Args>
31 static T CreateInstance(Args&&... args);
32 static peak::common::detail::c_type_of_t<T> CreateCType(
const T& instance);
33 static std::vector<T> CreateInstances(std::vector<handle_of_t<T>> handles);
37handle_of_t<T> BackendAccessor<T>::BackendHandle(
const T& instance)
39 return instance.GetHandle();
43handle_of_t<T>* BackendAccessor<T>::BackendHandleAddress(T& instance)
45 return instance.GetHandleAddress();
49template <
typename... Args>
50T BackendAccessor<T>::CreateInstance(Args&&... args)
52 return T{ std::forward<Args>(args)... };
56peak::common::detail::c_type_of_t<T> BackendAccessor<T>::CreateCType(
const T& instance)
58 return {
static_cast<peak::common::detail::c_type_of_t<T>
>(instance) };
62std::vector<T> BackendAccessor<T>::CreateInstances(std::vector<handle_of_t<T>> handles)
64 std::vector<T> instances;
65 instances.reserve(handles.size());
66 std::transform(handles.begin(), handles.end(), std::back_inserter(instances), [](
const auto& handle) {
67 return CreateInstance(handle);
Namespace for internal implementation details and low-level types.
Definition peak_common_math.hpp:19
Root namespace for common types and interfaces shared across multiple libraries.
Definition peak_common_math.hpp:17
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_buffer.hpp:29