Base class of all pipelining factories. More...
#include <tpie/pipelining/factory_base.h>
Inherited by tpie::pipelining::serialization_bits::sort_factory_base< default_pred_sort_factory >, tpie::pipelining::bits::sort_factory_base< default_pred_sort_factory< store_t >, store_t >, tpie::pipelining::serialization_bits::sort_factory_base< sort_factory< pred_t > >, tpie::pipelining::bits::sort_factory_base< sort_factory< pred_t, store_t >, store_t >, tpie::pipelining::bits::passive_sorter_factory_input< T, pred_t, store_t >, tpie::pipelining::bits::passive_sorter_factory_output< T, pred_t, store_t >, tpie::pipelining::bits::sort_factory_base< child_t, store_t >, tpie::pipelining::factory< R, T >, tpie::pipelining::parallel_bits::factory< fact_t >, tpie::pipelining::serialization_bits::passive_sorter_factory_input< Traits >, tpie::pipelining::serialization_bits::passive_sorter_factory_output< Traits >, tpie::pipelining::serialization_bits::sort_factory_base< child_t >, tpie::pipelining::split_factory< I, OB, O >, tpie::pipelining::tempfactory< Holder, T >, tpie::pipelining::termfactory< R, T >, and tpie::pipelining::tfactory< R, Args< TT...>, T...>.
Public Member Functions | |
factory_base (const factory_base &other)=delete | |
factory_base (factory_base &&)=default | |
factory_base & | operator= (const factory_base &other)=delete |
factory_base & | operator= (factory_base &&)=default |
void | memory (double amount) |
Set memory fraction for this node in the pipeline phase. More... | |
double | memory () const |
Set memory fraction for this node in the pipeline phase. More... | |
void | hook_initialization (factory_init_hook *hook) |
Add a node initialization hook. More... | |
void | copy_hooks_to (factory_base &other) const |
Copy the hooks that have been added to this factory to another. More... | |
void | init_node (node &r) |
Initialize node constructed in a subclass. More... | |
void | init_sub_node (node &r) |
Initialize node constructed in a subclass. More... | |
void | add_default_edge (node &r, const node &dest) const |
Used by pipe_base classes to set a default actor edge for ordinary push/pull nodes. More... | |
void | add_default_edge (node &r, const node_token &dest) const |
Used by pipe_base classes to set a default actor edge for ordinary push/pull nodes. More... | |
void | add_node_set_edges (node &r) const |
void | name (const std::string &n, priority_type p) |
Set name for this node. More... | |
void | phase_name (const std::string &n, priority_type p) |
Set name for this phase. More... | |
void | push_breadcrumb (const std::string &n) |
Set a prefix for the name of this node. More... | |
void | set_destination_kind_push () |
Used by pipe_base classes to indicate that the default actor edge is a push edge. More... | |
void | set_destination_kind_pull () |
Used by pipe_base classes to indicate that the default actor edge is a pull edge. More... | |
void | add_to_set (node_set s) |
void | add_dependencies (node_set s) |
void | add_forwarding_dependencies (node_set s) |
void | forward (const std::string &key, any_noncopyable value) |
Base class of all pipelining factories.
The subclass must define an inner template struct named constructed
, that takes one template parameter dest_t
and defines an inner typedef named type
that is the actual type of node constructed.
If the factory foo_factory
constructs foo
objects, then the type expression foo_factory::constructed<bar<baz> >::type
should be equal to foo<bar<baz> >
.
The subclass must also define a template const method named construct
, that takes one template parameter dest_t
, has the return type constructed<dest_t>::type
and takes just one parameter dest
of type dest_t
.
If the factory constructs just one node
descendent, then the factory should call the factory_base::init_node
method with this node
as parameter. For example see tpie/pipelining/factory_helpers.h.
If the factory constructs multiple node
descendents, then the factory should call the factory_base::init_sub_node
method for each of the nodes
. For example see sort_factory_base
in tpie/pipelining/sort.h.
Definition at line 73 of file factory_base.h.
Used by pipe_base classes to set a default actor edge for ordinary push/pull nodes.
Definition at line 178 of file factory_base.h.
References tpie::pipelining::node::get_token().
|
inline |
Used by pipe_base classes to set a default actor edge for ordinary push/pull nodes.
Definition at line 186 of file factory_base.h.
References tpie::pipelining::node::add_pull_source(), tpie::pipelining::node::add_push_destination(), tpie::pipelining::node::get_id(), and tpie::pipelining::node::get_node_map().
|
inline |
Copy the hooks that have been added to this factory to another.
Definition at line 118 of file factory_base.h.
|
inline |
Add a node initialization hook.
When a node is instantiated in construct(), the given hook will get a chance to do some additional initialization.
Definition at line 111 of file factory_base.h.
|
inline |
Initialize node constructed in a subclass.
This lets the user define a name or memory fraction for this certain node in the pipeline phase, and it lets initialization hooks do their thing.
If more than one node is constructed in the subclass in construct()
, the implementation should use init_sub_node
instead.
Definition at line 134 of file factory_base.h.
References tpie::pipelining::node::set_breadcrumb(), tpie::pipelining::node::set_name(), and tpie::pipelining::node::set_phase_name().
|
inline |
Initialize node constructed in a subclass.
This lets the user define a name or memory fraction for this certain node in the pipeline phase, and it lets initialization hooks do their thing.
If just one node is constructed in the subclass in construct()
, the implementation should use init_node
instead.
Definition at line 157 of file factory_base.h.
References tpie::pipelining::node::set_breadcrumb().
|
inline |
Set memory fraction for this node in the pipeline phase.
In the absence of minimum and maximum memory requirements set by node implementations, the memory assigned to the node will be proportional to the amount
parameter which sets the memory priority of this node in relation to the rest of the phase.
Definition at line 89 of file factory_base.h.
Referenced by tpie::pipelining::bits::pipe_base< pipe_begin< fact_t > >::memory().
|
inline |
Set memory fraction for this node in the pipeline phase.
In the absence of minimum and maximum memory requirements set by node implementations, the memory assigned to the node will be proportional to the amount
parameter which sets the memory priority of this node in relation to the rest of the phase.
Definition at line 101 of file factory_base.h.
|
inline |
Set name for this node.
The name is used in the GraphViz plot generated by pipeline::plot.
The name priority given in the second argument should indicate how important this node is for the current phase, and is used in naming the progress indicator for this phase. The node with the highest priority name gets to name the entire phase.
Definition at line 241 of file factory_base.h.
Referenced by tpie::pipelining::bits::pipe_base< pipe_begin< fact_t > >::name().
|
inline |
Set name for this phase.
The maximal priority phase name given for a phase wins.
Definition at line 252 of file factory_base.h.
Referenced by tpie::pipelining::bits::pipe_base< pipe_begin< fact_t > >::phase_name().
|
inline |
Set a prefix for the name of this node.
The name is used in the GraphViz plot generated by pipeline::plot.
Definition at line 264 of file factory_base.h.
Referenced by tpie::pipelining::bits::pipe_base< pipe_begin< fact_t > >::breadcrumb().
|
inline |
Used by pipe_base classes to indicate that the default actor edge is a pull edge.
Definition at line 281 of file factory_base.h.
|
inline |
Used by pipe_base classes to indicate that the default actor edge is a push edge.
Definition at line 273 of file factory_base.h.
Referenced by tpie::pipelining::pipe_middle< fact_t >::operator|().