proj home

Files   Classes   Functions   Hierarchy  

rpnvector Class Reference

#include <rpn.h>

Inheritance diagram for rpnvector:
Inheritance graph
Collaboration diagram for rpnvector:
Collaboration graph

List of all members.

Public Member Functions

 rpnvector (int index)
rpnbasecopy () const
void accept (deque< rpnbase * > &ds, rpnfunction &f)
ostreamprint (ostream &os) const
string const name () const
int const indexcomplement (int const n) const
const int index () const
bool const isvector () const
 rpnvector (int index)
rpnbasecopy () const
void accept (deque< rpnbase * > &ds, rpnfunction &f)
ostreamprint (ostream &os) const
string const name () const
int const indexcomplement (int const n) const
const int index () const
bool const isvector () const

Public Attributes

int reverseindex

Detailed Description

Definition at line 239 of file rpn.h.


Constructor & Destructor Documentation

rpnvector::rpnvector ( int  index  ) 

Definition at line 532 of file rpn.cpp.

References indexcomplement(), and reverseindex.

Referenced by copy().

00533 {
00534   reverseindex = indexcomplement(index);
00535 }

rpnvector::rpnvector ( int  index  ) 

Member Function Documentation

void rpnvector::accept ( deque< rpnbase * > &  ds,
rpnfunction f 
) [inline]

Definition at line 222 of file rpn2.h.

References rpnfunction::visit().

00223     { f.visit(ds,*this); }

void rpnvector::accept ( deque< rpnbase * > &  ds,
rpnfunction f 
) [inline]

Definition at line 254 of file rpn.h.

References rpnfunction::visit().

00255     { f.visit(ds,*this); }

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

Implements rpnbase.

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

Implements rpnbase.

Definition at line 537 of file rpn.cpp.

References reverseindex, and rpnvector().

00538 {
00539   /* I do not want a default contructor, so put a dummy
00540      argument in.  The reverseindex should be preserved
00541      with a copy as they point to the same place.
00542   */
00543   rpnvector* p = new rpnvector((int)0);
00544   p->reverseindex = reverseindex;
00545   return p;
00546 }

const int rpnvector::index (  )  const
const int rpnvector::index (  )  const

Definition at line 555 of file rpn.cpp.

References indexcomplement(), and reverseindex.

Referenced by print(), and rpnvectorpointermake::visit().

00556 {
00557   return indexcomplement(reverseindex);
00558 }

int const rpnvector::indexcomplement ( int const   n  )  const
int const rpnvector::indexcomplement ( int const   n  )  const

Definition at line 548 of file rpn.cpp.

Referenced by index(), and rpnvector().

00549 {
00550   int k = rpnprogramstackstate().ds().size();
00551   k -= n;
00552   return k;
00553 }

bool const rpnvector::isvector (  )  const [inline, virtual]

Reimplemented from rpnbase.

Definition at line 235 of file rpn2.h.

00236     { return true; }

bool const rpnvector::isvector (  )  const [inline, virtual]

Reimplemented from rpnbase.

Definition at line 268 of file rpn.h.

00269     { return true; }

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

Reimplemented from rpnbase.

Definition at line 226 of file rpn2.h.

00227     { return "rpnvector"; }

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

Reimplemented from rpnbase.

Definition at line 258 of file rpn.h.

00259     { return "rpnvector"; }

ostream& rpnvector::print ( ostream os  )  const [virtual]

Reimplemented from rpnbase.

ostream & rpnvector::print ( ostream os  )  const [virtual]

Reimplemented from rpnbase.

Definition at line 561 of file rpn.cpp.

References index().

00562 {
00563   return os << " " << index() << " [] ";
00564   //return os << " " << indexcomplement(reverseindex) << " [] ";
00565 }


Member Data Documentation

Definition at line 249 of file rpn.h.

Referenced by copy(), index(), and rpnvector().


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

Generated on 27 Nov 2012 for Chelton Evans Source by  doxygen 1.6.1