tt.h
Go to the documentation of this file.
77 0, (register_terminal<out, std::tuple_element_t<IS, terminalsT>, IS>(std::get<IS>(terms), names[IS], setfunc),
85 register_terminals<false>(std::make_index_sequence<std::tuple_size_v<terminalsT>>{}, terms, names,
92 register_terminals<true>(std::make_index_sequence<std::tuple_size_v<terminalsT>>{}, terms, names,
134 : instance_id(next_instance_id()), is_ttg_(false), name(name), inputs(numins), outputs(numouts) {}
141 void set_outputs_tls_ptr(const std::vector<TerminalBase *> *ptr) { outputs_tls_ptr_accessor() = ptr; }
162 //Lazy pulling delays invoking pull terminals until all inputs from push terminals for a task have arrived.
202 return owning_ttg ? std::cref(*owning_ttg) : std::optional<std::reference_wrapper<const TTBase>>{};
229 static const std::vector<TerminalBase *> *get_outputs_tls_ptr() { return outputs_tls_ptr_accessor(); }
236 if (i >= inputs.size()) throw name + ":TTBase: you are requesting an input terminal that does not exist";
242 if (i >= outputs.size()) throw name + "TTBase: you are requesting an output terminal that does not exist";
const std::vector< TerminalBase * > & get_inputs() const
Returns the vector of input terminals.
Definition: tt.h:223
void set_terminals(const terminalsT &terms, const setfuncT setfunc)
Definition: tt.h:105
void set_outputs_tls_ptr(const std::vector< TerminalBase * > *ptr)
Definition: tt.h:141
virtual ~TTBase()=default
const std::vector< TerminalBase * > & get_outputs() const
Returns the vector of output terminals.
Definition: tt.h:226
void trace(const T &t, const Ts &...ts)
Like ttg::trace(), but only produces tracing output if this->tracing()==true
Definition: tt.h:186
TTBase(const std::string &name, size_t numins, size_t numouts)
Definition: tt.h:133
static const std::vector< TerminalBase * > * get_outputs_tls_ptr()
Returns this thread's pointer to the vector of output terminals.
Definition: tt.h:229
void register_terminal(terminalT &term, const std::string &name, const setfuncT setfunc)
Definition: tt.h:64
ttg::TerminalBase * in()
Returns a pointer to the i'th input terminal ... to make API consistent with TT.
Definition: tt.h:248
void set_terminals(std::index_sequence< IS... >, terminalsT &terms, const setfuncT setfunc)
Definition: tt.h:98
std::optional< std::reference_wrapper< const TTBase > > ttg() const
Definition: tt.h:201
virtual ttg::World get_world() const =0
static const std::vector< TerminalBase * > *& outputs_tls_ptr_accessor()
Definition: tt.h:136
void register_input_terminals(terminalsT &terms, const namesT &names)
Definition: tt.h:84
void register_terminals(std::index_sequence< IS... >, terminalsT &terms, const namesT &names, const setfuncT setfunc)
Definition: tt.h:74
virtual void fence()=0
ttg::TerminalBase * out()
Returns a pointer to the i'th output terminal ... to make API consistent with TT.
Definition: tt.h:254
void register_output_terminals(terminalsT &terms, const namesT &names)
Definition: tt.h:91
Definition: terminal.h:12
Definition: world.h:17
typename make_index_sequence_t< I... >::type make_index_sequence
Definition: make_index_sequence.hpp:46
void abort()
Aborts the TTG program using the default backend's ttg_abort method.
Definition: run.h:62
void log(const T &t, const Ts &... ts)
atomically prints to std::clog a sequence of items (separated by ttg::print_separator) followed by st...
Definition: print.h:146
constexpr bool trace_enabled()
returns whether tracing was enabled at configure time
Definition: trace.h:15
Definition: ptr.h:15