14#ifndef ZYPPNG_PIPELINES_ALGORITHM_H_INCLUDED
15#define ZYPPNG_PIPELINES_ALGORITHM_H_INCLUDED
17#include <zypp-core/zyppng/async/AsyncOp>
35 template <
class Container,
class AsyncResType,
class Transformation,
class Predicate,
class DefaultType >
90 template <
class Transformation,
class Predicate,
class DefaultType >
98 template <
class Container
102 using InputType =
typename Container::value_type;
103 static_assert( std::is_invocable_v<Transformation, InputType>,
"Transformation function must take the container value type as input " );
104 static_assert( std::is_rvalue_reference_v<decltype(std::forward<Container>(container))>,
"Input container must be a rvalue reference" );
106 using OutputType = std::invoke_result_t<Transformation, InputType>;
108 if constexpr ( detail::is_async_op_v<OutputType> ) {
112 static_assert( std::is_same_v<AsyncResultType, DefaultType>,
"Default type and transformation result type must match" );
119 static_assert( std::is_same_v<OutputType, DefaultType>,
"Default type and transformation result type must match" );
121 for (
auto &
in : std::forward<Container>(container) ) {
147 template <
class Transformation,
class DefaultType,
class Predicate >
154 template <
typename Excpt,
typename ...Rest>
157 if constexpr (
sizeof...(Rest) == 0 ) {
163 }
catch (
const Excpt &
e ) {
185 template <
typename ...Excpt>
206 template <
typename Excpt>
210 }
catch (
const Excpt &
e ) {
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Base class for Exception.
std::enable_if< std::is_member_pointer< typenamestd::decay< Functor >::type >::value, typenamestd::result_of< Functor &&(Args &&...)>::type >::typ invoke)(Functor &&f, Args &&... args)
Easy-to use interface to the ZYPP dependency resolver.
bool containsOneOfExceptionImpl(const std::exception_ptr &exceptionPtr)
typename remove_smart_ptr< T >::type remove_smart_ptr_t
bool containsOneOfException(const std::exception_ptr &exceptionPtr)
auto firstOf(Transformation &&transformFunc, DefaultType &&def, Predicate &&predicate=detail::ContinueUntilValidPredicate())
bool containsException(const std::exception_ptr &exceptionPtr)
void setReady(value_type &&val)
AsyncOpRef< AsyncResType > _currentPipeline
Container::iterator _currIter
AsyncFirstOfImpl(Container &&inData, Transformation &&transFunc, DefaultType &&defaultVal, Predicate &&predicate)
Transformation _transFunc
void resultReady(AsyncResType &&res)
bool operator()(const Arg &value)
FirstOfHelper(Transformation transFunc, DefaultType defaultVal, Predicate predicate)
Transformation _transFunc
auto operator()(Container &&container)