Calculator Step 4

- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Private Member Functions | Private Attributes | List of all members
node_number Class Reference

`#include <node_impl.hpp>`

Inheritance diagram for node_number:

## Public Member Functions
| node_number (double value)
double | value () const
Public Member Functions inherited from node_impl
| node_impl ()
| node_impl (node_impl &&)=default
node_impl & | operator= (node_impl &&)=default
virtual | ~node_impl ()
void | print (std::ostream &stream, int indent) const
double | evaluate () const
std::string | to_string () const
identifier_list const & | get_parameters () const

## Private Member Functions
virtual void | print_node (std::ostream &stream, int indent) const override
virtual double | evaluate_node () const override

## Private Attributes
double | value_

## Detailed Description

Number data type. Used for numeric literals.

Definition at line 57 of file node_impl.hpp.

## Constructor & Destructor Documentation

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

Definition at line 81 of file node_impl.cpp.

82 : node_impl{}, value_{value}
83 {}
node_number::value_
double value_
Definition: node_impl.hpp:65
node_impl
Definition: node_impl.hpp:17
node_number::value
double value() const
Definition: node_impl.cpp:85

## Member Function Documentation

double node_number::evaluate_node | ( |  | ) | const
| override private virtual

Implements node_impl.

Definition at line 97 of file node_impl.cpp.

References value().

99 {
100 return value();
101 }
node_number::value
double value() const
Definition: node_impl.cpp:85

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

Implements node_impl.

Definition at line 91 of file node_impl.cpp.

References value().

93 {
94 stream << std::setw(indent) << "" << value() << '\n';
95 }
node_number::value
double value() const
Definition: node_impl.cpp:85

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

Definition at line 85 of file node_impl.cpp.

References value_.

Referenced by evaluate_node(), and print_node().

87 {
88 return value_;
89 }
node_number::value_
double value_
Definition: node_impl.hpp:65

## Member Data Documentation

double node_number::value_
| private

Definition at line 65 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