traverse.h
Go to the documentation of this file.
50 std::cout << "ttg::Traverse: " << tt->get_name() << " input terminal #" << count << " " << in->get_name()
150 std::is_void_v<meta::void_t<decltype(std::declval<InVisitor>()(std::declval<TerminalBase *>()))>>,
153 std::is_void_v<meta::void_t<decltype(std::declval<OutVisitor>()(std::declval<TerminalBase *>()))>>,
159 Traverse(TTVisitor_ &&tt_v = TTVisitor_{}, InVisitor_ &&in_v = InVisitor_{}, OutVisitor_ &&out_v = OutVisitor_{})
170 std::enable_if_t<std::is_base_of_v<TTBase, std::decay_t<decltype(*(std::declval<TTBasePtr>()))>> && (std::is_base_of_v<TTBase, std::decay_t<decltype(*(std::declval<TTBasePtrs>()))>> && ...),
204 template <typename TTVisitor = decltype(trivial_1param_lambda)&, typename InVisitor = decltype(trivial_1param_lambda)&, typename OutVisitor = decltype(trivial_1param_lambda)&>
205 auto make_traverse(TTVisitor &&tt_v = trivial_1param_lambda, InVisitor &&in_v = trivial_1param_lambda, OutVisitor &&out_v = trivial_1param_lambda) {
207 std::remove_reference_t<OutVisitor>>{std::forward<TTVisitor>(tt_v), std::forward<InVisitor>(in_v),
217 std::cout << "tt: " << (void *)tt << " " << tt->get_name() << " numin " << tt->get_inputs().size() << " numout "
221 std::cout << " in: " << in->get_index() << " " << in->get_name() << " " << in->get_key_type_str() << " "
225 std::cout << " out: " << out->get_index() << " " << out->get_name() << " " << out->get_key_type_str() << " "
const std::vector< TerminalBase * > & get_inputs() const
Returns the vector of input terminals.
Definition: tt.h:223
const std::vector< TerminalBase * > & get_outputs() const
Returns the vector of output terminals.
Definition: tt.h:226
Definition: terminal.h:12
Traverses a graph of ops in depth-first manner following out edges.
Definition: traverse.h:144
Traverse(TTVisitor_ &&tt_v=TTVisitor_{}, InVisitor_ &&in_v=InVisitor_{}, OutVisitor_ &&out_v=OutVisitor_{})
Definition: traverse.h:159
std::enable_if_t< std::is_base_of_v< TTBase, std::decay_t< decltype(*(std::declval< TTBasePtr >)))> > &&(std::is_base_of_v< TTBase, std::decay_t< decltype(*(std::declval< TTBasePtrs >)))> bool operator()(TTBasePtr &&op, TTBasePtrs &&... ops)
Definition: traverse.h:172
Traverses a graph of TTs in depth-first manner following out edges.
Definition: traverse.h:14
std::enable_if_t< std::is_base_of_v< TTBase, TT >, bool > traverse(const std::unique_ptr< TT, Deleter > &tt)
Definition: traverse.h:120
virtual void ttfunc(TTBase *tt)=0
std::enable_if_t< std::is_base_of_v< TTBase, TT >, bool > traverse(const std::shared_ptr< TTBase > &tt)
Definition: traverse.h:113
virtual void infunc(TerminalBase *in)=0
std::enable_if_t< std::is_base_of_v< TTBase, TT > &&!std::is_same_v< TT, TTBase >, bool > traverse(TT *tt)
Definition: traverse.h:106
virtual void outfunc(TerminalBase *out)=0
Definition: ttg.h:1184
auto make_traverse(TTVisitor &&tt_v=trivial_1param_lambda, InVisitor &&in_v=trivial_1param_lambda, OutVisitor &&out_v=trivial_1param_lambda)
Definition: traverse.h:205