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

#include <uresrule.h>

Inheritance diagram for UMisLoadedRule:
Inheritance graph

Public Member Functions

bool addEditLines (const char *lines)
 add line or lines to to the unloaded bart of plan More...
 
bool completeEdit (UVarCalc *calc)
 
bool isBusy ()
 
bool isDefRule ()
 
virtual bool isEdit ()
 
virtual int setBusyCnt (int delta)
 
void setEdit (bool value)
 
 UMisLoadedRule ()
 
bool unpack (USmlSource *cnn, USmlTag *tag, UVarCalc *calc)
 
virtual ~UMisLoadedRule ()
 
- Public Member Functions inherited from UMisRule
void addIniLine (UMisItem *newLine)
 
void addMainLine (UMisItem *newLine)
 
void addPostLine (UMisItem *newLine)
 
virtual const char * getDataType ()
 
const char * getFileName ()
 
UMisItemgetIniLines ()
 
int getIniLinesCnt ()
 
UMisItemgetMainLines ()
 
int getMainLinesCnt ()
 
const char * getName ()
 
UMisItemgetPostLines ()
 
int getPostLinesCnt ()
 
virtual const char * print (const char *preStr, char *buf, const int bufCnt)
 
void setCalc (UVarCalc *calculator)
 
void setLogFile (ULogFile *logFile)
 
void setName (const char *toName)
 
 UMisRule ()
 
bool unpackRule (USmlSource *cnn, USmlTag *tag)
 
virtual ~UMisRule ()
 
- 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)
 
virtual bool setLine (const int lineNum, const char *value, UVarCalc *calc)
 
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

UMisLoadedRulenextRule
 
char sourceFileName [MAX_FILENAME_LENGTH]
 
- Public Attributes inherited from UMisRule
char * condition
 
string dependPlugin
 
string description
 
char * destination
 
bool isFull
 
bool isLoop
 
bool isRule
 
bool isRun
 
bool isSwitch
 
bool isTop
 
ULogFilelogm
 
int order
 Priority order of this plan - relative to other (sub) plans. This value controls in wich order the list of (sub) plans are assigned processing time, i.e. if a number of sub-plans evaluate some value - e.g. the robot pose - then thise can be assigned to be evaluated before another subplan, that combines or selects the usable results from the others. A priority with a low number is executed first. The value range is 1..100, where 1 is executed before the others. if two plans have the same priority order, then the order is un-determined. Default value is 50. More...
 
char * parameters
 
int parametersCnt
 
int switchValue
 
- Public Attributes inherited from UMisItem
UMisItemnext
 

Protected Member Functions

virtual const char * getEditLines ()
 
void stripEscape (char *dest, const char *source)
 
- Protected Member Functions inherited from UMisRule
void addLine (UMisItem *elemList, UMisItem *newLine)
 
virtual bool checkSyntax (USmlSource *cnn)
 
int getLinesCnt (UMisItem *fromLine)
 
int trimWhiteSpace (char *s)
 
bool unpackBlock (USmlSource *cnn, USmlTag *tag, UMisItem **itemList)
 
bool unpackInitPostBlock (USmlSource *cnn, USmlTag *tag, UMisItem **itemList, MisPart iniBlock)
 
bool unpackLine (USmlSource *cnn, char *line, UMisItem **itemNext, int lineNum, MisPart iniBlock)
 
bool unpackSequence (USmlSource *cnn, char *lines, UMisItem **itemList, int lineNum, MisPart iniBlock=MP_MAIN)
 
- Protected Member Functions inherited from UMisItem
int symbolLength (const char *exp)
 

Private Attributes

int busyCnt
 Number of times this (root) plan is beeing used. More...
 
bool edit
 is the plan fully loaded or is it still beeing edited More...
 
char * editLines
 unloaded part of plan More...
 

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 Types inherited from UMisRule
enum  MisPart { MP_INIT, MP_MAIN, MP_POST }
 
- Protected Attributes inherited from UMisRule
UVarCalccalc
 
char fileName [MAX_FILENAME_LENGTH]
 
bool inEditAppend
 
UMisIteminiLines
 
UMisItemmainLines
 
char name [MAX_VAR_NAME_SIZE]
 
UMisItempostLines
 
- Protected Attributes inherited from UMisItem
int lineNumber
 

Constructor & Destructor Documentation

UMisLoadedRule::UMisLoadedRule ( )
UMisLoadedRule::~UMisLoadedRule ( )
virtual

