12 #ifndef DOCWIRE_OUTPUT_H
13 #define DOCWIRE_OUTPUT_H
15 #include "chain_element.h"
18 #include "parsing_chain.h"
19 #include <type_traits>
27 concept OStreamDerived = std::derived_from<T, std::ostream>;
30 concept ostream_derived_ref_qualified = OStreamDerived<std::remove_reference_t<T>>;
45 : m_out_obj{out_stream}
49 : m_out_obj{out_vector}
57 virtual continuation operator()(message_ptr msg,
const message_callbacks& emit_message)
override;
63 inline parsing_chain operator|(ref_or_owned<chain_element> element, ref_or_owned<std::ostream> stream)
65 return element | output_chain_element(stream);
68 inline parsing_chain& operator|=(parsing_chain& chain, ref_or_owned<std::ostream> stream)
70 return chain |= output_chain_element(stream);
73 inline parsing_chain
operator|(ref_or_owned<chain_element> element, ref_or_owned<std::vector<message_ptr>> vector)
75 return element | output_chain_element(vector);
78 inline parsing_chain& operator|=(parsing_chain& chain, ref_or_owned<std::vector<message_ptr>> vector)
80 return chain |= output_chain_element(vector);
output_chain_element class is responsible for saving data from parsing chain to an output stream.
bool is_leaf() const override
Check if chain element is a leaf (last element which doesn't produce any messages)....
output_chain_element(ref_or_owned< std::ostream > out_stream)
A utility class that simplifies declaring function attributes that need to be stored without requirin...
auto operator|(V &&value, F &&function)
Binds a value to a function, enabling the creation of a function call chain.
The main namespace for the DocWire SDK.