- Main Page
- Classes
- Files

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# node_number Class Reference

`#include <node_impl.hpp>`

Inheritance diagram for node_number:

List of all members.

## Public Member Functions
| node_number (double value)
| node_number (std::istream &stream)
double | value () const
## Private Member Functions
virtual void | print_node (std::ostream &stream, int indent) const
virtual double | evaluate_node () const
virtual void | save_node (std::ostream &stream) const
## Private Attributes
double | value_

## Detailed Description

Number data type. Used for numeric literals.

Definition at line 69 of file node_impl.hpp.

## Constructor & Destructor Documentation

node_number::node_number | ( | double | value | ) |

Definition at line 137 of file node_impl.cpp.

    00138 : node_impl(), value_(value)
    00139 {}

node_number::node_number | ( | std::istream & | stream | ) |

Definition at line 141 of file node_impl.cpp.

References value_.

    00142 : node_impl()
    00143 {
    00144   if (not (stream >> value_))
    00145     throw calc_error("malformed library file, cannot read number");
    00146 }

## Member Function Documentation

double node_number::value | ( |  | ) | const

Definition at line 148 of file node_impl.cpp.

References value_.

Referenced by evaluate_node(), print_node(), and save_node().

    00150 {
    00151   return value_;
    00152 }

void node_number::print_node | ( | std::ostream & | stream,
|  | int | indent |
| ) |  |  | const`[private, virtual]`

Implements node_impl.

Definition at line 154 of file node_impl.cpp.

References value().

    00156 {
    00157   stream << std::setw(indent) << "" << value() << '\n';
    00158 }

double node_number::evaluate_node | ( |  | ) | const`[private, virtual]`

Implements node_impl.

Definition at line 160 of file node_impl.cpp.

References value().

    00162 {
    00163   return value();
    00164 }

void node_number::save_node | ( | std::ostream & | stream | ) | const`[private, virtual]`

Implements node_impl.

Definition at line 166 of file node_impl.cpp.

References value().

    00168 {
    00169   stream << "number " << value() << '\n';
    00170 }

## Member Data Documentation

double node_number::value_`[private]`

Definition at line 79 of file node_impl.hpp.

Referenced by node_number(), and value().

The documentation for this class was generated from the following files:

- node_impl.hpp
- node_impl.cpp