node_negate Class Reference

#include <node_impl.hpp>

Inheritance diagram for node_negate:

node_unary node_impl

List of all members.

Public Member Functions

 node_negate (node operand)
 node_negate (std::istream &stream)

Private Member Functions

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


Detailed Description

Unary negation.

Definition at line 170 of file node_impl.hpp.


Constructor & Destructor Documentation

node_negate::node_negate ( node  operand  ) 

Definition at line 413 of file node_impl.cpp.

00414 : node_unary(operand)
00415 {}

node_negate::node_negate ( std::istream &  stream  ) 

Definition at line 417 of file node_impl.cpp.

00418 : node_unary(stream)
00419 {}


Member Function Documentation

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

Implements node_unary.

Definition at line 421 of file node_impl.cpp.

References node_unary::operand(), and node::print().

00423 {
00424   stream << std::setw(indent) << "" << "-\n";
00425   operand().print(stream, indent + 2);
00426 }

double node_negate::evaluate_node (  )  const [private, virtual]

Implements node_unary.

Definition at line 428 of file node_impl.cpp.

References node_unary::evaluate_operand().

00430 {
00431   return -evaluate_operand();
00432 }

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

Implements node_unary.

Definition at line 434 of file node_impl.cpp.

References node_unary::operand(), and node::save().

00436 {
00437   stream << "negate ";
00438   operand().save(stream);
00439 }


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