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

#include <urule.h>

Inheritance diagram for UMisControl:
Inheritance graph

Public Member Functions

UMisItem::ResultValue evaluateCondition (UVarCalc *calc)
 evaluate the condition of the control statement. More...
 
virtual ResultValue execute (UVarCalc *calc, int repeat)
 
const char * getCondition ()
 
virtual const char * getDataType ()
 
virtual bool setLine (const int lineNum, const char *value, UVarCalc *calc)
 
 UMisControl ()
 
virtual ~UMisControl ()
 
- Public Member Functions inherited from UMisCall
const char * getName ()
 
int getNameCnt ()
 
const char * getNameCopy (char *dest, const int destCnt)
 
const char * getParameters ()
 
bool isA (const char *thisName)
 
 UMisCall ()
 
virtual ~UMisCall ()
 
- 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
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 ()
 

Protected Attributes

const char * strCond
 
- Protected Attributes inherited from UMisCall
const char * name
 
int nameCnt
 
const char * parameters
 
- 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)
 
- Public Attributes inherited from UMisItem
UMisItemnext
 
- Protected Member Functions inherited from UMisItem
int symbolLength (const char *exp)
 

Detailed Description

Class that holds a control statement, that is a call that is called repeatingly until a continue condition is fullfilled

Constructor & Destructor Documentation

UMisControl::UMisControl ( )

Constructor

UMisControl::~UMisControl ( )
virtual

Constructor DEstructor

Member Function Documentation

UMisItem::ResultValue UMisControl::evaluateCondition ( UVarCalc calc)

evaluate the condition of the control statement.

Parameters
calcis the calculateor - and scope for variables and methods
Returns
RV_OK if condition evaluated anything but false (rounds to 0), returns RV_ otherwise returns RV_SYNTAX_ERROR if condition can not be evaluated - syntax error. Puts a statement in log if syntax error.

References UVarCalc::evaluateV(), UVarCalc::getErrorTxt(), UVariable::getValued(), UMisItem::isRem(), UMisItem::lineNumber, roundi(), UMisItem::RV_OK, UMisItem::RV_OK_FALSE, and UMisItem::RV_SYNTAX_ERROR.

Referenced by UMisRuleState::runControl().

UMisItem::ResultValue UMisControl::execute ( UVarCalc calc,
int  repeat 
)
virtual

execute item.

Parameters
calcis the calculateor - and scope for variables and methods
repeatis the repeat call sequence 0 for first >0 for subsequent and -1 for last call result of executing this line normal is RV_OK if control line is finished, or
Returns
RV_SYNTAX_ERROR. The error text is returned in the errTxt buffer.
RV_OK_AGAIN when the call is not finished.

Reimplemented from UMisItem.

References UVarPool::callLocalV(), UVarPool::callScopeV(), UVarCalc::evaluateParametersV(), UVarCalc::getErrorTxt(), UVariable::getValued(), UMisItem::lineNumber, MAX_ERROR_SIZE, MAX_STRUCT_NAMES, MAX_VAR_NAME_SIZE, roundi(), UMisItem::RV_FAILED, UMisItem::RV_OK, UMisItem::RV_OK_AGAIN, UMisItem::RV_OK_FALSE, UMisItem::RV_SYNTAX_ERROR, and UVariable::setValued().

const char* UMisControl::getCondition ( )
inline

Get explicit condition

Returns
pointer to condition string

Referenced by UMisRuleState::runControl().

virtual const char* UMisControl::getDataType ( )
inlinevirtual

Get (end) type of this structure

Reimplemented from UMisCall.

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

Set the command line

Reimplemented from UMisCall.

References UMisItem::findStopChar(), and UMisCall::setLine().

Member Data Documentation

const char* UMisControl::strCond
protected

explicit condition statement


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