9 #include <density/dynamic_reference.h> 10 #include <density/runtime_type.h> 21 template <
typename TARGET_TYPE> constexpr
static f_istream make() noexcept
30 void operator()(std::istream & i_istream,
void * i_dest)
const 33 (*m_function)(i_istream, i_dest);
37 using Function = void (*)(std::istream & i_istream,
void * i_dest);
38 Function
const m_function;
39 constexpr
f_istream(Function i_function) noexcept : m_function(i_function) {}
40 template <
typename TARGET_TYPE>
static void invoke(std::istream & i_istream,
void * i_dest)
42 const auto derived =
static_cast<TARGET_TYPE *
>(i_dest);
43 i_istream >> *derived;
52 template <
typename TARGET_TYPE> constexpr
static f_ostream make() noexcept
61 void operator()(std::ostream & i_ostream,
const void * i_dest)
const 64 (*m_function)(i_ostream, i_dest);
68 using Function = void (*)(std::ostream & i_ostream,
const void * i_dest);
69 Function
const m_function;
70 constexpr
f_ostream(Function i_function) noexcept : m_function(i_function) {}
71 template <
typename TARGET_TYPE>
72 static void invoke(std::ostream & i_ostream,
const void * i_dest)
74 const auto derived =
static_cast<const TARGET_TYPE *
>(i_dest);
75 i_ostream << *derived;
95 i_ptr.type().template get_feature<f_istream>()(i_source_stream, i_ptr.address());
96 return i_source_stream;
108 typename... FEATURES,
114 i_ref.type().template get_feature<f_ostream>()(i_dest_stream, i_ref.address());
115 return i_dest_stream;
Definition: io_runtimetype_features.h:17
std::ostream & operator<<(std::ostream &i_dest_stream, const dynamic_reference< runtime_type< FEATURES... >> &i_ref)
Definition: io_runtimetype_features.h:111
Definition: conc_function_queue.h:11
Definition: runtime_type.h:665
std::istream & operator>>(std::istream &i_source_stream, const dynamic_reference< runtime_type< FEATURES... >> &i_ptr)
Definition: io_runtimetype_features.h:92
void operator()(std::istream &i_istream, void *i_dest) const
Definition: io_runtimetype_features.h:30
void operator()(std::ostream &i_ostream, const void *i_dest) const
Definition: io_runtimetype_features.h:61
static constexpr f_istream make() noexcept
Definition: io_runtimetype_features.h:21
Definition: io_runtimetype_features.h:48
Definition: runtime_type.h:46
static constexpr f_ostream make() noexcept
Definition: io_runtimetype_features.h:52
Definition: dynamic_reference.h:107
Definition: runtime_type.h:509
#define DENSITY_ASSUME(bool_expr,...)
Definition: density_config.h:46