proj home

Files   Classes   Functions   Hierarchy  

rpnstring Class Reference

#include <rpn.h>

Inheritance diagram for rpnstring:
Inheritance graph
Collaboration diagram for rpnstring:
Collaboration graph

List of all members.

Public Member Functions

 rpnstring ()
 rpnstring (deque< rpnbase * > &ds, string const &s)
 ~rpnstring ()
rpnbasecopy () const
void accept (deque< rpnbase * > &ds, rpnfunction &f)
ostreamprint (ostream &os) const
void eval (deque< rpnbase * > &ds)
bool const isstring () const
 rpnstring ()
 rpnstring (deque< rpnbase * > &ds, string const &s)
 ~rpnstring ()
rpnbasecopy () const
void accept (deque< rpnbase * > &ds, rpnfunction &f)
ostreamprint (ostream &os) const
void eval (deque< rpnbase * > &ds)
bool const isstring () const

Public Attributes

string str

Detailed Description

Definition at line 183 of file rpn.h.


Constructor & Destructor Documentation

rpnstring::rpnstring (  )  [inline]

Definition at line 189 of file rpn.h.

Referenced by copy().

00189 {}

rpnstring::rpnstring ( deque< rpnbase * > &  ds,
string const &  s 
)

Definition at line 171 of file rpn.cpp.

References eval().

00172   :str(s)
00173 {
00174   eval(ds);
00175 }

rpnstring::~rpnstring (  )  [inline]

Definition at line 191 of file rpn.h.

00191 {}

rpnstring::rpnstring (  )  [inline]

Definition at line 155 of file rpn2.h.

00155 {}

rpnstring::rpnstring ( deque< rpnbase * > &  ds,
string const &  s 
)
rpnstring::~rpnstring (  )  [inline]

Definition at line 157 of file rpn2.h.

00157 {}


Member Function Documentation

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

Definition at line 160 of file rpn2.h.

References rpnfunction::visit().

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

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

Definition at line 194 of file rpn.h.

References rpnfunction::visit().

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

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

Implements rpnbase.

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

Implements rpnbase.

Definition at line 196 of file rpn.cpp.

References rpnstring(), and str.

00197 {
00198   rpnstring* s = new rpnstring();
00199   s->str = str;
00200   return s;
00201 }

void rpnstring::eval ( deque< rpnbase * > &  ds  ) 
void rpnstring::eval ( deque< rpnbase * > &  ds  )  [inline]

Definition at line 203 of file rpn.cpp.

Referenced by rpnstring().

00204 {
00205   ds.push_front(this); 
00206 }

bool const rpnstring::isstring (  )  const [inline, virtual]

Reimplemented from rpnbase.

Definition at line 167 of file rpn2.h.

00168     { return true; }

bool const rpnstring::isstring (  )  const [inline, virtual]

Reimplemented from rpnbase.

Definition at line 201 of file rpn.h.

00202     { return true; }

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

Reimplemented from rpnbase.

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

Reimplemented from rpnbase.

Definition at line 177 of file rpn.cpp.

References str.

00178 {
00179   if (str=="/")
00180     return os << "\"/\"";
00181 
00182   if (str.find(' ')!=string::npos)
00183     return os << '"' << str << '"';
00184 
00185   return os << str;
00186 
00187 /*
00188   if (str != "/")
00189     return os << str;
00190 
00191   // To distinguish between division and root node. 
00192   return os << string("\"/");
00193 */
00194 }


Member Data Documentation


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