librf
Public 成员函数 | 所有成员列表
resumef::when_结构体 参考

目前不知道怎么在doxygen里面能搜集到全局函数的文档。故用一个结构体来欺骗doxygen。 更多...

Public 成员函数

template<_WhenTaskT... _Awaitable>
auto when_all (scheduler_t &sch, _Awaitable &&... args) -> detail::when_future_t< std::tuple< detail::awaitor_result_t< _Awaitable >... > >
 等待所有的可等待对象完成,不定参数版。 更多...
 
template<_WhenIterT _Iter>
auto when_all (scheduler_t &sch, _Iter begin, _Iter end) -> detail::when_future_t< std::vector< detail::awaitor_result_t< decltype(*std::declval< _Iter >())> > >
 等待所有的可等待对象完成,迭代器版。 更多...
 
template<_ContainerT _Cont>
decltype(auto) when_all (scheduler_t &sch, _Cont &cont)
 等待所有的可等待对象完成,容器版。 更多...
 
template<_WhenTaskT... _Awaitable>
auto when_all (_Awaitable &&... args) -> future_t< std::tuple< detail::awaitor_result_t< _Awaitable >... >>
 等待所有的可等待对象完成,不定参数版。 更多...
 
template<_WhenIterT _Iter>
auto when_all (_Iter begin, _Iter end) -> future_t< std::vector< detail::awaitor_result_t< decltype(*begin)>>>
 等待所有的可等待对象完成,迭代器版。 更多...
 
template<_ContainerT _Cont>
auto when_all (_Cont &&cont) -> future_t< std::vector< detail::awaitor_result_t< decltype(*std::begin(cont))>>>
 等待所有的可等待对象完成,容器版。 更多...
 
template<_WhenTaskT... _Awaitable>
auto when_any (scheduler_t &sch, _Awaitable &&... args) -> detail::when_future_t< when_any_pair >
 等待任一的可等待对象完成,不定参数版。 更多...
 
template<_WhenIterT _Iter>
auto when_any (scheduler_t &sch, _Iter begin, _Iter end) -> detail::when_future_t< when_any_pair >
 等待任一的可等待对象完成,迭代器版。 更多...
 
template<_ContainerT _Cont>
auto when_any (scheduler_t &sch, _Cont &cont) -> detail::when_future_t< when_any_pair >
 等待任一的可等待对象完成,容器版。 更多...
 
template<_WhenTaskT... _Awaitable>
auto when_any (_Awaitable &&... args) -> future_t< when_any_pair >
 等待任一的可等待对象完成,不定参数版。 更多...
 
template<_WhenIterT _Iter>
auto when_any (_Iter begin, _Iter end) -> future_t< when_any_pair >
 等待任一的可等待对象完成,迭代器版。 更多...
 
template<_ContainerT _Cont>
auto when_any (_Cont &&cont) -> future_t< when_any_pair >
 等待任一的可等待对象完成,容器版。 更多...
 

详细描述

目前不知道怎么在doxygen里面能搜集到全局函数的文档。故用一个结构体来欺骗doxygen。

其下的所有成员函数,均是全局函数。

成员函数说明

◆ when_all() [1/6]

template<_WhenTaskT... _Awaitable>
auto resumef::when_::when_all ( _Awaitable &&...  args) -> future_t<std::tuple<detail::awaitor_result_t<_Awaitable>...>>
inline

等待所有的可等待对象完成,不定参数版。

当前协程的调度器通过current_scheduler()宏获得,与带调度器参数的版本相比,多一次resumeable function构造,效率可能低一点。

参数
args...所有的可等待对象。要么是_AwaitableT<>类型,要么是返回_AwaitableT<>类型的函数(对象)。
返回值
[co_await]std::tuple<...>。每个可等待对象的返回值,逐个存入到std::tuple<...>里面。void 返回值,存的是std::ignore。

◆ when_all() [2/6]

template<_ContainerT _Cont>
auto resumef::when_::when_all ( _Cont &&  cont) -> future_t<std::vector<detail::awaitor_result_t<decltype(*std::begin(cont))>>>
inline

等待所有的可等待对象完成,容器版。

当前协程的调度器通过current_scheduler()宏获得,与带调度器参数的版本相比,多一次resumeable function构造,效率可能低一点。

参数
cont存访可等待对象的容器。容器内存放的,要么是_AwaitableT<>类型,要么是返回_AwaitableT<>类型的函数(对象)。
返回值
[co_await]std::vector<>。每个可等待对象的返回值,逐个存入到std::vector<>里面。void 返回值,存的是std::ignore。

◆ when_all() [3/6]

template<_WhenIterT _Iter>
auto resumef::when_::when_all ( _Iter  begin,
_Iter  end 
) -> future_t<std::vector<detail::awaitor_result_t<decltype(*begin)>>>
inline

等待所有的可等待对象完成,迭代器版。

当前协程的调度器通过current_scheduler()宏获得,与带调度器参数的版本相比,多一次resumeable function构造,效率可能低一点。

参数
begin可等待对象容器的起始迭代器。迭代器指向的,要么是_AwaitableT<>类型,要么是返回_AwaitableT<>类型的函数(对象)。
end可等待对象容器的结束迭代器。
返回值
[co_await]std::vector<>。每个可等待对象的返回值,逐个存入到std::vector<>里面。void 返回值,存的是std::ignore。

◆ when_all() [4/6]

template<_WhenTaskT... _Awaitable>
auto resumef::when_::when_all ( scheduler_t sch,
_Awaitable &&...  args 
) -> detail::when_future_t<std::tuple<detail::awaitor_result_t<_Awaitable>...> >
inline