Destructor

References editLines, and nextRule.

Member Function Documentation

bool UMisLoadedRule::addEditLines ( const char *  lines)

add line or lines to to the unloaded bart of plan

Parameters
linesa zero terminated string to be added
Returns
true if added (otherwise the memory allocation failed)

References editLines, and stripEscape().

Referenced by UFuncRule::editRule(), and isBusy().

bool UMisLoadedRule::completeEdit ( UVarCalc calc)

Add the potential lines in the edit buffer

Parameters
calculatorreference that should be used for any load calculations
Returns
true if errors were found during unpack.

References edit, editLines, UMisRule::inEditAppend, USmlString::isSourceAvailable(), UMisRule::setCalc(), USmlString::setSourceString(), and UMisRule::unpackRule().

Referenced by UResRule::completeEdit(), UResRule::getSyntaxErrorString(), and isBusy().

virtual const char* UMisLoadedRule::getEditLines ( )
inlineprotectedvirtual

Get the edit lines (un-implemented parts of a plan)

Returns
NULL if no edit lines are available.

Reimplemented from UMisRule.

bool UMisLoadedRule::isBusy ( )
inline

Is this plan busy - i.e. used by the sequencer. The busy cnt can be set from a locked resource only, so just

Returns
true if the count is not zero.

References addEditLines(), busyCnt, completeEdit(), and stripEscape().

Referenced by UFuncRule::editRule(), UResRule::tryUnloadRule(), and UFuncRule::unloadRule().

bool UMisLoadedRule::isDefRule ( )

Print mission plan to buffer

Parameters
preStra string to add before the plan lines
bufa string buffer to hold the plan
bufCntthe size of the buffer Is the top plan the default plan
Returns
true if plan is marked as the default plan (in the file)
virtual bool UMisLoadedRule::isEdit ( )
inlinevirtual

Is this plan in editing mode - i.e. append is allowed

Returns
true if plan is marked as under edit, i.e. not runable and not active

Reimplemented from UMisRule.

References edit.

Referenced by UFuncRule::editRule(), UResRule::getRule(), and UFuncRule::unloadRule().

int UMisLoadedRule::setBusyCnt ( int  delta)
virtual

Adjust the number of times this plan is beeing used by the sequencer - add 1 every time it is used in a plan state and remove one when plan state is released

Returns
count after the adjustment.

Reimplemented from UMisRule.

References busyCnt.

Referenced by UFuncRule::listAllMissions(), and setEdit().

void UMisLoadedRule::setEdit ( bool  value)
inline

set this plan in editing mode or not - i.e. append is allowed if in edit mode

References edit, and setBusyCnt().

Referenced by UResRule::addNewRule(), UFuncRule::editRule(), and UResRule::unpackMissionRule().

void UMisLoadedRule::stripEscape ( char *  dest,
const char *  source 
)
protected

Strip source string from escaped new-line combinaltion "\n" and replace with '
'.

Parameters
destdestination string, assumed to be able to hold the stripped version of source
sourcesource string - zero terminated.

Referenced by addEditLines(), and isBusy().

bool UMisLoadedRule::unpack ( USmlSource cnn,
USmlTag tag,
UVarCalc calc 
)

Unpack a plan from this tag

Parameters
cnnis a connection to the SML (XML) file
tagis the open tag for the plan
Returns
true if unpacked successfully

References USmlSource::isVerbose(), UMisRule::setCalc(), and UMisRule::unpackRule().

Referenced by UResRule::unpackMissionRule().

Member Data Documentation

int UMisLoadedRule::busyCnt
private

Number of times this (root) plan is beeing used.

Referenced by isBusy(), setBusyCnt(), and UMisLoadedRule().

bool UMisLoadedRule::edit
private

is the plan fully loaded or is it still beeing edited

Referenced by completeEdit(), isEdit(), setEdit(), and UMisLoadedRule().

char* UMisLoadedRule::editLines
private

unloaded part of plan

Referenced by addEditLines(), completeEdit(), UMisLoadedRule(), and ~UMisLoadedRule().

UMisLoadedRule* UMisLoadedRule::nextRule
char UMisLoadedRule::sourceFileName[MAX_FILENAME_LENGTH]

Source filename for the mission plan

Referenced by UMisLoadedRule(), UFuncRule::unloadRule(), and UResRule::unpackMissionRule().


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