Calculator Step 6

- 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 (number value)
| node_number (std::istream &stream)
number | value () const
Public Member Functions inherited from node_impl
| node_impl ()
virtual | ~node_impl ()
| node_impl (node_impl &&)=default
node_impl & | operator= (node_impl &&)=default
void | print (std::ostream &stream, int indent) const
number | evaluate () const
std::string | to_string () const
identifier_list const & | get_parameters () const
void | save (std::ostream &stream) const

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

## Private Attributes
number | value_

## Additional Inherited Members
Static Public Member Functions inherited from node_impl
static std::shared_ptr< node_impl > | read_node (std::istream &stream)

## Detailed Description

Number data type. Used for numeric literals.

Definition at line 68 of file node_impl.hpp.

## Constructor & Destructor Documentation

node_number::node_number | ( | number | value | ) |

Definition at line 125 of file node_impl.cpp.

126 : node_impl{}, value_{value}
127 {}
node_impl
Definition: node_impl.hpp:20
node_number::value_
number value_
Definition: node_impl.hpp:78

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

Definition at line 129 of file node_impl.cpp.

130 : node_impl{}, value_{stream}
131 {}
node_impl
Definition: node_impl.hpp:20
node_number::value_
number value_
Definition: node_impl.hpp:78

## Member Function Documentation

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

Implements node_impl.

Definition at line 145 of file node_impl.cpp.

References value().

147 {
148 return value();
149 }
node_number::value
number value() const
Definition: node_impl.cpp:133

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

Implements node_impl.

Definition at line 139 of file node_impl.cpp.

References value().

141 {
142 stream << std::setw(indent) << "" << value() << '\n';
143 }
node_number::value
number value() const
Definition: node_impl.cpp:133

void node_number::save_node | ( | std::ostream & | stream | ) | const
| override private virtual

Implements node_impl.

Definition at line 151 of file node_impl.cpp.

References number::save(), and value().

153 {
154 stream << "number ";
155 value().save(stream);
156 stream << '\n';
157 }
node_number::value
number value() const
Definition: node_impl.cpp:133
number::save
void save(std::ostream &stream) const
Definition: number.cpp:39

number node_number::value | ( |  | ) | const

Definition at line 133 of file node_impl.cpp.

References value_.

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

135 {
136 return value_;
137 }
node_number::value_
number value_
Definition: node_impl.hpp:78

## Member Data Documentation

number node_number::value_
| private

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