proj home

Files   Classes   Functions   Hierarchy  

rpnstringconvert Class Reference

#include <rpnfunc.h>

Inheritance diagram for rpnstringconvert:
Collaboration diagram for rpnstringconvert:

List of all members.

Public Member Functions

 rpnstringconvert ()
 rpnstringconvert (deque< rpnbase * > &ds, bool const evaluate=true)
 ~rpnstringconvert ()
rpnbasecopy () const
void visit (deque< rpnbase * > &ds, rpninteger &n)
void visit (deque< rpnbase * > &ds, rpnreal &n)
string const name () const
void eval (deque< rpnbase * > &ds)


Detailed Description

Definition at line 1337 of file rpnfunc.h.


Constructor & Destructor Documentation

rpnstringconvert::rpnstringconvert (  )  [inline]

Definition at line 1341 of file rpnfunc.h.

Referenced by copy().

01341 {}

rpnstringconvert::rpnstringconvert ( deque< rpnbase * > &  ds,
bool const   evaluate = true 
)

Definition at line 4124 of file rpnfunc.cpp.

References eval().

04125 {
04126   if (evaluate)
04127     eval(ds);
04128   else
04129     ds.push_front(this);
04130 }

rpnstringconvert::~rpnstringconvert (  )  [inline]

Definition at line 1343 of file rpnfunc.h.

01343 {}


Member Function Documentation

rpnbase * rpnstringconvert::copy (  )  const [virtual]

Reimplemented from rpnfunction.

Definition at line 4132 of file rpnfunc.cpp.

References rpnstringconvert().

04133 {
04134   return new rpnstringconvert();
04135 }

void rpnstringconvert::eval ( deque< rpnbase * > &  ds  )  [virtual]

Reimplemented from rpnfunction.

Definition at line 4137 of file rpnfunc.cpp.

References rpnbase::accept(), and rpnbase::dec().

Referenced by rpnstringconvert().

04138 {
04139   if(!ds.empty())
04140     ds[0]->accept(ds,*this);
04141 
04142   dec();
04143 }

string const rpnstringconvert::name (  )  const [inline, virtual]

Reimplemented from rpnfunction.

Definition at line 1349 of file rpnfunc.h.

01349 { return string("string"); }

void rpnstringconvert::visit ( deque< rpnbase * > &  ds,
rpnreal n 
) [virtual]

Reimplemented from rpnfunction.

Definition at line 4158 of file rpnfunc.cpp.

References rpnbase::dec(), and rpnreal::num.

04159 {
04160   rpnbase* x0 = ds.front();
04161   ds.pop_front();
04162 
04163   stringstream ss;
04164   ss << n.num;
04165 
04166   new rpnstring(ds,ss.str());
04167 
04168   x0->dec();
04169 }

void rpnstringconvert::visit ( deque< rpnbase * > &  ds,
rpninteger n 
) [virtual]

Reimplemented from rpnfunction.

Definition at line 4145 of file rpnfunc.cpp.

References rpnbase::dec(), and rpninteger::num.

04146 {
04147   rpnbase* x0 = ds.front();
04148   ds.pop_front();
04149 
04150   stringstream ss;
04151   ss << n.num;
04152 
04153   new rpnstring(ds,ss.str());
04154 
04155   x0->dec();
04156 }


The documentation for this class was generated from the following files:

Generated on Fri Mar 4 00:50:16 2011 for Chelton Evans Source by  doxygen 1.5.8