Browse Source

删除event不必要的代码

tags/v2.9.7
tearshark 4 years ago
parent
commit
474f6fa04f
3 changed files with 4 additions and 18 deletions
  1. 0
    5
      librf/src/event_v2.cpp
  2. 0
    11
      librf/src/event_v2.h
  3. 4
    2
      librf/src/event_v2.inl

+ 0
- 5
librf/src/event_v2.cpp 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() };
}
}
}

+ 0
- 11
librf/src/event_v2.h 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;
});
}
};
}
}

+ 4
- 2
librf/src/event_v2.inl 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() };
}

Loading…
Cancel
Save