souffle  2.0.2-371-g6315b36
AutoIncrement.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 AutoIncrement.h
12  *
13  * Defines a class for evaluating values in the Relational Algebra Machine
14  *
15  ************************************************************************/
16 
17 #pragma once
18 
19 #include "ram/Expression.h"
20 #include <ostream>
21 
22 namespace souffle::ram {
23 
24 /**
25  * @class AutoIncrement
26  * @brief Increment a counter and return its value.
27  *
28  * Note that there exists a single counter only.
29  */
30 class AutoIncrement : public Expression {
31 public:
32  AutoIncrement* clone() const override {
33  return new AutoIncrement();
34  }
35 
36 protected:
37  void print(std::ostream& os) const override {
38  os << "autoinc()";
39  }
40 };
41 
42 } // namespace souffle::ram
souffle::ram
Definition: AstToRamTranslator.h:54
souffle::ram::AutoIncrement::print
void print(std::ostream &os) const override
Print RAM node.
Definition: AutoIncrement.h:43
souffle::ram::AutoIncrement::clone
AutoIncrement * clone() const override
Create a clone (i.e.
Definition: AutoIncrement.h:38
Expression.h