1 #ifndef GAUDIKERNEL_HANDLEDETAIL 2 #define GAUDIKERNEL_HANDLEDETAIL 1 29 namespace HandleDetail
49 #define ENABLE_IF( condition ) std::enable_if_t<condition>* = nullptr 65 template <
typename T, ENABLE_IF( isDataObject<T>() && !isRange<T>() )>
73 return dynamic_cast<const T&
>( rawObject );
78 template <
typename T, ENABLE_IF( !isDataObject<T>() && !isRange<T>() )>
87 template <
typename RangeT, ENABLE_IF( isRange<RangeT>() )>
107 template <
typename T>
111 template <
typename T>
114 const T&
ref =
static_cast<const T&
>( *ptr );
119 template <
typename T>
122 return wrapDataObject<T>( std::make_unique<T>(
static_cast<T&&
>( data ) ) );
126 template <
typename T, ENABLE_IF( !isDataObject<T>() )>
129 auto ptr = std::make_unique<AnyDataWrapper<T>>( std::forward<T>( data ) );
130 const T&
ref = ptr->getData();
constexpr bool isDataObject()
Tells whether type T is a subclass of DataObject.
constexpr bool isRange()
Tells whether there is a parameter pack U... such as T = Range<U...>
DataObjectAndRef< T > wrapDataObject(DataObjectPtr &&ptr)
const T & unwrapDataObject(const DataObject &rawObject)
T is a subclass of DataObject, and is not a range: we can just cast the pointer provided by the TES a...
A DataObject is the base class of any identifiable object on any data store.
Helper functions to set/get the application return code.