proj home

Files   Classes   Functions   Hierarchy  

rpnclearboth Class Reference

#include <rpnfunc.h>

Inheritance diagram for rpnclearboth:
Collaboration diagram for rpnclearboth:

List of all members.

Public Member Functions

 rpnclearboth ()
 rpnclearboth (deque< rpnbase * > &ds, bool const evaluate=true)
 ~rpnclearboth ()
rpnbasecopy () const
string const name () const
void eval (deque< rpnbase * > &ds)


Detailed Description

Definition at line 144 of file rpnfunc.h.


Constructor & Destructor Documentation

rpnclearboth::rpnclearboth (  )  [inline]

Definition at line 148 of file rpnfunc.h.

Referenced by copy().

00148 {}

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

Definition at line 336 of file rpnfunc.cpp.

References eval().

00337 {
00338   if (evaluate)
00339     eval(ds);
00340   else
00341     ds.push_front(this);
00342 }

rpnclearboth::~rpnclearboth (  )  [inline]

Definition at line 150 of file rpnfunc.h.

00150 {}


Member Function Documentation

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

Reimplemented from rpnfunction.

Definition at line 344 of file rpnfunc.cpp.

References rpnclearboth().

00345 {
00346   return new rpnclearboth(); 
00347 }

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

Reimplemented from rpnfunction.

Definition at line 349 of file rpnfunc.cpp.

References rpnbase::dec().

Referenced by rpnclearboth().

00350 {
00351   if (!ds.empty())
00352   {
00353     for (unsigned int i=0, imax=ds.size(); i<imax; ++i)
00354       ds[i]->dec();
00355 
00356     ds.clear();
00357   }
00358 
00359   deque<rpnvar*>& var = rpnprogramstackstate().vs();
00360   if (!var.empty())
00361   {
00362     for (unsigned int i=0, imax=var.size(); i<imax; ++i)
00363       var[i]->dec();
00364 
00365     var.clear();
00366   }
00367 
00368   dec();
00369 }

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

Reimplemented from rpnfunction.

Definition at line 153 of file rpnfunc.h.

00153 { return string("clearboth"); }


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

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