node_function Class Reference

#include <node_impl.hpp>

Inheritance diagram for node_function:

node_impl

List of all members.

Public Member Functions

 node_function (identifier_list const &parameters, node definition)
identifier_list const & parameters () const
node definition () const

Private Member Functions

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

Private Attributes

identifier_list parameters_
node definition_


Detailed Description

Function definition. A function has parameters and a definition.

Definition at line 91 of file node_impl.hpp.


Constructor & Destructor Documentation

node_function::node_function ( identifier_list const &  parameters,
node  definition 
)

Definition at line 144 of file node_impl.cpp.

00145 : node_impl(), parameters_(parameters), definition_(definition)
00146 {}


Member Function Documentation

identifier_list const & node_function::parameters (  )  const

Definition at line 148 of file node_impl.cpp.

References parameters_.

Referenced by evaluate_parameters(), and print_node().

00150 {
00151   return parameters_;
00152 }

node node_function::definition (  )  const

Definition at line 154 of file node_impl.cpp.

References definition_.

Referenced by evaluate_node(), and print_node().

00156 {
00157   return definition_;
00158 }

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

Implements node_impl.

Definition at line 171 of file node_impl.cpp.

References definition(), parameters(), node::print(), and print_identifier_list().

00173 {
00174   stream << std::setw(indent) << "" << "fun\n";
00175   print_identifier_list(stream, parameters());
00176   stream << '=';
00177   definition().print(stream, indent + 2);
00178 }

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

Implements node_impl.

Definition at line 180 of file node_impl.cpp.

References definition(), and node::evaluate().

00182 {
00183   return definition().evaluate();
00184 }

identifier_list const & node_function::evaluate_parameters (  )  const [private, virtual]

Reimplemented from node_impl.

Definition at line 186 of file node_impl.cpp.

References parameters().

00188 {
00189   return parameters();
00190 }


Member Data Documentation

identifier_list node_function::parameters_ [private]

Definition at line 101 of file node_impl.hpp.

Referenced by parameters().

node node_function::definition_ [private]

Definition at line 102 of file node_impl.hpp.

Referenced by definition().


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