39 template <
typename SignalT>
41 :
private watchable<meta::value_t<SignalT> >
43 template <
typename T>
friend class inoutput_impl;
44 friend class detail::access;
46 using base_t = watchable<meta::value_t<SignalT> >;
48 using signal_ptr_t = std::shared_ptr<SignalT>;
50 const signal_ptr_t& signal()
const {
return signal_; }
53 using value_type = meta::value_t<SignalT>;
55 inoutput_impl(signal_ptr_t sig)
56 : signal_(
std::move(sig)) {}
58 inoutput_impl() =
default;
59 inoutput_impl(inoutput_impl&&) =
default;
60 inoutput_impl& operator=(inoutput_impl&&) =
default;
61 inoutput_impl(
const inoutput_impl&) =
delete;
62 inoutput_impl& operator=(
const inoutput_impl&) =
delete;
65 inoutput_impl& operator=(inoutput_impl<T>&& x)
67 base_t::operator=(std::move(x));
68 signal_ = std::move(x.signal_);
73 inoutput_impl(inoutput_impl<T>&& x)
74 : base_t(
std::move(x))
75 , signal_(
std::move(x.signal_))
84 return signal_->send_up(std::forward<T>(value));
96 class inoutput :
public detail::inoutput_impl<detail::up_down_signal<T> >
98 using base_t = detail::inoutput_impl<detail::up_down_signal<T> >;
106 template <
typename InoutT>
109 (Inout_value<InoutT>()),
110 detail::inoutput_impl<detail::signal_type_t<InoutT> > >
112 return detail::access::signal(std::forward<InoutT>(
object));
#define ABL_DECLTYPE_RETURN(body_expr)
Utility for defining generic functions with a deduced return type, that are composed of a single expr...
typename std::enable_if< X, T >::type enable_if_t
Similar to C++14 std::enable_if_t.
auto inout(InoutT &&object) -> estd::enable_if_t< (Inout_value< InoutT >()), detail::inoutput_impl< detail::signal_type_t< InoutT > > >
Creates an inout from another inout value.
This module implements the signal flow in funken.
Provides access to reading and writing values of type T.
C++ amazing templates and reusable implementations awesomeness.