proj home

Files   Classes   Functions   Hierarchy  

rpninteger Class Reference

#include <rpn.h>

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

List of all members.

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 Attributes

long int num

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

00166 {}

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

Definition at line 125 of file rpn.cpp.

References rpnbase::eval().

00126   : num(n)
00127 {
00128   eval(ds);
00129 }

rpninteger::~rpninteger (  )  [inline]

Definition at line 168 of file rpn.h.

00168 {}

rpninteger::rpninteger (  )  [inline]

Definition at line 132 of file rpn2.h.

00132 {}

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

Definition at line 134 of file rpn2.h.

00134 {}


Member Function Documentation

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

Definition at line 137 of file rpn2.h.

References rpnfunction::visit().

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

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

Definition at line 171 of file rpn.h.

References rpnfunction::visit().

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

00164 {
00165   rpninteger* n = new rpninteger();
00166   n->num = num;
00167   return n;
00168 }

bool const rpninteger::isinteger (  )  const [inline, virtual]

Reimplemented from rpnbase.

Definition at line 144 of file rpn2.h.

00145     { return true; }

bool const rpninteger::isinteger (  )  const [inline, virtual]

Reimplemented from rpnbase.

Definition at line 178 of file rpn.h.

00179     { return true; }

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

Reimplemented from rpnbase.

Definition at line 141 of file rpn2.h.

00142     { return string("rpninteger"); }

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

Reimplemented from rpnbase.

Definition at line 175 of file rpn.h.

00176     { 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.

00132 {
00133 
00134   switch( displaybase )
00135   {
00136     case 10: 
00137       os.unsetf(ios::hex);
00138       os.unsetf(ios::oct);
00139       os.setf(ios::dec);
00140       break;
00141 
00142     case 8:
00143       os.unsetf(ios::dec);
00144       os.unsetf(ios::hex);
00145       os.setf(ios::oct);
00146       break;
00147 
00148     case 16:
00149       os.unsetf(ios::dec);
00150       os.unsetf(ios::oct);
00151       os.setf(ios::hex);
00152       break;
00153 
00154     case 2: 
00155 
00156       os << bitset<numeric_limits<long int>::digits>( num );
00157       return os;
00158   };
00159 
00160   return os << num;
00161 }


Member Data Documentation

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

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