OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
SHash.cpp
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2// $RCSfile: SHash.cpp,v $
3// ------------------------------------------------------------------------
4// $Revision: 1.1.1.1 $
5// ------------------------------------------------------------------------
6// Copyright: see Copyright.readme
7// ------------------------------------------------------------------------
8//
9// Class: SHash
10// Representation of a "#" value in a ATable array expression.
11//
12// ------------------------------------------------------------------------
13//
14// $Date: 2000/03/27 09:33:42 $
15// $Author: Andreas Adelmann $
16//
17// ------------------------------------------------------------------------
18
19#include "Expressions/SHash.h"
20#include "Expressions/ATable.h"
22#include <iostream>
23
24
25// Class SHash
26// ------------------------------------------------------------------------
27
28namespace Expressions {
29
30 SHash::SHash(const SHash &rhs):
31 Scalar<double>(rhs),
32 itsTable(rhs.itsTable)
33 {}
34
35
36 SHash::SHash(const ATable &table):
37 itsTable(table)
38 {}
39
40
42 {}
43
44
47 }
48
49
50 double SHash::evaluate() const {
51 return itsTable.getHash();
52 }
53
54
55 void SHash::print(std::ostream &os, int /*precedence*/) const {
56 os << '#';
57 }
58
59}
Representation objects and parsers for attribute expressions.
Definition: Expressions.h:64
A scalar expression.
Definition: Expressions.h:71
An array expression generated from a TABLE() function.
Definition: ATable.h:38
double getHash() const
Return the current value of '#'.
Definition: ATable.cpp:65
A scalar constant expression.
Definition: SConstant.h:35
A scalar expression.
Definition: SHash.h:37
const ATable & itsTable
Definition: SHash.h:66
virtual void print(std::ostream &str, int precedence=99) const
Print expression.
Definition: SHash.cpp:55
virtual Scalar< double > * clone() const
Make clone.
Definition: SHash.cpp:45
virtual double evaluate() const
Evaluate.
Definition: SHash.cpp:50
virtual ~SHash()
Definition: SHash.cpp:41