Calculator  Step 3
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:
node_impl

Public Member Functions

 node_number (double value)
 
double value () const
 
- Public Member Functions inherited from node_impl
 node_impl ()
 
virtual ~node_impl ()
 
void print (std::ostream &stream, int indent) const
 
double evaluate () const
 
std::string to_string () const
 

Private Member Functions

void print_node (std::ostream &stream, int indent) const override
 
double evaluate_node () const override
 

Private Attributes

double value_
 

Detailed Description

Number data type. Used for numeric literals.

Definition at line 52 of file node_impl.hpp.

Constructor & Destructor Documentation

node_number::node_number ( double  value)

Definition at line 65 of file node_impl.cpp.

67 {}
double value_
Definition: node_impl.hpp:60
double value() const
Definition: node_impl.cpp:69

Member Function Documentation

double node_number::evaluate_node ( ) const
overrideprivatevirtual

Implements node_impl.

Definition at line 81 of file node_impl.cpp.

References value().

83 {
84  return value();
85 }
double value() const
Definition: node_impl.cpp:69
void node_number::print_node ( std::ostream &  stream,
int  indent 
) const
overrideprivatevirtual

Implements node_impl.

Definition at line 75 of file node_impl.cpp.

References value().

77 {
78  stream << std::setw(indent) << "" << value() << '\n';
79 }
double value() const
Definition: node_impl.cpp:69
double node_number::value ( ) const

Definition at line 69 of file node_impl.cpp.

References value_.

Referenced by evaluate_node(), and print_node().

71 {
72  return value_;
73 }
double value_
Definition: node_impl.hpp:60

Member Data Documentation

double node_number::value_
private

Definition at line 60 of file node_impl.hpp.

Referenced by value().


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