23 #include <type_traits>
26 #include <olp/core/client/ApiError.h>
27 #include <olp/core/porting/make_unique.h>
34 template <
typename Type>
37 typename std::remove_cv<typename std::remove_reference<Type>::type>::type;
41 template <
typename Type>
42 using RemoveRefAndConst =
typename RemoveRefAndConstImpl<Type>::type;
47 template <
typename Type>
50 typename std::conditional<std::is_same<Type, std::vector<void>>::value,
55 template <
typename Type>
57 using type = std::function<void(Type)>;
63 using type = std::function<void()>;
66 template <
typename Type>
68 using TypeToFunctionInput =
typename TypeToFunctionInputImpl<Type>::type;
70 template <
typename Class,
typename ExecutionContext,
typename Arg>
74 template <
typename Class,
typename ExecutionContext,
typename Arg>
89 void FuncArgType(std::function<
void()>);
92 template <
typename Arg>
93 Arg FuncArgType(std::function<
void(Arg)>);
95 template <
typename Callable>
99 RemoveRefAndConst<decltype(SecondArgType(&Callable::operator()))>;
100 using type = RemoveRefAndConst<decltype(FuncArgType(FirstArgType()))>;
103 template <
typename Callable>
105 using AsyncResultType =
typename AsyncResultTypeImpl<Callable>::type;
107 template <
typename Callable>
110 using ThirdArgTypeParam =
111 RemoveRefAndConst<decltype(ThirdArgType(&Callable::operator()))>;
112 using type = RemoveRefAndConst<decltype(FuncArgType(ThirdArgTypeParam()))>;
115 template <
typename Callable>
117 using DeducedType =
typename DeducedTypeImpl<Callable>::type;
122 virtual void* Get()
const = 0;
127 template <
typename SmartPo
inter>
131 : pointer_(std::move(pointer)) {}
134 void*
Get()
const override {
return static_cast<void*
>(pointer_.get()); }
136 SmartPointer pointer_;
140 template <
typename SmartPo
inter>
141 inline std::unique_ptr<UntypedSmartPointer> MakeUntypedUnique(
142 SmartPointer&& ptr) {
143 return std::make_unique<TypedSmartPointer<SmartPointer>>(std::move(ptr));
Handles the cancellation and final mechanisms.
Definition: ExecutionContext.h:31
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24
Declares the type of a callable with two parameters.
Definition: TypeHelpers.h:97
Declares the type of a callable with three parameters.
Definition: TypeHelpers.h:109
Definition: TypeHelpers.h:48
A helper class removes type qualifiers and provides a type.
Definition: TypeHelpers.h:35
An implementation of UntypedSmartPointer interface.
Definition: TypeHelpers.h:128
TypedSmartPointer(SmartPointer &&pointer)
A move contructor.
Definition: TypeHelpers.h:130
void * Get() const override
Method converts data to a void pointer.
Definition: TypeHelpers.h:134
Definition: TypeHelpers.h:121