1
0
mirror of https://github.com/tearshark/librf.git synced 2024-10-01 15:57:07 +08:00

删除event不必要的代码

This commit is contained in:
tearshark 2020-03-29 23:17:07 +08:00
parent 2d92dd0dde
commit 474f6fa04f
3 changed files with 4 additions and 18 deletions

View File

@ -200,10 +200,5 @@ namespace resumef
event_t::~event_t()
{
}
event_t::timeout_awaiter event_t::wait_until_(const clock_type::time_point& tp) const noexcept
{
return { tp, _event.get() };
}
}
}

View File

@ -215,18 +215,7 @@ namespace resumef
event_t& operator = (const event_t&) = default;
event_t& operator = (event_t&&) = default;
private:
//friend struct any_awaiter;
event_impl_ptr _event;
timeout_awaiter wait_until_(const clock_type::time_point& tp) const noexcept;
inline static bool is_all_succeeded(const std::vector<bool>& v)
{
return std::none_of(std::begin(v), std::end(v), [](auto v)
{
return v == false;
});
}
};
}
}

View File

@ -236,13 +236,15 @@ namespace resumef
template<class _Rep, class _Period>
inline event_t::timeout_awaiter event_t::wait_for(const std::chrono::duration<_Rep, _Period>& dt) const noexcept
{
return wait_until_(clock_type::now() + std::chrono::duration_cast<clock_type::duration>(dt));
clock_type::time_point tp2 = clock_type::now() + std::chrono::duration_cast<clock_type::duration>(dt);
return { tp2, _event.get() };
}
template<class _Clock, class _Duration>
inline event_t::timeout_awaiter event_t::wait_until(const std::chrono::time_point<_Clock, _Duration>& tp) const noexcept
{
return wait_until_(std::chrono::time_point_cast<clock_type::duration>(tp));
clock_type::time_point tp2 = std::chrono::time_point_cast<clock_type::duration>(tp);
return { tp2, _event.get() };
}