dlvhex
2.5.0
|
The EvalGraph template manages a generic evaluation graph: it takes care of a correct join order among in-edges of units,. More...
#include <include/dlvhex2/EvalGraph.h>
Data Structures | |
struct | EvalUnitDepPropertyBundle |
Couples an EvalUnitDep with its properties. More... | |
struct | EvalUnitPropertyBundle |
Couples an EvalUnit with its properties. More... | |
struct | Impl |
Helper for printing a single EvalUnit in dot format. More... | |
class | Observer |
Observer. More... | |
Public Types | |
typedef EvalUnitPropertyBaseT | EvalUnitPropertyBase |
typedef EvalUnitDepPropertyBaseT | EvalUnitDepPropertyBase |
typedef boost::adjacency_list < boost::vecS, boost::vecS, boost::bidirectionalS, EvalUnitPropertyBundle, EvalUnitDepPropertyBundle > | EvalGraphInt |
typedef boost::graph_traits < EvalGraphInt > | Traits |
typedef EvalGraphInt::vertex_descriptor | EvalUnit |
typedef EvalGraphInt::edge_descriptor | EvalUnitDep |
typedef Traits::vertex_iterator | EvalUnitIterator |
typedef Traits::edge_iterator | DependencyIterator |
typedef Traits::out_edge_iterator | PredecessorIterator |
typedef Traits::in_edge_iterator | SuccessorIterator |
typedef boost::shared_ptr < Observer > | ObserverPtr |
Public Member Functions | |
EvalGraph () | |
Constructor. | |
EvalGraph (const EvalGraph &other) | |
Copy-constructor. | |
const EvalGraphInt & | getInt () const |
EvalUnit | addUnit (const EvalUnitPropertyBundle &prop) |
Adds an evaluation unit with properties. | |
EvalUnitDep | addDependency (EvalUnit u1, EvalUnit u2, const EvalUnitDepPropertyBundle &prop) |
Adds a dependency. | |
void | addObserver (ObserverPtr o) |
Adds an observer. | |
void | eraseObserver (ObserverPtr o) |
Removes an observer. | |
std::pair< EvalUnitIterator, EvalUnitIterator > | getEvalUnits () const |
Retrieves all evaluation units. | |
std::pair< PredecessorIterator, PredecessorIterator > | getPredecessors (EvalUnit u) const |
std::pair< SuccessorIterator, SuccessorIterator > | getSuccessors (EvalUnit u) const |
Successors are eval units we provide input to, edges are dependencies, so successors are at incoming edges. | |
const EvalUnitDepPropertyBundle & | propsOf (EvalUnitDep d) const |
Retrieves the properties of an evaluation unit dependency. | |
EvalUnitDepPropertyBundle & | propsOf (EvalUnitDep d) |
Retrieves the properties of an evaluation unit dependency. | |
const EvalUnitPropertyBundle & | propsOf (EvalUnit u) const |
Retrieves the properties of an evaluation unit. | |
EvalUnitPropertyBundle & | propsOf (EvalUnit u) |
Retrieves the properties of an evaluation unit. | |
EvalUnit | sourceOf (EvalUnitDep d) const |
Retrieves the source unit of a depedency. | |
EvalUnit | targetOf (EvalUnitDep d) const |
Retrieves the target unit of a depedency. | |
unsigned | countEvalUnits () const |
Returns the number of evaluation units. | |
unsigned | countEvalUnitDeps () const |
Returns the number of dependencies. | |
void | writeGraphViz (std::ostream &o, bool verbose) const |
Output graph as graphviz source (dot file). | |
Private Attributes | |
EvalGraphInt | eg |
std::set< ObserverPtr > | observers |
The EvalGraph template manages a generic evaluation graph: it takes care of a correct join order among in-edges of units,.
Definition at line 62 of file EvalGraph.h.
typedef Traits::edge_iterator EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::DependencyIterator |
Definition at line 137 of file EvalGraph.h.
typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, EvalUnitPropertyBundle, EvalUnitDepPropertyBundle> EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::EvalGraphInt |
Definition at line 131 of file EvalGraph.h.
typedef EvalGraphInt::vertex_descriptor EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::EvalUnit |
Definition at line 134 of file EvalGraph.h.
typedef EvalGraphInt::edge_descriptor EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::EvalUnitDep |
Definition at line 135 of file EvalGraph.h.
typedef EvalUnitDepPropertyBaseT EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::EvalUnitDepPropertyBase |
Definition at line 69 of file EvalGraph.h.
typedef Traits::vertex_iterator EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::EvalUnitIterator |
Definition at line 136 of file EvalGraph.h.
typedef EvalUnitPropertyBaseT EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::EvalUnitPropertyBase |
Definition at line 68 of file EvalGraph.h.
typedef boost::shared_ptr<Observer> EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::ObserverPtr |
Definition at line 154 of file EvalGraph.h.
typedef Traits::out_edge_iterator EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::PredecessorIterator |
Definition at line 138 of file EvalGraph.h.
typedef Traits::in_edge_iterator EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::SuccessorIterator |
Definition at line 139 of file EvalGraph.h.
typedef boost::graph_traits<EvalGraphInt> EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::Traits |
Definition at line 132 of file EvalGraph.h.
EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::EvalGraph | ( | ) | [inline] |
Constructor.
Definition at line 168 of file EvalGraph.h.
EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::EvalGraph | ( | const EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT > & | other | ) |
Copy-constructor.
This is not implemented on purpose (=linker error) because it is forbidden to use (it cannot be private as this would cause concept checks to fail (TODO: check why clang produces such bad error messages in this case).
other | Second EvalGraph. |
EvalUnitDep EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::addDependency | ( | EvalUnit | u1, |
EvalUnit | u2, | ||
const EvalUnitDepPropertyBundle & | prop | ||
) | [inline] |
Adds a dependency.
u1 | From unit. |
u2 | To unit. |
prop | Properties of the dependency. |
Definition at line 192 of file EvalGraph.h.
References EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::eg, EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::getPredecessors(), EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::EvalUnitDepPropertyBundle::joinOrder, EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::observers, and EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::propsOf().
Referenced by BOOST_FIXTURE_TEST_CASE(), EvalGraphBuilder::createEvalUnit(), and main().
void EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::addObserver | ( | ObserverPtr | o | ) | [inline] |
Adds an observer.
o | Observer to add. |
Definition at line 223 of file EvalGraph.h.
References EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::observers.
EvalUnit EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::addUnit | ( | const EvalUnitPropertyBundle & | prop | ) | [inline] |
Adds an evaluation unit with properties.
prop | Evaluation unit and properties to add. |
Definition at line 181 of file EvalGraph.h.
References EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::eg, and EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::observers.
Referenced by BOOST_FIXTURE_TEST_CASE(), EvalGraphBuilder::createEvalUnit(), and main().
unsigned EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::countEvalUnitDeps | ( | ) | const [inline] |
Returns the number of dependencies.
Definition at line 314 of file EvalGraph.h.
References EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::eg.
Referenced by main().
unsigned EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::countEvalUnits | ( | ) | const [inline] |
Returns the number of evaluation units.
Definition at line 307 of file EvalGraph.h.
References EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::eg.
Referenced by main().
void EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::eraseObserver | ( | ObserverPtr | o | ) | [inline] |
Removes an observer.
o | Observer to remove. |
Definition at line 229 of file EvalGraph.h.
References EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::observers.
std::pair<EvalUnitIterator, EvalUnitIterator> EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::getEvalUnits | ( | ) | const [inline] |
Retrieves all evaluation units.
Definition at line 236 of file EvalGraph.h.
References EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::eg.
Referenced by BOOST_FIXTURE_TEST_CASE(), main(), and writeEgMgGraphViz().
const EvalGraphInt& EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::getInt | ( | ) | const [inline] |
Definition at line 176 of file EvalGraph.h.
References EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::eg.
std::pair<PredecessorIterator, PredecessorIterator> EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::getPredecessors | ( | EvalUnit | u | ) | const [inline] |
Definition at line 244 of file EvalGraph.h.
References EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::eg.
Referenced by EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::addDependency().
std::pair<SuccessorIterator, SuccessorIterator> EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::getSuccessors | ( | EvalUnit | u | ) | const [inline] |
Successors are eval units we provide input to, edges are dependencies, so successors are at incoming edges.
u | Evaluation unit. |
u
represented by a pair of begin and end iterator. Definition at line 254 of file EvalGraph.h.
References EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::eg.
const EvalUnitDepPropertyBundle& EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::propsOf | ( | EvalUnitDep | d | ) | const [inline] |
Retrieves the properties of an evaluation unit dependency.
d | EvalUnitDep. |
d
. Definition at line 262 of file EvalGraph.h.
References EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::eg.
Referenced by EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::addDependency(), EvalGraphBuilder::createEvalUnit(), and writeEgMgGraphViz().
EvalUnitDepPropertyBundle& EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::propsOf | ( | EvalUnitDep | d | ) | [inline] |
Retrieves the properties of an evaluation unit dependency.
d | EvalUnitDep. |
d
. Definition at line 270 of file EvalGraph.h.
References EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::eg.
const EvalUnitPropertyBundle& EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::propsOf | ( | EvalUnit | u | ) | const [inline] |
Retrieves the properties of an evaluation unit.
u | EvalUnit. |
u
. Definition at line 277 of file EvalGraph.h.
References EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::eg.
EvalUnitPropertyBundle& EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::propsOf | ( | EvalUnit | u | ) | [inline] |
Retrieves the properties of an evaluation unit.
u | EvalUnit. |
u
. Definition at line 285 of file EvalGraph.h.
References EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::eg.
EvalUnit EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::sourceOf | ( | EvalUnitDep | d | ) | const [inline] |
Retrieves the source unit of a depedency.
d | EvalUnitDep. |
d
. Definition at line 292 of file EvalGraph.h.
References EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::eg.
EvalUnit EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::targetOf | ( | EvalUnitDep | d | ) | const [inline] |
Retrieves the target unit of a depedency.
d | EvalUnitDep. |
d
. Definition at line 300 of file EvalGraph.h.
References EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::eg.
void EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::writeGraphViz | ( | std::ostream & | o, |
bool | verbose | ||
) | const |
Output graph as graphviz source (dot file).
Helper for printing the graph in dot format.
o | Stream to print the graph to. |
verbose | True to include more information. |
o | Stream to write to. |
verbose | True to include more detailed information. |
Definition at line 366 of file EvalGraph.h.
References graphviz::escape().
EvalGraphInt EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::eg [private] |
Definition at line 160 of file EvalGraph.h.
Referenced by EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::addDependency(), EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::addUnit(), EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::countEvalUnitDeps(), EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::countEvalUnits(), EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::getEvalUnits(), EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::getInt(), EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::getPredecessors(), EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::getSuccessors(), EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::propsOf(), EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::sourceOf(), and EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::targetOf().
std::set<ObserverPtr> EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::observers [private] |
Definition at line 161 of file EvalGraph.h.
Referenced by EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::addDependency(), EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::addObserver(), EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::addUnit(), and EvalGraph< EvalUnitPropertyBaseT, EvalUnitDepPropertyBaseT >::eraseObserver().