proj home

Files   Classes   Functions   Hierarchy  

Public Member Functions | Public Attributes | List of all members
rpnvector Class Reference

#include <rpn.h>

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

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 Member Functions inherited from rpnbase
virtual void inc ()
void dec ()
 rpnbase ()
virtual ~rpnbase ()=0
virtual void eval (deque< rpnbase * > &ds)
virtual bool const isinteger () const
virtual bool const isreal () const
virtual bool const iscomplex () const
virtual bool const isstring () const
virtual bool const isprogram () const
virtual bool const isvariable () const
bool const isnumber () const
virtual void inc ()
void dec ()
 rpnbase ()
virtual ~rpnbase ()=0
virtual void eval (deque< rpnbase * > &ds)
virtual bool const isinteger () const
virtual bool const isreal () const
virtual bool const isstring () const
virtual bool const isprogram () const
virtual bool const isvariable () const
bool const isnumber () const

Public Attributes

int reverseindex
- Public Attributes inherited from rpnbase
unsigned int counter

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().

rpnvector::rpnvector ( int  index)

Member Function Documentation

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

Reimplemented from rpnbase.

Definition at line 222 of file rpn2.h.

References rpnfunction::visit().

{ f.visit(ds,*this); }
void rpnvector::accept ( deque< rpnbase * > &  ds,
rpnfunction f 
)
inlinevirtual

Reimplemented from rpnbase.

Definition at line 254 of file rpn.h.

References rpnfunction::visit().

{ 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().

{
/* I do not want a default contructor, so put a dummy
argument in. The reverseindex should be preserved
with a copy as they point to the same place.
*/
rpnvector* p = new rpnvector((int)0);
return p;
}
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().

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

Definition at line 548 of file rpn.cpp.

References rpnprogramstackstate::ds().

Referenced by index(), and rpnvector().

{
int k = rpnprogramstackstate().ds().size();
k -= n;
return k;
}
bool const rpnvector::isvector ( ) const
inlinevirtual

Reimplemented from rpnbase.

Definition at line 235 of file rpn2.h.

{ return true; }
bool const rpnvector::isvector ( ) const
inlinevirtual

Reimplemented from rpnbase.

Definition at line 268 of file rpn.h.

{ return true; }
string const rpnvector::name ( ) const
inlinevirtual

Reimplemented from rpnbase.

Definition at line 226 of file rpn2.h.

{ return "rpnvector"; }
string const rpnvector::name ( ) const
inlinevirtual

Reimplemented from rpnbase.

Definition at line 258 of file rpn.h.

{ 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().

{
return os << " " << index() << " [] ";
//return os << " " << indexcomplement(reverseindex) << " [] ";
}

Member Data Documentation

int rpnvector::reverseindex

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: