souffle  2.0.2-371-g6315b36
Constant.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 Constant.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 "ram/Node.h"
21 #include "souffle/RamTypes.h"
22 
23 namespace souffle::ram {
24 
25 /**
26  * @class Constant
27  * @brief Represents a Ram Constant
28  *
29  */
30 class Constant : public Expression {
31 public:
32  /** @brief Get constant */
33  RamDomain getConstant() const {
34  return constant;
35  }
36 
37 protected:
39 
40  bool equal(const Node& node) const override {
41  const auto& other = static_cast<const Constant&>(node);
42  return constant == other.constant;
43  }
44 
45  /** Constant value */
47 };
48 
49 } // namespace souffle::ram
souffle::RamDomain
int32_t RamDomain
Definition: RamTypes.h:56
souffle::ram::Constant::Constant
Constant(RamDomain constant)
Definition: Constant.h:44
souffle::ram
Definition: AstToRamTranslator.h:54
souffle::ram::Node
Node is a superclass for all RAM IR classes.
Definition: Node.h:42
souffle::ram::Constant::constant
const RamDomain constant
Constant value.
Definition: Constant.h:52
souffle::ram::Constant
Represents a Ram Constant.
Definition: Constant.h:36
souffle::ram::Constant::getConstant
RamDomain getConstant() const
Get constant.
Definition: Constant.h:39
Node.h
RamTypes.h
Expression.h
souffle::ram::Constant::equal
bool equal(const Node &node) const override
Equality check for two RAM nodes.
Definition: Constant.h:46