Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals

ExprParser::Context Class Reference

Collaboration diagram for ExprParser::Context:

Collaboration graph
[legend]

Public Member Functions

 Context (map< string, Random * > &aVar)
 Context (Context &ctx)
Contextoperator= (Context &ctx)
Contextoperator+= (Context &ctx)
Contextoperator-= (Context &ctx)
Contextoperator *= (Context &ctx)
Contextoperator/= (Context &ctx)
Contextoperator|= (Context &ctx)

Data Fields

map< string, Random * > & variables
 association of the variable names and their values (for this case random)

Randomrdm
double val

Constructor & Destructor Documentation

ExprParser::Context::Context map< string, Random * > &  aVar  )  [inline]
 

Definition at line 32 of file expr.h.

References rdm, val, and variables.

00033                 : variables( aVar ) , val( 0.0 ) , rdm( 0 )
00034                 {}

ExprParser::Context::Context Context ctx  )  [inline]
 

Definition at line 36 of file expr.h.

References rdm, val, and variables.

00037                 : variables( ctx.variables ) , val( 0.0 ) , rdm( 0 )
00038                 {}


Member Function Documentation

Context& ExprParser::Context::operator *= Context ctx  )  [inline]
 

Definition at line 73 of file expr.h.

References rdm, and val.

00074                 {
00075                         if( rdm )
00076                                 if( ctx.rdm )
00077                                         rdm = &(*rdm * *(ctx.rdm));
00078                                 else
00079                                         rdm = &(*rdm * ctx.val);
00080                         else if( ctx.rdm )
00081                                 rdm = &(val * *(ctx.rdm));
00082                         else
00083                                 val *= ctx.val;
00084                         return *this;
00085                 }

Context& ExprParser::Context::operator+= Context ctx  )  [inline]
 

Definition at line 47 of file expr.h.

References rdm, and val.

00048                 {
00049                         if( rdm )
00050                                 if( ctx.rdm )
00051                                         rdm = &(*rdm + *(ctx.rdm));
00052                                 else
00053                                         rdm = &(*rdm + ctx.val);
00054                         else if( ctx.rdm )
00055                                 rdm = &(val + *(ctx.rdm));
00056                         else
00057                                 val += ctx.val;
00058                         return *this;
00059                 }

Context& ExprParser::Context::operator-= Context ctx  )  [inline]
 

Definition at line 60 of file expr.h.

References rdm, and val.

00061                 {
00062                         if( rdm )
00063                                 if( ctx.rdm )
00064                                         rdm = &(*rdm - *(ctx.rdm));
00065                                 else
00066                                         rdm = &(*rdm - ctx.val);
00067                         else if( ctx.rdm )
00068                                 rdm = &(val - *(ctx.rdm));
00069                         else
00070                                 val -= ctx.val;
00071                         return *this;
00072                 }

Context& ExprParser::Context::operator/= Context ctx  )  [inline]
 

Definition at line 86 of file expr.h.

References rdm, and val.

00087                 {
00088                         if( rdm )
00089                                 if( ctx.rdm )
00090                                         rdm = &(*rdm / *(ctx.rdm));
00091                                 else
00092                                         rdm = &(*rdm / ctx.val);
00093                         else if( ctx.rdm )
00094                                 rdm = &(val / *(ctx.rdm));
00095                         else
00096                                 val /= ctx.val;
00097                         return *this;
00098                 }

Context& ExprParser::Context::operator= Context ctx  )  [inline]
 

Definition at line 40 of file expr.h.

References rdm, and val.

00041                 {
00042                         rdm = ctx.rdm;
00043                         val = ctx.val;
00044                         return *this;
00045                 }

Context& ExprParser::Context::operator|= Context ctx  )  [inline]
 

Definition at line 99 of file expr.h.

References rdm, and val.

00100                 {
00101                         if( rdm && ctx.rdm )
00102                                 rdm = &(*rdm | *(ctx.rdm));
00103                         else
00104                                 val = (int)val | (int)ctx.val;
00105                         return *this;
00106                 }


Field Documentation

Random* ExprParser::Context::rdm
 

Definition at line 29 of file expr.h.

Referenced by ExprParser::Apply(), Context(), operator *=(), operator+=(), operator-=(), operator/=(), operator=(), operator|=(), and ExprParser::WalkTree().

double ExprParser::Context::val
 

Definition at line 30 of file expr.h.

Referenced by Context(), operator *=(), operator+=(), operator-=(), operator/=(), operator=(), operator|=(), and ExprParser::WalkTree().

map<string,Random *>& ExprParser::Context::variables
 

association of the variable names and their values (for this case random)

Definition at line 28 of file expr.h.

Referenced by Context(), and ExprParser::WalkTree().


The documentation for this class was generated from the following file:
Generated on Fri Dec 5 04:06:20 2003 for Borqueror by doxygen 1.3.3