等待所有的可等待对象完成,不定参数版。

参数
sch当前协程的调度器。
args...所有的可等待对象。要么是_AwaitableT<>类型,要么是返回_AwaitableT<>类型的函数(对象)。
返回值
[co_await]std::tuple<...>。每个可等待对象的返回值,逐个存入到std::tuple<...>里面。void 返回值,存的是std::ignore。

◆ when_all() [5/6]

template<_ContainerT _Cont>
decltype(auto) resumef::when_::when_all ( scheduler_t sch,
_Cont &  cont 
)
inline

等待所有的可等待对象完成,容器版。

参数
sch当前协程的调度器。
cont存访可等待对象的容器。容器内存放的,要么是_AwaitableT<>类型,要么是返回_AwaitableT<>类型的函数(对象)。
返回值
[co_await]std::vector<>。每个可等待对象的返回值,逐个存入到std::vector<>里面。void 返回值,存的是std::ignore。

◆ when_all() [6/6]

template<_WhenIterT _Iter>
auto resumef::when_::when_all ( scheduler_t sch,
_Iter  begin,
_Iter  end 
) -> detail::when_future_t<std::vector<detail::awaitor_result_t<decltype(*std::declval<_Iter>())> > >
inline

等待所有的可等待对象完成,迭代器版。

参数
sch当前协程的调度器。
begin可等待对象容器的起始迭代器。迭代器指向的,要么是_AwaitableT<>类型,要么是返回_AwaitableT<>类型的函数(对象)。
end可等待对象容器的结束迭代器。
返回值
[co_await]std::vector<>。每个可等待对象的返回值,逐个存入到std::vector<>里面。void 返回值,存的是std::ignore。

◆ when_any() [1/6]

template<_WhenTaskT... _Awaitable>
auto resumef::when_::when_any ( _Awaitable &&...  args) -> future_t<when_any_pair>
inline

等待任一的可等待对象完成,不定参数版。

当前协程的调度器通过current_scheduler()宏获得,与带调度器参数的版本相比,多一次resumeable function构造,效率可能低一点。

参数
args...所有的可等待对象。要么是_AwaitableT<>类型,要么是返回_AwaitableT<>类型的函数(对象)。
返回值
[co_await]std::pair<intptr_t, std::any>。第一个值指示哪个对象完成了,第二个值存访的对应的返回数据。

◆ when_any() [2/6]

template<_ContainerT _Cont>
auto resumef::when_::when_any ( _Cont &&  cont) -> future_t<when_any_pair>
inline

等待任一的可等待对象完成,容器版。

当前协程的调度器通过current_scheduler()宏获得,与带调度器参数的版本相比,多一次resumeable function构造,效率可能低一点。

参数
cont存访可等待对象的容器。容器内存放的,要么是_AwaitableT<>类型,要么是返回_AwaitableT<>类型的函数(对象)。
返回值
[co_await]std::pair<intptr_t, std::any>。第一个值指示哪个对象完成了,第二个值存访的对应的返回数据。

◆ when_any() [3/6]

template<_WhenIterT _Iter>
auto resumef::when_::when_any ( _Iter  begin,
_Iter  end 
) -> future_t<when_any_pair>
inline

等待任一的可等待对象完成,迭代器版。

当前协程的调度器通过current_scheduler()宏获得,与带调度器参数的版本相比,多一次resumeable function构造,效率可能低一点。

参数
begin可等待对象容器的起始迭代器。迭代器指向的,要么是_AwaitableT<>类型,要么是返回_AwaitableT<>类型的函数(对象)。
end可等待对象容器的结束迭代器。
返回值
[co_await]std::pair<intptr_t, std::any>。第一个值指示哪个对象完成了,第二个值存访的对应的返回数据。

◆ when_any() [4/6]

template<_WhenTaskT... _Awaitable>
auto resumef::when_::when_any ( scheduler_t sch,
_Awaitable &&...  args 
) -> detail::when_future_t<when_any_pair>
inline

等待任一的可等待对象完成,不定参数版。

参数
sch当前协程的调度器。
args...所有的可等待对象。要么是_AwaitableT<>类型,要么是返回_AwaitableT<>类型的函数(对象)。
返回值
[co_await]std::pair<intptr_t, std::any>。第一个值指示哪个对象完成了,第二个值存访的对应的返回数据。

◆ when_any() [5/6]

template<_ContainerT _Cont>
auto resumef::when_::when_any ( scheduler_t sch,
_Cont &  cont 
) -> detail::when_future_t<when_any_pair>
inline

等待任一的可等待对象完成,容器版。

参数
sch当前协程的调度器。
cont存访可等待对象的容器。容器内存放的,要么是_AwaitableT<>类型,要么是返回_AwaitableT<>类型的函数(对象)。
返回值
[co_await]std::pair<intptr_t, std::any>。第一个值指示哪个对象完成了,第二个值存访的对应的返回数据。

◆ when_any() [6/6]

template<_WhenIterT _Iter>
auto resumef::when_::when_any ( scheduler_t sch,
_Iter  begin,
_Iter  end 
) -> detail::when_future_t<when_any_pair>
inline

等待任一的可等待对象完成,迭代器版。

参数
sch当前协程的调度器。
begin可等待对象容器的起始迭代器。迭代器指向的,要么是_AwaitableT<>类型,要么是返回_AwaitableT<>类型的函数(对象)。
end可等待对象容器的结束迭代器。
返回值
[co_await]std::pair<intptr_t, std::any>。第一个值指示哪个对象完成了,第二个值存访的对应的返回数据。

该结构体的文档由以下文件生成: