souffle  2.0.2-371-g6315b36
Public Member Functions | Protected Member Functions | Private Attributes
souffle::ast::ExecutionPlan Class Reference

#include <ExecutionPlan.h>

Inheritance diagram for souffle::ast::ExecutionPlan:
Inheritance graph
Collaboration diagram for souffle::ast::ExecutionPlan:
Collaboration graph

Public Member Functions

void apply (const NodeMapper &map) override
 Apply the mapper to all child nodes. More...
 
ExecutionPlanclone () const override
 Create a clone (i.e. More...
 
std::vector< const Node * > getChildNodes () const override
 Obtain a list of all embedded AST child nodes. More...
 
std::map< int, const ExecutionOrder * > getOrders () const
 Get orders. More...
 
void setOrderFor (int version, Own< ExecutionOrder > plan)
 Set execution order for a given rule version. More...
 
- Public Member Functions inherited from souffle::ast::Node
std::string extloc () const
 Return source location of the syntactic element. More...
 
const SrcLocationgetSrcLoc () const
 Return source location of the Node. More...
 
 Node (SrcLocation loc={})
 
bool operator!= (const Node &other) const
 Inequality check for two AST nodes. More...
 
bool operator== (const Node &other) const
 Equivalence check for two AST nodes. More...
 
void setSrcLoc (SrcLocation l)
 Set source location for the Node. More...
 
virtual ~Node ()=default
 

Protected Member Functions

bool equal (const Node &node) const override
 Abstract equality check for two AST nodes. More...
 
void print (std::ostream &out) const override
 Output to a given output stream. More...
 

Private Attributes

std::map< int, Own< ExecutionOrder > > plans
 Mapping versions of clauses to execution orders. More...
 

Detailed Description

Definition at line 51 of file ExecutionPlan.h.

Member Function Documentation

◆ apply()

void souffle::ast::ExecutionPlan::apply ( const NodeMapper )
inlineoverridevirtual

Apply the mapper to all child nodes.

Reimplemented from souffle::ast::Node.

Definition at line 76 of file ExecutionPlan.h.

76  {
77  std::vector<const Node*> childNodes;
78  for (auto& plan : plans) {
79  childNodes.push_back(plan.second.get());
80  }

References plans.

◆ clone()

ExecutionPlan* souffle::ast::ExecutionPlan::clone ( ) const
inlineoverridevirtual

Create a clone (i.e.

deep copy) of this node

Implements souffle::ast::Node.

Definition at line 67 of file ExecutionPlan.h.

70  {
71  for (auto& plan : plans) {
72  plan.second = map(std::move(plan.second));
73  }
74  }

◆ equal()

bool souffle::ast::ExecutionPlan::equal ( const Node ) const
inlineoverrideprotectedvirtual

Abstract equality check for two AST nodes.

Reimplemented from souffle::ast::Node.

Definition at line 99 of file ExecutionPlan.h.

◆ getChildNodes()

std::vector<const Node*> souffle::ast::ExecutionPlan::getChildNodes ( ) const
inlineoverridevirtual

Obtain a list of all embedded AST child nodes.

Reimplemented from souffle::ast::Node.

Definition at line 82 of file ExecutionPlan.h.

84  :
85  void print(std::ostream& out) const override {
86  if (!plans.empty()) {
87  out << " .plan ";
88  out << join(plans, ", ",

◆ getOrders()

std::map<int, const ExecutionOrder*> souffle::ast::ExecutionPlan::getOrders ( ) const
inline

Get orders.

Definition at line 59 of file ExecutionPlan.h.

61  {
62  auto res = new ExecutionPlan();
63  res->setSrcLoc(getSrcLoc());
64  for (auto& plan : plans) {
65  res->setOrderFor(plan.first, Own<ExecutionOrder>(plan.second->clone()));

◆ print()

void souffle::ast::ExecutionPlan::print ( std::ostream &  os) const
inlineoverrideprotectedvirtual

Output to a given output stream.

Implements souffle::ast::Node.

Definition at line 91 of file ExecutionPlan.h.

93  {
94  const auto& other = static_cast<const ExecutionPlan&>(node);
95  return equal_targets(plans, other.plans);
96  }
97 

◆ setOrderFor()

void souffle::ast::ExecutionPlan::setOrderFor ( int  version,
Own< ExecutionOrder plan 
)
inline

Set execution order for a given rule version.

Definition at line 54 of file ExecutionPlan.h.

55  : plans) {
56  result.insert(std::make_pair(plan.first, plan.second.get()));

Field Documentation

◆ plans

std::map<int, Own<ExecutionOrder> > souffle::ast::ExecutionPlan::plans
private

Mapping versions of clauses to execution orders.

Definition at line 106 of file ExecutionPlan.h.

Referenced by apply().


The documentation for this class was generated from the following file:
souffle::ast::ExecutionPlan::plans
std::map< int, Own< ExecutionOrder > > plans
Mapping versions of clauses to execution orders.
Definition: ExecutionPlan.h:106
souffle::map
auto map(const std::vector< A > &xs, F &&f)
Applies a function to each element of a vector and returns the results.
Definition: ContainerUtil.h:158
souffle::ast::ExecutionPlan::print
void print(std::ostream &out) const override
Output to a given output stream.
Definition: ExecutionPlan.h:91
souffle::join
detail::joined_sequence< Iter, Printer > join(const Iter &a, const Iter &b, const std::string &sep, const Printer &p)
Creates an object to be forwarded to some output stream for printing sequences of elements interspers...
Definition: StreamUtil.h:175
souffle::equal_targets
bool equal_targets(const Container &a, const Container &b, const Comparator &comp)
A function testing whether two containers are equal with the given Comparator.
Definition: ContainerUtil.h:433
souffle::ast::Node::getSrcLoc
const SrcLocation & getSrcLoc() const
Return source location of the Node.
Definition: Node.h:46