souffle  2.0.2-371-g6315b36
Operation.h
Go to the documentation of this file.
1 /*
2  * Souffle - A Datalog Compiler
3  * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved
4  * Licensed under the Universal Permissive License v 1.0 as shown at:
5  * - https://opensource.org/licenses/UPL
6  * - <souffle root>/licenses/SOUFFLE-UPL.txt
7  */
8 
9 /************************************************************************
10  *
11  * @file Operation.h
12  *
13  * Defines the Operation of a relational algebra query.
14  *
15  ***********************************************************************/
16 
17 #pragma once
18 
19 #include "ram/Node.h"
20 #include <iosfwd>
21 
22 namespace souffle::ram {
23 
24 /**
25  * @class Operation
26  * @brief Abstract class for a relational algebra operation
27  */
28 class Operation : public Node {
29 public:
30  Operation* clone() const override = 0;
31 
32 protected:
33  void print(std::ostream& os) const override {
34  print(os, 0);
35  }
36  /** @brief Pretty print with indentation */
37  virtual void print(std::ostream& os, int tabpos) const = 0;
38 
39  /** @brief Pretty print jump-bed */
40  static void print(const Operation* operation, std::ostream& os, int tabpos) {
41  operation->print(os, tabpos);
42  }
43 
44  friend class Query;
45 };
46 
47 } // namespace souffle::ram
souffle::ram::Query
A relational algebra query.
Definition: Query.h:50
souffle::ram
Definition: AstToRamTranslator.h:54
souffle::ram::Operation::clone
Operation * clone() const override=0
Create a clone (i.e.
souffle::ram::Operation
Abstract class for a relational algebra operation.
Definition: Operation.h:34
Node.h
souffle::ram::Operation::print
void print(std::ostream &os) const override
Print RAM node.
Definition: Operation.h:39