SHash.cpp 1.39 KB
Newer Older
gsell's avatar
gsell committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
// ------------------------------------------------------------------------
// $RCSfile: SHash.cpp,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: SHash
//   Representation of a "#" value in a ATable array expression.
//
// ------------------------------------------------------------------------
//
// $Date: 2000/03/27 09:33:42 $
// $Author: Andreas Adelmann $
//
// ------------------------------------------------------------------------

#include "Expressions/SHash.h"
#include "Expressions/ATable.h"
#include "Expressions/SConstant.h"
#include <iostream>


// Class SHash
// ------------------------------------------------------------------------

namespace Expressions {

    SHash::SHash(const SHash &rhs):
31
        Scalar<double>(rhs),
gsell's avatar
gsell committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
        itsTable(rhs.itsTable)
    {}


    SHash::SHash(const ATable &table):
        itsTable(table)
    {}


    SHash::~SHash()
    {}


    Scalar<double> *SHash::clone() const {
        return new SConstant<double>(itsTable.getHash());
    }


    double SHash::evaluate() const {
        return itsTable.getHash();
    }


    void SHash::print(std::ostream &os, int precedence) const {
        os << '#';
    }

}