本文整理匯總了C++中EngineData函數的典型用法代碼示例。如果您正苦於以下問題:C++ EngineData函數的具體用法?C++ EngineData怎麽用?C++ EngineData使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EngineData函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: return
globle void *EnvGetFocus(
void *theEnv)
{
if (EngineData(theEnv)->CurrentFocus == NULL) return(NULL);
return((void *) EngineData(theEnv)->CurrentFocus->theModule);
}
示例2: EvaluateSecondaryNetworkTest
globle intBool EvaluateSecondaryNetworkTest(
void *theEnv,
struct partialMatch *leftMatch,
struct joinNode *joinPtr)
{
int joinExpr;
struct partialMatch *oldLHSBinds;
struct partialMatch *oldRHSBinds;
struct joinNode *oldJoin;
if (joinPtr->secondaryNetworkTest == NULL)
{ return(TRUE); }
#if DEVELOPER
EngineData(theEnv)->rightToLeftComparisons++;
#endif
oldLHSBinds = EngineData(theEnv)->GlobalLHSBinds;
oldRHSBinds = EngineData(theEnv)->GlobalRHSBinds;
oldJoin = EngineData(theEnv)->GlobalJoin;
EngineData(theEnv)->GlobalLHSBinds = leftMatch;
EngineData(theEnv)->GlobalRHSBinds = NULL;
EngineData(theEnv)->GlobalJoin = joinPtr;
joinExpr = EvaluateJoinExpression(theEnv,joinPtr->secondaryNetworkTest,joinPtr);
EvaluationData(theEnv)->EvaluationError = FALSE;
EngineData(theEnv)->GlobalLHSBinds = oldLHSBinds;
EngineData(theEnv)->GlobalRHSBinds = oldRHSBinds;
EngineData(theEnv)->GlobalJoin = oldJoin;
return(joinExpr);
}
示例3: AddLogicalDependencies
globle CLIPS_BOOLEAN AddLogicalDependencies(
void *theEnv,
struct patternEntity *theEntity,
int existingEntity)
{
struct partialMatch *theBinds;
struct dependency *newDependency;
/*==============================================*/
/* If the rule has no logical patterns, then no */
/* dependencies have to be established. */
/*==============================================*/
if (EngineData(theEnv)->TheLogicalJoin == NULL)
{
if (existingEntity) RemoveEntityDependencies(theEnv,theEntity);
return(TRUE);
}
else if (existingEntity && (theEntity->dependents == NULL))
{ return(TRUE); }
/*============================================================*/
/* Find the partial match in the logical join associated with */
/* activation partial match. If the partial match cannot be */
/* found, then the partial match must have been deleted by a */
/* previous RHS action and the dependency link should not be */
/* added. */
/*============================================================*/
theBinds = FindLogicalBind(EngineData(theEnv)->TheLogicalJoin,EngineData(theEnv)->GlobalLHSBinds);
if (theBinds == NULL) return(FALSE);
/*==============================================================*/
/* Add a dependency link between the partial match and the data */
/* entity. The dependency links are stored in the partial match */
/* behind the data entities stored in the partial match and the */
/* activation link, if any. */
/*==============================================================*/
newDependency = get_struct(theEnv,dependency);
newDependency->dPtr = (void *) theEntity;
newDependency->next = (struct dependency *)
theBinds->binds[theBinds->bcount + theBinds->activationf].gm.theValue;
theBinds->binds[theBinds->bcount + theBinds->activationf].gm.theValue = (void *) newDependency;
/*================================================================*/
/* Add a dependency link between the entity and the partialMatch. */
/*================================================================*/
newDependency = get_struct(theEnv,dependency);
newDependency->dPtr = (void *) theBinds;
newDependency->next = (struct dependency *) theEntity->dependents;
theEntity->dependents = (void *) newDependency;
/*==================================================================*/
/* Return TRUE to indicate that the data entity should be asserted. */
/*==================================================================*/
return(TRUE);
}
示例4: EnvClearFocusStack
globle void EnvClearFocusStack(
void *theEnv)
{
while (EngineData(theEnv)->CurrentFocus != NULL) EnvPopFocus(theEnv);
EngineData(theEnv)->FocusChanged = TRUE;
}
示例5: EnvSetIncrementalReset
globle intBool EnvSetIncrementalReset(
void *theEnv,
int value)
{
int ov;
struct defmodule *theModule;
SaveCurrentModule(theEnv);
for (theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,NULL);
theModule != NULL;
theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,theModule))
{
EnvSetCurrentModule(theEnv,(void *) theModule);
if (EnvGetNextDefrule(theEnv,NULL) != NULL)
{
RestoreCurrentModule(theEnv);
return(-1);
}
}
RestoreCurrentModule(theEnv);
ov = EngineData(theEnv)->IncrementalResetFlag;
EngineData(theEnv)->IncrementalResetFlag = value;
return(ov);
}
示例6: RetractCheckDriveRetractions
globle void RetractCheckDriveRetractions( /* GDR 111599 #834 Begin */
void *theEnv,
struct alphaMatch *theAlphaNode,
int position)
{
struct rdriveinfo *tempDR, *theDR, *lastDR = NULL;
theDR = EngineData(theEnv)->DriveRetractionList;
while (theDR != NULL)
{
if ((position < (int) theDR->link->bcount) &&
(theDR->link->binds[position].gm.theMatch == theAlphaNode))
{
tempDR = theDR->next;
rtn_struct(theEnv,rdriveinfo,theDR);
if (lastDR == NULL)
{ EngineData(theEnv)->DriveRetractionList = tempDR; }
else
{ lastDR->next = tempDR; }
theDR = tempDR;
}
else
{
lastDR = theDR;
theDR = theDR->next;
}
}
} /* GDR 111599 #834 End */
示例7: FactJNCompVars1
globle int FactJNCompVars1(
void *theEnv,
void *theValue,
DATA_OBJECT *theResult)
{
int p1, e1, p2, e2;
struct fact *fact1, *fact2;
struct factCompVarsJN1Call *hack;
/*=========================================*/
/* Retrieve the arguments to the function. */
/*=========================================*/
hack = (struct factCompVarsJN1Call *) ValueToBitMap(theValue);
/*=================================================*/
/* Extract the fact pointers for the two patterns. */
/*=================================================*/
p1 = (int) hack->pattern1;
p2 = (int) hack->pattern2;
fact1 = (struct fact *) EngineData(theEnv)->GlobalRHSBinds->binds[p1].gm.theMatch->matchingItem;
if (hack->p2rhs)
{
fact2 = (struct fact *) EngineData(theEnv)->GlobalRHSBinds->binds[p2].gm.theMatch->matchingItem;
}
else
{
fact2 = (struct fact *) EngineData(theEnv)->GlobalLHSBinds->binds[p2].gm.theMatch->matchingItem;
}
/*=====================*/
/* Compare the values. */
/*=====================*/
e1 = (int) hack->slot1;
e2 = (int) hack->slot2;
if (fact1->theProposition.theFields[e1].type !=
fact2->theProposition.theFields[e2].type)
{
return((int) hack->fail);
}
if (fact1->theProposition.theFields[e1].value !=
fact2->theProposition.theFields[e2].value)
{
return((int) hack->fail);
}
return((int) hack->pass);
}
示例8: DeletePartialMatches
static void DeletePartialMatches(
void *theEnv,
struct partialMatch *listOfPMs,
int betaDelete)
{
struct partialMatch *nextPM;
while (listOfPMs != NULL)
{
/*============================================*/
/* Remember the next partial match to delete. */
/*============================================*/
nextPM = listOfPMs->next;
/*================================================*/
/* Remove the links between the partial match and */
/* any data entities that it is attached to as a */
/* result of a logical CE. */
/*================================================*/
#if LOGICAL_DEPENDENCIES
if (listOfPMs->dependentsf) RemoveLogicalSupport(theEnv,listOfPMs);
#endif
/*==========================================================*/
/* If the partial match is being deleted from a beta memory */
/* and the partial match isn't associated with a satisfied */
/* not CE, then it can be immediately returned to the pool */
/* of free memory. Otherwise, it's could be in use (either */
/* to retrieve variables from the LHS or by the activation */
/* of the rule). Since a not CE creates a "pseudo" data */
/* entity, the beta partial match which stores this pseudo */
/* data entity can not be deleted immediately (for the same */
/* reason an alpha memory partial match can't be deleted */
/* immediately). */
/*==========================================================*/
if (betaDelete &&
((listOfPMs->notOriginf == FALSE) || (listOfPMs->counterf)))
{ ReturnPartialMatch(theEnv,listOfPMs); }
else
{
listOfPMs->next = EngineData(theEnv)->GarbagePartialMatches;
EngineData(theEnv)->GarbagePartialMatches = listOfPMs;
}
/*====================================*/
/* Move on to the next partial match. */
/*====================================*/
listOfPMs = nextPM;
}
}
示例9: EnvAddRunFunction
globle intBool EnvAddRunFunction(
void *theEnv,
char *name,
void (*functionPtr)(void *),
int priority)
{
EngineData(theEnv)->ListOfRunFunctions = AddFunctionToCallList(theEnv,name,priority,
functionPtr,
EngineData(theEnv)->ListOfRunFunctions,TRUE);
return(1);
}
示例10: EnvSetIncrementalReset
globle BOOLEAN EnvSetIncrementalReset(
void *theEnv,
int value)
{
int ov;
ov = EngineData(theEnv)->IncrementalResetFlag;
if (EnvGetNextDefrule(theEnv,NULL) != NULL) return(-1);
EngineData(theEnv)->IncrementalResetFlag = value;
return(ov);
}
示例11: InitializeEngine
globle void InitializeEngine(
void *theEnv)
{
AllocateEnvironmentData(theEnv,ENGINE_DATA,sizeof(struct engineData),DeallocateEngineData);
EngineData(theEnv)->IncrementalResetFlag = TRUE;
#if DEBUGGING_FUNCTIONS
AddWatchItem(theEnv,"statistics",0,&EngineData(theEnv)->WatchStatistics,20,NULL,NULL);
AddWatchItem(theEnv,"focus",0,&EngineData(theEnv)->WatchFocus,0,NULL,NULL);
#endif
}
示例12: EnvGetFocusStack
globle void EnvGetFocusStack(
void *theEnv,
DATA_OBJECT_PTR returnValue)
{
struct focus *theFocus;
struct multifield *theList;
unsigned long count = 0;
/*===========================================*/
/* If there is no current focus, then return */
/* a multifield value of length zero. */
/*===========================================*/
if (EngineData(theEnv)->CurrentFocus == NULL)
{
SetpType(returnValue,MULTIFIELD);
SetpDOBegin(returnValue,1);
SetpDOEnd(returnValue,0);
SetpValue(returnValue,(void *) EnvCreateMultifield(theEnv,0L));
return;
}
/*=====================================================*/
/* Determine the number of modules on the focus stack. */
/*=====================================================*/
for (theFocus = EngineData(theEnv)->CurrentFocus; theFocus != NULL; theFocus = theFocus->next)
{ count++; }
/*=============================================*/
/* Create a multifield of the appropriate size */
/* in which to store the module names. */
/*=============================================*/
SetpType(returnValue,MULTIFIELD);
SetpDOBegin(returnValue,1);
SetpDOEnd(returnValue,(long) count);
theList = (struct multifield *) EnvCreateMultifield(theEnv,count);
SetpValue(returnValue,(void *) theList);
/*=================================================*/
/* Store the module names in the multifield value. */
/*=================================================*/
for (theFocus = EngineData(theEnv)->CurrentFocus, count = 1;
theFocus != NULL;
theFocus = theFocus->next, count++)
{
SetMFType(theList,count,SYMBOL);
SetMFValue(theList,count,theFocus->theModule->name);
}
}
示例13: EnvRemoveRunFunction
globle intBool EnvRemoveRunFunction(
void *theEnv,
char *name)
{
int found;
EngineData(theEnv)->ListOfRunFunctions =
RemoveFunctionFromCallList(theEnv,name,EngineData(theEnv)->ListOfRunFunctions,&found);
if (found) return(TRUE);
return(FALSE);
}
示例14: AddRunFunction
globle intBool AddRunFunction(
char *name,
void (*functionPtr)(void),
int priority)
{
void *theEnv;
theEnv = GetCurrentEnvironment();
EngineData(theEnv)->ListOfRunFunctions =
AddFunctionToCallList(theEnv,name,priority,(void (*)(void *)) functionPtr,
EngineData(theEnv)->ListOfRunFunctions,TRUE);
return(1);
}
示例15: ClearDefrulesReady
static bool ClearDefrulesReady(
void *theEnv)
{
if (EngineData(theEnv)->ExecutingRule != NULL) return(false);
if (EngineData(theEnv)->JoinOperationInProgress) return(false);
EnvClearFocusStack(theEnv);
if (EnvGetCurrentModule(theEnv) == NULL) return(false);
DefruleData(theEnv)->CurrentEntityTimeTag = 1L;
return(true);
}