当前位置: 首页>>代码示例>>C++>>正文


C++ EngineData函数代码示例

本文整理汇总了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);
  }
开发者ID:femto,项目名称:rbclips,代码行数:7,代码来源:engine.c

示例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);
  }
开发者ID:chrislong,项目名称:clipsrules,代码行数:32,代码来源:drive.c

示例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);
  }
开发者ID:bitcababy,项目名称:ObjectiveCLIPS,代码行数:60,代码来源:lgcldpnd.c

示例4: EnvClearFocusStack

globle void EnvClearFocusStack(
  void *theEnv)
  {
   while (EngineData(theEnv)->CurrentFocus != NULL) EnvPopFocus(theEnv);

   EngineData(theEnv)->FocusChanged = TRUE;
  }
开发者ID:femto,项目名称:rbclips,代码行数:7,代码来源:engine.c

示例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);
  }
开发者ID:Anusaaraka,项目名称:anusaaraka,代码行数:27,代码来源:incrrset.c

示例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 */
开发者ID:jonathangizmo,项目名称:pyclips,代码行数:28,代码来源:retract.c

示例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);
}
开发者ID:DrItanium,项目名称:durandal,代码行数:54,代码来源:factrete.c

示例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;
     }
  }
开发者ID:jonathangizmo,项目名称:pyclips,代码行数:54,代码来源:retract.c

示例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);
  }
开发者ID:femto,项目名称:rbclips,代码行数:11,代码来源:engine.c

示例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);
  }
开发者ID:aliverobotics,项目名称:Pumas-SmallSize,代码行数:11,代码来源:incrrset.cpp

示例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
  }
开发者ID:femto,项目名称:rbclips,代码行数:12,代码来源:engine.c

示例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);
     }
  }
开发者ID:femto,项目名称:rbclips,代码行数:52,代码来源:engine.c

示例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);
  }
开发者ID:femto,项目名称:rbclips,代码行数:13,代码来源:engine.c

示例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);
  }
开发者ID:femto,项目名称:rbclips,代码行数:14,代码来源:engine.c

示例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);
  }
开发者ID:guitarpoet,项目名称:php-clips,代码行数:14,代码来源:rulebsc.c


注:本文中的EngineData函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。