node_add Class Reference

#include <node_impl.hpp>

Inheritance diagram for node_add:

node_binary node_impl

List of all members.

Public Member Functions

 node_add (node left, node right)
 node_add (std::istream &stream)

Private Member Functions

virtual void print_node (std::ostream &stream, int indent) const
virtual number evaluate_node () const
virtual void save_node (std::ostream &stream) const


Detailed Description

Addition.

Definition at line 181 of file node_impl.hpp.


Constructor & Destructor Documentation

node_add::node_add ( node  left,
node  right 
)

Definition at line 442 of file node_impl.cpp.

00443 : node_binary(left, right)
00444 {}

node_add::node_add ( std::istream &  stream  ) 

Definition at line 446 of file node_impl.cpp.

00447 : node_binary(stream)
00448 {}


Member Function Documentation

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

Implements node_binary.

Definition at line 450 of file node_impl.cpp.

References node_binary::left(), node::print(), and node_binary::right().

00452 {
00453   stream << std::setw(indent) << "" << "+\n";
00454   left().print(stream, indent + 2);
00455   right().print(stream, indent + 2);
00456 }

number node_add::evaluate_node (  )  const [private, virtual]

Implements node_binary.

Definition at line 458 of file node_impl.cpp.

References node_binary::evaluate_left(), and node_binary::evaluate_right().

00460 {
00461   return evaluate_left() + evaluate_right();
00462 }

void node_add::save_node ( std::ostream &  stream  )  const [private, virtual]

Implements node_binary.

Definition at line 464 of file node_impl.cpp.

References node_binary::left(), node_binary::right(), and node::save().

00466 {
00467   stream << "add ";
00468   left().save(stream);
00469   right().save(stream);
00470 }


The documentation for this class was generated from the following files:
Generated on Sun Nov 30 10:06:53 2008 for Calculator by  doxygen 1.5.3