node_divide Class Reference

#include <node_impl.hpp>

Inheritance diagram for node_divide:

node_binary node_impl

List of all members.

Public Member Functions

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

Division.

Definition at line 214 of file node_impl.hpp.


Constructor & Destructor Documentation

node_divide::node_divide ( node  left,
node  right 
)

Definition at line 535 of file node_impl.cpp.

00536 : node_binary(left, right)
00537 {}

node_divide::node_divide ( std::istream &  stream  ) 

Definition at line 539 of file node_impl.cpp.

00540 : node_binary(stream)
00541 {}


Member Function Documentation

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

Implements node_binary.

Definition at line 543 of file node_impl.cpp.

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

00545 {
00546   stream << std::setw(indent) << "" << "/\n";
00547   left().print(stream, indent + 2);
00548   right().print(stream, indent + 2);
00549 }

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

Implements node_binary.

Definition at line 551 of file node_impl.cpp.

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

00553 {
00554   return evaluate_left() / evaluate_right();
00555 }

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

Implements node_binary.

Definition at line 557 of file node_impl.cpp.

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

00559 {
00560   stream << "divide ";
00561   left().save(stream);
00562   right().save(stream);
00563 }


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