#include <SmacqGraph.h>
Public Member Functions | |
SmacqGraph () | |
Default CTOR. | |
SmacqGraph (ThreadSafeMultiSet< SmacqGraphNode_ptr > &children) | |
Construct from a vector of Children. | |
void | addQuery (DTS *, SmacqScheduler *, std::string query) |
Parse a query and add it to a container. | |
void | init (DTS *, SmacqScheduler *, bool do_optimize=true) |
This method must be called before the graphs are used. | |
void | shutdown () |
Shutdown all graphs. | |
void | clear () |
Erase container. | |
bool | empty () |
Return true iff the container is empty. | |
void | print (FILE *fh, int indent) |
Print the graphs. | |
std::string | print_query () |
Print the graph in re-parsable syntax. | |
SmacqGraph * | clone (SmacqGraphNode *newParent=NULL) |
Recursively clone a graph. | |
void | add_clone (SmacqGraphNode_ptr x, SmacqGraphNode *newParent) |
Add a clone of a graph to this container. | |
SmacqGraphNode * | getInvariants (DTS *, SmacqScheduler *, DtsField &) |
Return a subgraph containing only invariants over the specified field. | |
void | optimize () |
Preoptimize graph (unnecessary after init). | |
Combining Graphs | |
A container can have multiple heads and tails and may even be disconnected. | |
void | join (SmacqGraphNode *) |
Attach the specified graph onto the tail(s) of the graph(s). | |
void | join (SmacqGraph *, bool dofree=false) |
Attach the specified graph onto the tail(s) of the graph(s). | |
void | add_graph (SmacqGraphNode *) |
Add a new graph head. | |
void | add_graph (SmacqGraph *, bool dofree=false) |
Add new graph heads. | |
void | share_children_of (SmacqGraphNode *) |
Children of the specified graph will also become children of this. |
void SmacqGraph::addQuery | ( | DTS * | tenv, | |
SmacqScheduler * | sched, | |||
std::string | query | |||
) |
Parse a query and add it to a container.
Parse a query and add it to this container. Raise an exception on parse error.
SmacqGraph * SmacqGraph::clone | ( | SmacqGraphNode * | newParent = NULL |
) |
Recursively clone a graph.
Recursively clone a graph and all of it's children.
The clone is made a child of newParent, unless newParent is NULL.
Make the new graph be a child of the specified parent (which may be NULL).
SmacqGraphNode * SmacqGraph::getInvariants | ( | DTS * | dts, | |
SmacqScheduler * | sched, | |||
DtsField & | field | |||
) |
Return a subgraph containing only invariants over the specified field.
The subgraph will contain only boolean filters that are applied to all objects in the graph (e.g. not within an OR) and that do NOT use the specified field. The returned graph is newly allocated.
void SmacqGraph::init | ( | DTS * | dts, | |
SmacqScheduler * | sched, | |||
bool | do_optimize = true | |||
) |
This method must be called before the graphs are used.
Recursively initalize nodes in graph.
std::string SmacqGraph::print_query | ( | ) |
Print the graph in re-parsable syntax.
This function is IDENTICAL to SmacqGraphNode::print_query().
So much for polymorphism
void SmacqGraph::shutdown | ( | ) |
Shutdown all graphs.
Shutdown graphs.