node_subtract Class Reference

#include <node_impl.hpp>

Inheritance diagram for node_subtract:

node_binary node_impl

List of all members.

Public Member Functions

 node_subtract (node left, node right)
 node_subtract (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

Subtraction.

Definition at line 192 of file node_impl.hpp.


Constructor & Destructor Documentation

node_subtract::node_subtract ( node  left,
node  right 
)

Definition at line 473 of file node_impl.cpp.

00474 : node_binary(left, right)
00475 {}

node_subtract::node_subtract ( std::istream &  stream  ) 

Definition at line 477 of file node_impl.cpp.

00478 : node_binary(stream)
00479 {}


Member Function Documentation

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

Implements node_binary.

Definition at line 481 of file node_impl.cpp.

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

00483 {
00484   stream << std::setw(indent) << "" << "-\n";
00485   left().print(stream, indent + 2);
00486   right().print(stream, indent + 2);
00487 }

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

Implements node_binary.

Definition at line 489 of file node_impl.cpp.

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

00491 {
00492   return evaluate_left() - evaluate_right();
00493 }

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

Implements node_binary.

Definition at line 495 of file node_impl.cpp.

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

00497 {
00498   stream << "subtract ";
00499   left().save(stream);
00500   right().save(stream);
00501 }


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