proj home

Files   Classes   Functions   Hierarchy  

rpnbitxor Class Reference

#include <rpnfunc.h>

Inheritance diagram for rpnbitxor:
Collaboration diagram for rpnbitxor:

List of all members.

Public Member Functions

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


Detailed Description

Definition at line 1240 of file rpnfunc.h.


Constructor & Destructor Documentation

rpnbitxor::rpnbitxor (  )  [inline]

Definition at line 1244 of file rpnfunc.h.

Referenced by copy().

01244 {}

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

Definition at line 3889 of file rpnfunc.cpp.

References eval().

03890 {
03891   if (evaluate)
03892     eval(ds);
03893   else
03894     ds.push_front(this);
03895 }

rpnbitxor::~rpnbitxor (  )  [inline]

Definition at line 1246 of file rpnfunc.h.

01246 {}


Member Function Documentation

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

Reimplemented from rpnfunction.

Definition at line 3897 of file rpnfunc.cpp.

References rpnbitxor().

03898 {
03899   return new rpnbitxor();
03900 }

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

Reimplemented from rpnfunction.

Definition at line 3902 of file rpnfunc.cpp.

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

Referenced by rpnbitxor().

03903 {
03904   if (ds.size()>1)
03905     ds[0]->accept(ds,*this);
03906 
03907   dec();
03908 }

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

Reimplemented from rpnfunction.

Definition at line 1251 of file rpnfunc.h.

01251 { return string("xor"); }

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

Reimplemented from rpnfunction.

Definition at line 3910 of file rpnfunc.cpp.

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

03911 {
03912   rpnbase* x0 = ds.front();
03913   rpnbase* x1 = ds[1];
03914 
03915   if (!x1->isinteger())
03916     return;
03917 
03918   ds.pop_front();
03919 
03920   ((rpninteger*)x1)->num ^= n.num;
03921   
03922   x0->dec();
03923 }


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