AURobotServers  4
Public Member Functions | Public Attributes | Protected Attributes | List of all members
UMisLoop Class Reference

#include <urule.h>

Inheritance diagram for UMisLoop:
Inheritance graph

Public Member Functions

UMisItem::ResultValue evalCondition (UVarCalc *calc, bool *val)
 
virtual const char * getDataType ()
 
UMisItem::ResultValue runInitAssignment (UVarCalc *calc)
 
UMisItem::ResultValue runLoopAssignment (UVarCalc *calc)
 
virtual bool setLine (const int lineNum, const char *value, UVarCalc *calc)
 
 UMisLoop ()
 
virtual ~UMisLoop ()
 
- Public Member Functions inherited from UMisLineItem
const char * getLine ()
 
virtual const char * print (const char *preStr, char *buf, const int bufCnt)
 
 UMisLineItem ()
 
virtual ~UMisLineItem ()
 
- Public Member Functions inherited from UMisItem
virtual ResultValue execute (UVarCalc *calc, int state)
 
const char * findStopChar (const char *source, char stop)
 
int getLineNumber ()
 
bool isA (const char *matchType)
 
void setLineNumber (const int line)
 
 UMisItem ()
 
virtual ~UMisItem ()
 
- Public Member Functions inherited from UDataBase
bool isA (const char *typeString)
 
virtual bool isAlsoA (const char *typeString)
 
virtual void snprint (const char *preString, char *buff, const int buffCnt)
 
 UDataBase ()
 
virtual ~UDataBase ()
 

Public Attributes

const char * condition
 
UMisItemloopLine
 
- Public Attributes inherited from UMisItem
UMisItemnext
 

Protected Attributes

UMisAssigninitAssign
 
UMisAssignloopAssign
 
- Protected Attributes inherited from UMisLineItem
char * line
 
- Protected Attributes inherited from UMisItem
int lineNumber
 

Additional Inherited Members

- Public Types inherited from UMisItem
enum  ResultValue {
  RV_EMPTY, RV_OK, RV_OK_FALSE, RV_OK_AGAIN,
  RV_SYNTAX_ERROR, RV_FAILED, RV_IF_TRUE, RV_IF_FALSE
}
 
- Static Public Member Functions inherited from UMisItem
static bool isRem (const char *r)
 
- Protected Member Functions inherited from UMisItem
int symbolLength (const char *exp)
 

Detailed Description

Class that holds a loop, either a for-loop or a while-loop statement

Constructor & Destructor Documentation

UMisLoop::UMisLoop ( )

Constructor

UMisLoop::~UMisLoop ( )
virtual

Destructor

Member Function Documentation

UMisItem::ResultValue UMisLoop::evalCondition ( UVarCalc calc,
bool *  val 
)

evaluate the loop condition

Parameters
calcis the UVarCalc object with the local variables
valis where the boolean result is returned
Returns
RV_OK if expression is evaluated, else RV_SYNTAX_ERROR

References UVarCalc::evaluateV(), UVariable::getValued(), UMisItem::RV_OK, and UMisItem::RV_SYNTAX_ERROR.

Referenced by UMisRuleState::runLoop().

virtual const char* UMisLoop::getDataType ( )
inlinevirtual

Get (end) type of this structure

Reimplemented from UMisLineItem.

UMisItem::ResultValue UMisLoop::runInitAssignment ( UVarCalc calc)

GExecute the init assignment for the loop (if any)

Parameters
calcis the UVarCalc object with the local variables
Returns
RV_OK if assignment is an success, else RV_SYNTAX_ERROR

References UMisRuleState::init, and UMisItem::RV_OK.

Referenced by UMisRuleState::runLoop().

UMisItem::ResultValue UMisLoop::runLoopAssignment ( UVarCalc calc)

GExecute the init assignment for the loop (if any)

Parameters
calcis the UVarCalc object with the local variables
Returns
RV_OK if assignment is an success, else RV_SYNTAX_ERROR

References UMisRuleState::main, and UMisItem::RV_OK.

Referenced by UMisRuleState::runLoop().

bool UMisLoop::setLine ( const int  lineNum,
const char *  value,
UVarCalc calc 
)
virtual

Member Data Documentation

const char* UMisLoop::condition

The condition to continue the loop

UMisAssign* UMisLoop::initAssign
protected

The initial assignment - possibly creating a new local variable

UMisAssign* UMisLoop::loopAssign
protected

The assignment to be done after each loop

UMisItem* UMisLoop::loopLine

The loop expression itself, set during execution

Referenced by UMisRuleState::runLoop().


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