#include <node_impl.hpp>
Public Member Functions | |
node_impl () | |
virtual | ~node_impl () |
void | print (std::ostream &stream, int indent) const |
double | evaluate () const |
std::string | to_string () const |
void | add_ref () |
void | del_ref () |
Private Member Functions | |
node_impl (node_impl const &n) | |
not implemented | |
node_impl & | operator= (node_impl const &n) |
not implemented | |
virtual void | print_node (std::ostream &stream, int indent) const =0 |
virtual double | evaluate_node () const =0 |
virtual std::string | evaluate_string () const |
Private Attributes | |
std::size_t | refcount_ |
This class primarily manages the reference count.
Definition at line 19 of file node_impl.hpp.
node_impl::node_impl | ( | ) |
node_impl::~node_impl | ( | ) | [virtual] |
node_impl::node_impl | ( | node_impl const & | n | ) | [private] |
not implemented
void node_impl::print | ( | std::ostream & | stream, | |
int | indent | |||
) | const |
Definition at line 16 of file node_impl.cpp.
References print_node().
Referenced by node::print().
00018 { 00019 print_node(stream, indent); 00020 }
double node_impl::evaluate | ( | ) | const |
Definition at line 22 of file node_impl.cpp.
References evaluate_node().
Referenced by node::evaluate(), and evaluate_string().
00024 { 00025 return evaluate_node(); 00026 }
std::string node_impl::to_string | ( | ) | const |
Definition at line 28 of file node_impl.cpp.
References evaluate_string().
Referenced by node::to_string().
00030 { 00031 return evaluate_string(); 00032 }
void node_impl::add_ref | ( | ) |
Definition at line 34 of file node_impl.cpp.
References refcount_.
Referenced by node::node(), and node::operator=().
00035 { 00036 ++refcount_; 00037 }
void node_impl::del_ref | ( | ) |
Definition at line 39 of file node_impl.cpp.
References refcount_.
Referenced by node::operator=(), and node::~node().
virtual void node_impl::print_node | ( | std::ostream & | stream, | |
int | indent | |||
) | const [private, pure virtual] |
Implemented in node_void, node_number, node_identifier, node_assign, node_unary, node_binary, node_negate, node_add, node_subtract, node_multiply, and node_divide.
Referenced by print().
virtual double node_impl::evaluate_node | ( | ) | const [private, pure virtual] |
Implemented in node_void, node_number, node_identifier, node_assign, node_unary, node_binary, node_negate, node_add, node_subtract, node_multiply, and node_divide.
Referenced by evaluate().
std::string node_impl::evaluate_string | ( | ) | const [private, virtual] |
Reimplemented in node_void, and node_identifier.
Definition at line 46 of file node_impl.cpp.
References evaluate().
Referenced by to_string().
00048 { 00049 std::ostringstream stream; 00050 stream << evaluate(); 00051 return stream.str(); 00052 }
std::size_t node_impl::refcount_ [private] |