5 #include <libcopp/utils/config/libcopp_build_features.h>
9 LIBCOPP_COPP_NAMESPACE_BEGIN
11 template <class T, class TPTR = typename poll_storage_ptr_selector<T>::type>
12 class LIBCOPP_COPP_API_HEAD_ONLY
poller {
22 inline poller() LIBCOPP_MACRO_NOEXCEPT { poll_storage::construct_default_storage(storage_data_); }
25 inline poller(U &&...in) LIBCOPP_MACRO_NOEXCEPT {
26 setup_from(std::forward<U>(in)...);
29 inline poller(
self_type &&other) LIBCOPP_MACRO_NOEXCEPT { setup_from(std::move(other)); }
32 setup_from(std::move(other));
38 setup_from(std::forward<U>(in));
47 return poll_storage::unwrap(storage_data_).get();
52 return poll_storage::unwrap(storage_data_);
63 template <
class U,
class UDELETER,
64 typename std::enable_if<std::is_base_of<T, typename std::decay<U>::type>::value,
bool>::type =
false>
65 inline void setup_from(std::unique_ptr<U, UDELETER> &&in) {
66 poll_storage::construct_storage(storage_data_, std::move(in));
69 template <
class... TARGS>
71 poll_storage::construct_storage(storage_data_, std::forward<TARGS>(args)...);
75 poll_storage::move_storage(storage_data_, std::move(other.storage_data_));
82 LIBCOPP_COPP_NAMESPACE_END
void setup_from(TARGS &&...args)
UTIL_FORCEINLINE const ptr_type & raw_ptr() const LIBCOPP_MACRO_NOEXCEPT
void setup_from(self_type &&other)
typename poll_storage::ptr_type ptr_type
storage_type storage_data_
UTIL_FORCEINLINE const value_type * data() const LIBCOPP_MACRO_NOEXCEPT
typename poll_storage::storage_type storage_type
UTIL_FORCEINLINE bool is_ready() const LIBCOPP_MACRO_NOEXCEPT
void setup_from(std::unique_ptr< U, UDELETER > &&in)
poller & operator=(self_type &&other) LIBCOPP_MACRO_NOEXCEPT
UTIL_FORCEINLINE friend void swap(self_type &l, self_type &r) LIBCOPP_MACRO_NOEXCEPT
UTIL_FORCEINLINE value_type * data() LIBCOPP_MACRO_NOEXCEPT
UTIL_FORCEINLINE void swap(self_type &other) LIBCOPP_MACRO_NOEXCEPT
UTIL_FORCEINLINE void reset()
poller() LIBCOPP_MACRO_NOEXCEPT
poller(self_type &&other) LIBCOPP_MACRO_NOEXCEPT
typename poll_storage::value_type value_type
poller(U &&...in) LIBCOPP_MACRO_NOEXCEPT
poller & operator=(U &&in) LIBCOPP_MACRO_NOEXCEPT
UTIL_FORCEINLINE bool is_pending() const LIBCOPP_MACRO_NOEXCEPT
UTIL_FORCEINLINE ptr_type & raw_ptr() LIBCOPP_MACRO_NOEXCEPT
std::shared_ptr< cli::cmd_option_value > value_type
void swap(intrusive_ptr< T > &lhs, intrusive_ptr< T > &rhs)