本文整理匯總了C++中EnvGetNextDefmodule函數的典型用法代碼示例。如果您正苦於以下問題:C++ EnvGetNextDefmodule函數的具體用法?C++ EnvGetNextDefmodule怎麽用?C++ EnvGetNextDefmodule使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EnvGetNextDefmodule函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: DefruleRunTimeInitialize
globle void DefruleRunTimeInitialize(
void *theEnv,
struct joinLink *rightPrime,
struct joinLink *leftPrime)
{
struct defmodule *theModule;
struct defrule *theRule, *theDisjunct;
DefruleData(theEnv)->RightPrimeJoins = rightPrime;
DefruleData(theEnv)->LeftPrimeJoins = leftPrime;
SaveCurrentModule(theEnv);
for (theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,NULL);
theModule != NULL;
theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,theModule))
{
EnvSetCurrentModule(theEnv,(void *) theModule);
for (theRule = EnvGetNextDefrule(theEnv,NULL);
theRule != NULL;
theRule = EnvGetNextDefrule(theEnv,theRule))
{
for (theDisjunct = theRule;
theDisjunct != NULL;
theDisjunct = theDisjunct->disjunct)
{ AddBetaMemoriesToRule(theEnv,theDisjunct->lastJoin); }
}
}
RestoreCurrentModule(theEnv);
}
示例2: 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);
}
示例3: BsaveExpressions
static void BsaveExpressions(
void *theEnv,
FILE *fp)
{
struct deffacts *theDeffacts;
struct defmodule *theModule;
/*===========================*/
/* Loop through each module. */
/*===========================*/
for (theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,NULL);
theModule != NULL;
theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,theModule))
{
/*======================================================*/
/* Set the current module to the module being examined. */
/*======================================================*/
EnvSetCurrentModule(theEnv,(void *) theModule);
/*==================================================*/
/* Loop through each deffacts in the current module */
/* and save the assertion list expression. */
/*==================================================*/
for (theDeffacts = (struct deffacts *) EnvGetNextDeffacts(theEnv,NULL);
theDeffacts != NULL;
theDeffacts = (struct deffacts *) EnvGetNextDeffacts(theEnv,theDeffacts))
{ BsaveExpression(theEnv,theDeffacts->assertList,fp); }
}
}
示例4: DeallocateDeffactsData
static void DeallocateDeffactsData(
void *theEnv)
{
#if ! RUN_TIME
struct deffactsModule *theModuleItem;
void *theModule;
#if BLOAD || BLOAD_AND_BSAVE
if (Bloaded(theEnv)) return;
#endif
DoForAllConstructs(theEnv,DestroyDeffactsAction,DeffactsData(theEnv)->DeffactsModuleIndex,FALSE,NULL);
for (theModule = EnvGetNextDefmodule(theEnv,NULL);
theModule != NULL;
theModule = EnvGetNextDefmodule(theEnv,theModule))
{
theModuleItem = (struct deffactsModule *)
GetModuleItem(theEnv,(struct defmodule *) theModule,
DeffactsData(theEnv)->DeffactsModuleIndex);
rtn_struct(theEnv,deffactsModule,theModuleItem);
}
#else
#if MAC_MCW || WIN_MCW || MAC_XCD
#pragma unused(theEnv)
#endif
#endif
}
示例5: DeallocateDefglobalData
static void DeallocateDefglobalData(
void *theEnv)
{
#if ! RUN_TIME
struct defglobalModule *theModuleItem;
void *theModule;
#if BLOAD || BLOAD_AND_BSAVE
if (Bloaded(theEnv)) return;
#endif
DoForAllConstructs(theEnv,DestroyDefglobalAction,DefglobalData(theEnv)->DefglobalModuleIndex,FALSE,NULL);
for (theModule = EnvGetNextDefmodule(theEnv,NULL);
theModule != NULL;
theModule = EnvGetNextDefmodule(theEnv,theModule))
{
theModuleItem = (struct defglobalModule *)
GetModuleItem(theEnv,(struct defmodule *) theModule,
DefglobalData(theEnv)->DefglobalModuleIndex);
rtn_struct(theEnv,defglobalModule,theModuleItem);
}
#else
DoForAllConstructs(theEnv,DestroyDefglobalAction,DefglobalData(theEnv)->DefglobalModuleIndex,FALSE,NULL);
#endif
}
示例6: ValueToString
globle void *CreateDeftemplateScopeMap(
void *theEnv,
struct deftemplate *theDeftemplate)
{
unsigned scopeMapSize;
char *scopeMap;
char *templateName;
struct defmodule *matchModule, *theModule;
int moduleID,count;
void *theBitMap;
templateName = ValueToString(theDeftemplate->header.name);
matchModule = theDeftemplate->header.whichModule->theModule;
scopeMapSize = (sizeof(char) * ((GetNumberOfDefmodules(theEnv) / BITS_PER_BYTE) + 1));
scopeMap = (char *) gm2(theEnv,scopeMapSize);
ClearBitString((void *) scopeMap,scopeMapSize);
SaveCurrentModule(theEnv);
for (theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,NULL) ;
theModule != NULL ;
theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,(void *) theModule))
{
EnvSetCurrentModule(theEnv,(void *) theModule);
moduleID = (int) theModule->bsaveID;
if (FindImportedConstruct(theEnv,"deftemplate",matchModule,
templateName,&count,TRUE,NULL) != NULL)
SetBitMap(scopeMap,moduleID);
}
RestoreCurrentModule(theEnv);
theBitMap = EnvAddBitMap(theEnv,scopeMap,scopeMapSize);
IncrementBitMapCount(theBitMap);
rm(theEnv,(void *) scopeMap,scopeMapSize);
return(theBitMap);
}
示例7: SetIncrementalResetCommand
globle int SetIncrementalResetCommand(
void *theEnv,
EXEC_STATUS)
{
int oldValue;
DATA_OBJECT argPtr;
struct defmodule *theModule;
oldValue = EnvGetIncrementalReset(theEnv,execStatus);
/*============================================*/
/* Check for the correct number of arguments. */
/*============================================*/
if (EnvArgCountCheck(theEnv,execStatus,"set-incremental-reset",EXACTLY,1) == -1)
{ return(oldValue); }
/*=========================================*/
/* The incremental reset behavior can't be */
/* changed when rules are loaded. */
/*=========================================*/
SaveCurrentModule(theEnv,execStatus);
for (theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,execStatus,NULL);
theModule != NULL;
theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,execStatus,theModule))
{
EnvSetCurrentModule(theEnv,execStatus,(void *) theModule);
if (EnvGetNextDefrule(theEnv,execStatus,NULL) != NULL)
{
RestoreCurrentModule(theEnv,execStatus);
PrintErrorID(theEnv,execStatus,"INCRRSET",1,FALSE);
EnvPrintRouter(theEnv,execStatus,WERROR,"The incremental reset behavior cannot be changed with rules loaded.\n");
SetEvaluationError(theEnv,execStatus,TRUE);
return(oldValue);
}
}
RestoreCurrentModule(theEnv,execStatus);
/*==================================================*/
/* The symbol FALSE disables incremental reset. Any */
/* other value enables incremental reset. */
/*==================================================*/
EnvRtnUnknown(theEnv,execStatus,1,&argPtr);
if ((argPtr.value == EnvFalseSymbol(theEnv,execStatus)) && (argPtr.type == SYMBOL))
{ EnvSetIncrementalReset(theEnv,execStatus,FALSE); }
else
{ EnvSetIncrementalReset(theEnv,execStatus,TRUE); }
/*=======================*/
/* Return the old value. */
/*=======================*/
return(oldValue);
}
示例8: EnvSave
globle int EnvSave(
void *theEnv,
EXEC_STATUS,
char *fileName)
{
struct callFunctionItem *saveFunction;
FILE *filePtr;
void *defmodulePtr;
/*=====================*/
/* Open the save file. */
/*=====================*/
if ((filePtr = GenOpen(theEnv,execStatus,fileName,"w")) == NULL)
{ return(FALSE); }
/*===========================*/
/* Bypass the router system. */
/*===========================*/
SetFastSave(theEnv,execStatus,filePtr);
/*======================*/
/* Save the constructs. */
/*======================*/
for (defmodulePtr = EnvGetNextDefmodule(theEnv,execStatus,NULL);
defmodulePtr != NULL;
defmodulePtr = EnvGetNextDefmodule(theEnv,execStatus,defmodulePtr))
{
for (saveFunction = ConstructData(theEnv,execStatus)->ListOfSaveFunctions;
saveFunction != NULL;
saveFunction = saveFunction->next)
{
((* (void (*)(void *,EXEC_STATUS,void *,char *)) saveFunction->func))(theEnv,execStatus,defmodulePtr,(char *) filePtr);
}
}
/*======================*/
/* Close the save file. */
/*======================*/
GenClose(theEnv,execStatus,filePtr);
/*===========================*/
/* Remove the router bypass. */
/*===========================*/
SetFastSave(theEnv,execStatus,NULL);
/*=========================*/
/* Return TRUE to indicate */
/* successful completion. */
/*=========================*/
return(TRUE);
}
示例9: BsaveExpressions
static void BsaveExpressions(
void *theEnv,
FILE *fp)
{
struct defrule *theDefrule, *theDisjunct;
struct defmodule *theModule;
/*===========================*/
/* Loop through each module. */
/*===========================*/
for (theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,NULL);
theModule != NULL;
theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,theModule))
{
/*======================================================*/
/* Set the current module to the module being examined. */
/*======================================================*/
EnvSetCurrentModule(theEnv,(void *) theModule);
/*==================================================*/
/* Loop through each defrule in the current module. */
/*==================================================*/
for (theDefrule = (struct defrule *) EnvGetNextDefrule(theEnv,NULL);
theDefrule != NULL;
theDefrule = (struct defrule *) EnvGetNextDefrule(theEnv,theDefrule))
{
/*===========================================*/
/* Save the dynamic salience of the defrule. */
/*===========================================*/
BsaveExpression(theEnv,theDefrule->dynamicSalience,fp);
/*===================================*/
/* Loop through each disjunct of the */
/* defrule and save its RHS actions. */
/*===================================*/
for (theDisjunct = theDefrule;
theDisjunct != NULL;
theDisjunct = theDisjunct->disjunct)
{ BsaveExpression(theEnv,theDisjunct->actions,fp); }
}
}
/*==============================*/
/* Set the marked flag for each */
/* join in the join network. */
/*==============================*/
MarkRuleNetwork(theEnv,1);
}
示例10: BeforeDefmodulesToCode
static void BeforeDefmodulesToCode(
void *theEnv)
{
int value = 0;
struct defmodule *theModule;
for (theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,NULL);
theModule != NULL;
theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,theModule))
{ theModule->bsaveID = value++; }
}
示例11: BsaveFind
static void BsaveFind(
void *theEnv,
EXEC_STATUS)
{
struct defglobal *defglobalPtr;
struct defmodule *theModule;
/*=======================================================*/
/* If a binary image is already loaded, then temporarily */
/* save the count values since these will be overwritten */
/* in the process of saving the binary image. */
/*=======================================================*/
SaveBloadCount(theEnv,execStatus,DefglobalBinaryData(theEnv,execStatus)->NumberOfDefglobalModules);
SaveBloadCount(theEnv,execStatus,DefglobalBinaryData(theEnv,execStatus)->NumberOfDefglobals);
/*============================================*/
/* Set the count of defglobals and defglobals */
/* module data structures to zero. */
/*============================================*/
DefglobalBinaryData(theEnv,execStatus)->NumberOfDefglobals = 0;
DefglobalBinaryData(theEnv,execStatus)->NumberOfDefglobalModules = 0;
for (theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,execStatus,NULL);
theModule != NULL;
theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,execStatus,theModule))
{
/*================================================*/
/* Set the current module to the module being */
/* examined and increment the number of defglobal */
/* modules encountered. */
/*================================================*/
EnvSetCurrentModule(theEnv,execStatus,(void *) theModule);
DefglobalBinaryData(theEnv,execStatus)->NumberOfDefglobalModules++;
/*====================================================*/
/* Loop through each defglobal in the current module. */
/*====================================================*/
for (defglobalPtr = (struct defglobal *) EnvGetNextDefglobal(theEnv,execStatus,NULL);
defglobalPtr != NULL;
defglobalPtr = (struct defglobal *) EnvGetNextDefglobal(theEnv,execStatus,defglobalPtr))
{
/*======================================================*/
/* Initialize the construct header for the binary save. */
/*======================================================*/
MarkConstructHeaderNeededItems(&defglobalPtr->header,DefglobalBinaryData(theEnv,execStatus)->NumberOfDefglobals++);
}
}
}
示例12: MarkModulesAsUnvisited
globle void MarkModulesAsUnvisited(
void *theEnv,
EXEC_STATUS)
{
struct defmodule *theModule;
DefmoduleData(theEnv,execStatus)->CurrentModule->visitedFlag = FALSE;
for (theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,execStatus,NULL);
theModule != NULL;
theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,execStatus,theModule))
{ theModule->visitedFlag = FALSE; }
}
示例13: DeallocateDefruleData
static void DeallocateDefruleData(
void *theEnv)
{
struct defruleModule *theModuleItem;
void *theModule;
struct activation *theActivation, *tmpActivation;
struct salienceGroup *theGroup, *tmpGroup;
#if BLOAD || BLOAD_AND_BSAVE
if (Bloaded(theEnv))
{ return; }
#endif
DoForAllConstructs(theEnv,DestroyDefruleAction,DefruleData(theEnv)->DefruleModuleIndex,FALSE,NULL);
for (theModule = EnvGetNextDefmodule(theEnv,NULL);
theModule != NULL;
theModule = EnvGetNextDefmodule(theEnv,theModule))
{
theModuleItem = (struct defruleModule *)
GetModuleItem(theEnv,(struct defmodule *) theModule,
DefruleData(theEnv)->DefruleModuleIndex);
theActivation = theModuleItem->agenda;
while (theActivation != NULL)
{
tmpActivation = theActivation->next;
rtn_struct(theEnv,activation,theActivation);
theActivation = tmpActivation;
}
theGroup = theModuleItem->groupings;
while (theGroup != NULL)
{
tmpGroup = theGroup->next;
rtn_struct(theEnv,salienceGroup,theGroup);
theGroup = tmpGroup;
}
#if ! RUN_TIME
rtn_struct(theEnv,defruleModule,theModuleItem);
#endif
}
rm3(theEnv,DefruleData(theEnv)->AlphaMemoryTable,sizeof (ALPHA_MEMORY_HASH *) * ALPHA_MEMORY_HASH_SIZE);
}
示例14: BsaveFind
static void BsaveFind(
void *theEnv,
EXEC_STATUS)
{
struct deftemplate *theDeftemplate;
struct defmodule *theModule;
/*=======================================================*/
/* If a binary image is already loaded, then temporarily */
/* save the count values since these will be overwritten */
/* in the process of saving the binary image. */
/*=======================================================*/
SaveBloadCount(theEnv,execStatus,FactBinaryData(theEnv,execStatus)->NumberOfPatterns);
/*=======================================*/
/* Set the count of fact pattern network */
/* data structures to zero. */
/*=======================================*/
FactBinaryData(theEnv,execStatus)->NumberOfPatterns = 0L;
/*===========================*/
/* Loop through each module. */
/*===========================*/
for (theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,execStatus,NULL);
theModule != NULL;
theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,execStatus,theModule))
{
/*===============================*/
/* Set the current module to the */
/* module being examined. */
/*===============================*/
EnvSetCurrentModule(theEnv,execStatus,(void *) theModule);
/*=====================================================*/
/* Loop through each deftemplate in the current module */
/* and count the number of data structures which must */
/* be saved for its pattern network. */
/*=====================================================*/
for (theDeftemplate = (struct deftemplate *) EnvGetNextDeftemplate(theEnv,execStatus,NULL);
theDeftemplate != NULL;
theDeftemplate = (struct deftemplate *) EnvGetNextDeftemplate(theEnv,execStatus,theDeftemplate))
{ BsaveDriver(theEnv,execStatus,BSAVE_FIND,NULL,theDeftemplate->patternNetwork); }
}
}
示例15: DoForAllModules
globle long DoForAllModules(
void *theEnv,
EXEC_STATUS,
void (*actionFunction)(struct defmodule *,void *),
int interruptable,
void *userBuffer)
{
void *theModule;
long moduleCount = 0L;
/*==========================*/
/* Save the current module. */
/*==========================*/
SaveCurrentModule(theEnv,execStatus);
/*==================================*/
/* Loop through all of the modules. */
/*==================================*/
for (theModule = EnvGetNextDefmodule(theEnv,execStatus,NULL);
theModule != NULL;
theModule = EnvGetNextDefmodule(theEnv,execStatus,theModule), moduleCount++)
{
EnvSetCurrentModule(theEnv,execStatus,(void *) theModule);
if ((interruptable) && GetHaltExecution(theEnv,execStatus))
{
RestoreCurrentModule(theEnv,execStatus);
return(-1L);
}
(*actionFunction)((struct defmodule *) theModule,userBuffer);
}
/*=============================*/
/* Restore the current module. */
/*=============================*/
RestoreCurrentModule(theEnv,execStatus);
/*=========================================*/
/* Return the number of modules traversed. */
/*=========================================*/
return(moduleCount);
}