proj home

Files   Classes   Functions   Hierarchy  

Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
rpninteger Class Reference

#include <rpn.h>

Inheritance diagram for rpninteger:
Inheritance graph
Collaboration diagram for rpninteger:
Collaboration graph

Public Types

typedef long int type
typedef long int type

Public Member Functions

 rpninteger ()
 rpninteger (deque< rpnbase * > &ds, long int const n)
 ~rpninteger ()
rpnbasecopy () const
void accept (deque< rpnbase * > &ds, rpnfunction &f)
ostreamprint (ostream &os) const
string const name () const
bool const isinteger () const
 rpninteger ()
 rpninteger (deque< rpnbase * > &ds, long int const n)
 ~rpninteger ()
rpnbasecopy () const
void accept (deque< rpnbase * > &ds, rpnfunction &f)
ostreamprint (ostream &os) const
string const name () const
bool const isinteger () 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 isreal () const
virtual bool const iscomplex () const
virtual bool const isstring () const
virtual bool const isprogram () const
virtual bool const isvariable () const
virtual bool const isvector () const
bool const isnumber () const
virtual void inc ()
void dec ()
 rpnbase ()
virtual ~rpnbase ()=0
virtual void eval (deque< rpnbase * > &ds)
virtual bool const isreal () const
virtual bool const isstring () const
virtual bool const isprogram () const
virtual bool const isvariable () const
virtual bool const isvector () const
bool const isnumber () const

Public Attributes

long int num
- Public Attributes inherited from rpnbase
unsigned int counter

Static Public Attributes

static unsigned int displaybase

Detailed Description

Definition at line 157 of file rpn.h.

Member Typedef Documentation

typedef long int rpninteger::type

Definition at line 130 of file rpn2.h.

typedef long int rpninteger::type

Definition at line 162 of file rpn.h.

Constructor & Destructor Documentation

rpninteger::rpninteger ( )
inline

Definition at line 166 of file rpn.h.

Referenced by copy().

{}
rpninteger::rpninteger ( deque< rpnbase * > &  ds,
long int const  n 
)

Definition at line 125 of file rpn.cpp.

References rpnbase::eval().

: num(n)
{
eval(ds);
}
rpninteger::~rpninteger ( )
inline

Definition at line 168 of file rpn.h.

{}
rpninteger::rpninteger ( )
inline

Definition at line 132 of file rpn2.h.

{}
rpninteger::rpninteger ( deque< rpnbase * > &  ds,
long int const  n 
)
rpninteger::~rpninteger ( )
inline

Definition at line 134 of file rpn2.h.

{}

Member Function Documentation

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

Reimplemented from rpnbase.

Definition at line 137 of file rpn2.h.

References rpnfunction::visit().

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

Reimplemented from rpnbase.

Definition at line 171 of file rpn.h.

References rpnfunction::visit().

{ f.visit(ds,*this); }
rpnbase* rpninteger::copy ( ) const
virtual

Implements rpnbase.

rpnbase * rpninteger::copy ( ) const
virtual

Implements rpnbase.

Definition at line 163 of file rpn.cpp.

References num, and rpninteger().

{
rpninteger* n = new rpninteger();
n->num = num;
return n;
}
bool const rpninteger::isinteger ( ) const
inlinevirtual

Reimplemented from rpnbase.

Definition at line 144 of file rpn2.h.

{ return true; }
bool const rpninteger::isinteger ( ) const
inlinevirtual

Reimplemented from rpnbase.

Definition at line 178 of file rpn.h.

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

Reimplemented from rpnbase.

Definition at line 141 of file rpn2.h.

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

Reimplemented from rpnbase.

Definition at line 175 of file rpn.h.

{ return string("rpninteger"); }
ostream& rpninteger::print ( ostream os) const
virtual

Reimplemented from rpnbase.

ostream & rpninteger::print ( ostream os) const
virtual

Reimplemented from rpnbase.

Definition at line 131 of file rpn.cpp.

References displaybase, and num.

{
switch( displaybase )
{
case 10:
os.unsetf(ios::hex);
os.unsetf(ios::oct);
os.setf(ios::dec);
break;
case 8:
os.unsetf(ios::dec);
os.unsetf(ios::hex);
os.setf(ios::oct);
break;
case 16:
os.unsetf(ios::dec);
os.unsetf(ios::oct);
os.setf(ios::hex);
break;
case 2:
os << bitset<numeric_limits<long int>::digits>( num );
return os;
};
return os << num;
}

Member Data Documentation

unsigned int rpninteger::displaybase
static
long int rpninteger::num

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