- Main Page
- Classes
- Files

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

# node_assign Class Reference

`#include <node_impl.hpp>`

Inheritance diagram for node_assign:

List of all members.

## Public Member Functions
| node_assign (node identifier, node value)
node | identifier () const
node | value () const
## Private Member Functions
std::string | get_identifier () const
double | evaluate_value () const
virtual void | print_node (std::ostream &stream, int indent) const
virtual double | evaluate_node () const
## Private Attributes
node | identifier_
node | value_

## Detailed Description

Assignment Keep track of an identifier and a value.

Definition at line 88 of file node_impl.hpp.

## Constructor & Destructor Documentation

node_assign::node_assign | ( | node | identifier,
|  | node | value |
| ) |  |  |

Definition at line 130 of file node_impl.cpp.

    00131 : node_impl(), identifier_(identifier), value_(value)
    00132 {}

## Member Function Documentation

node node_assign::identifier | ( |  | ) | const

Definition at line 134 of file node_impl.cpp.

References identifier_.

Referenced by get_identifier().

    00136 {
    00137   return identifier_;
    00138 }

node node_assign::value | ( |  | ) | const

Definition at line 140 of file node_impl.cpp.

References value_.

Referenced by evaluate_value(), and print_node().

    00142 {
    00143   return value_;
    00144 }

std::string node_assign::get_identifier | ( |  | ) | const`[private]`

Definition at line 146 of file node_impl.cpp.

References identifier(), and node::to_string().

Referenced by evaluate_node(), and print_node().

    00148 {
    00149   return identifier().to_string();
    00150 }

double node_assign::evaluate_value | ( |  | ) | const`[private]`

Definition at line 152 of file node_impl.cpp.

References node::evaluate(), and value().

Referenced by evaluate_node().

    00154 {
    00155   return value().evaluate();
    00156 }

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

Implements node_impl.

Definition at line 158 of file node_impl.cpp.

References get_identifier(), node::print(), and value().

    00160 {
    00161   stream << std::setw(indent) << "" << get_identifier() << ":=\n";
    00162   value().print(stream, indent + 2);
    00163 }

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

Implements node_impl.

Definition at line 165 of file node_impl.cpp.

References evaluate_value(), get_identifier(), and set_variable().

    00167 {
    00168   double result( evaluate_value() );
    00169   set_variable(get_identifier(), result);
    00170   return result;
    00171 }

## Member Data Documentation

node node_assign::identifier_`[private]`

Definition at line 100 of file node_impl.hpp.

Referenced by identifier().

node node_assign::value_`[private]`

Definition at line 101 of file node_impl.hpp.

Referenced by value().

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

- node_impl.hpp
- node_impl.cpp