#include <node_impl.hpp>
Public Member Functions | |
node_identifier (std::string const &name) | |
node_identifier (std::istream &stream) | |
std::string const & | name () const |
Private Member Functions | |
virtual void | print_node (std::ostream &stream, int indent) const |
virtual number | evaluate_node () const |
virtual std::string | evaluate_string () const |
virtual void | save_node (std::ostream &stream) const |
Private Attributes | |
std::string | name_ |
Definition at line 85 of file node_impl.hpp.
node_identifier::node_identifier | ( | std::string const & | name | ) |
node_identifier::node_identifier | ( | std::istream & | stream | ) |
Definition at line 176 of file node_impl.cpp.
References name_.
00177 : node_impl() 00178 { 00179 if (not (stream >> name_)) 00180 throw calc_error("malformed library file, cannot read identifier"); 00181 }
std::string const & node_identifier::name | ( | ) | const |
Definition at line 183 of file node_impl.cpp.
References name_.
Referenced by evaluate_node(), evaluate_string(), print_node(), and save_node().
00185 { 00186 return name_; 00187 }
void node_identifier::print_node | ( | std::ostream & | stream, | |
int | indent | |||
) | const [private, virtual] |
Implements node_impl.
Definition at line 189 of file node_impl.cpp.
References name().
00191 { 00192 stream << std::setw(indent) << "" << "identifier " << name() << '\n'; 00193 }
number node_identifier::evaluate_node | ( | ) | const [private, virtual] |
Implements node_impl.
Definition at line 195 of file node_impl.cpp.
References node::evaluate(), get_variable(), and name().
00197 { 00198 return get_variable(name()).evaluate(); 00199 }
std::string node_identifier::evaluate_string | ( | ) | const [private, virtual] |
Reimplemented from node_impl.
Definition at line 201 of file node_impl.cpp.
References name().
00203 { 00204 return name(); 00205 }
void node_identifier::save_node | ( | std::ostream & | stream | ) | const [private, virtual] |
Implements node_impl.
Definition at line 207 of file node_impl.cpp.
References name().
00209 { 00210 stream << "identifier " << name() << '\n'; 00211 }
std::string node_identifier::name_ [private] |