Calculator
Step 6
|
#include <node_impl.hpp>
Public Member Functions | |
node_binary (node left, node right) | |
node | left () const |
node | right () 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 |
Protected Member Functions | |
node_binary (std::istream &stream) | |
number | evaluate_left () const |
number | evaluate_right () const |
Private Member Functions | |
virtual void | print_node (std::ostream &stream, int indent) const override=0 |
virtual number | evaluate_node () const override=0 |
virtual void | save_node (std::ostream &stream) const override=0 |
Private Attributes | |
node | left_ |
node | right_ |
Additional Inherited Members | |
Static Public Member Functions inherited from node_impl | |
static std::shared_ptr< node_impl > | read_node (std::istream &stream) |
Abstract base class for binary operators.
Definition at line 150 of file node_impl.hpp.
Definition at line 371 of file node_impl.cpp.
|
protected |
Definition at line 375 of file node_impl.cpp.
|
protected |
Definition at line 391 of file node_impl.cpp.
References node::evaluate(), and left().
Referenced by node_add::evaluate_node(), node_subtract::evaluate_node(), node_multiply::evaluate_node(), and node_divide::evaluate_node().
|
overrideprivatepure virtual |
Implements node_impl.
Implemented in node_divide, node_multiply, node_subtract, and node_add.
|
protected |
Definition at line 397 of file node_impl.cpp.
References node::evaluate(), and right().
Referenced by node_add::evaluate_node(), node_subtract::evaluate_node(), node_multiply::evaluate_node(), and node_divide::evaluate_node().
node node_binary::left | ( | ) | const |
Definition at line 379 of file node_impl.cpp.
References left_.
Referenced by evaluate_left(), node_add::node_add(), node_divide::node_divide(), node_multiply::node_multiply(), node_subtract::node_subtract(), node_add::print_node(), node_subtract::print_node(), node_multiply::print_node(), node_divide::print_node(), node_add::save_node(), node_subtract::save_node(), node_multiply::save_node(), and node_divide::save_node().
|
overrideprivatepure virtual |
Implements node_impl.
Implemented in node_divide, node_multiply, node_subtract, and node_add.
node node_binary::right | ( | ) | const |
Definition at line 385 of file node_impl.cpp.
References right_.
Referenced by evaluate_right(), node_add::print_node(), node_subtract::print_node(), node_multiply::print_node(), node_divide::print_node(), node_add::save_node(), node_subtract::save_node(), node_multiply::save_node(), and node_divide::save_node().
|
overrideprivatepure virtual |
Implements node_impl.
Implemented in node_divide, node_multiply, node_subtract, and node_add.
|
private |
Definition at line 164 of file node_impl.hpp.
Referenced by left().
|
private |
Definition at line 165 of file node_impl.hpp.
Referenced by right().