本文整理汇总了C++中ValueToBitMap函数的典型用法代码示例。如果您正苦于以下问题:C++ ValueToBitMap函数的具体用法?C++ ValueToBitMap怎么用?C++ ValueToBitMap使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ValueToBitMap函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrintFactPNConstant1
globle void PrintFactPNConstant1(
void *theEnv,
const char *logicalName,
void *theValue)
{
#if DEVELOPER
struct factConstantPN1Call *hack;
hack = (struct factConstantPN1Call *) ValueToBitMap(theValue);
EnvPrintRouter(theEnv,logicalName,"(fact-pn-constant1 ");
PrintLongInteger(theEnv,logicalName,(long long) hack->whichSlot);
if (hack->testForEquality) EnvPrintRouter(theEnv,logicalName," = ");
else EnvPrintRouter(theEnv,logicalName," != ");
PrintAtom(theEnv,logicalName,GetFirstArgument()->type,GetFirstArgument()->value);
EnvPrintRouter(theEnv,logicalName,")");
#else
#if MAC_XCD
#pragma unused(theEnv)
#pragma unused(logicalName)
#pragma unused(theValue)
#endif
#endif
}
示例2: PrintJNSimpleCompareFunction2
static void PrintJNSimpleCompareFunction2(
void *theEnv,
char *logicalName,
void *theValue)
{
#if DEVELOPER
struct ObjectCmpJoinSingleSlotVars2 *hack;
hack = (struct ObjectCmpJoinSingleSlotVars2 *) ValueToBitMap(theValue);
EnvPrintRouter(theEnv,logicalName,"(jslot-cmp2 ");
EnvPrintRouter(theEnv,logicalName,hack->pass ? "p " : "n ");
PrintLongInteger(theEnv,logicalName,(long) hack->firstPattern);
EnvPrintRouter(theEnv,logicalName," ");
EnvPrintRouter(theEnv,logicalName,ValueToString(FindIDSlotName(theEnv,(unsigned) hack->firstSlot)));
EnvPrintRouter(theEnv,logicalName,hack->fromBeginning ? " B" : " E");
PrintLongInteger(theEnv,logicalName,(long) hack->offset);
EnvPrintRouter(theEnv,logicalName," ");
PrintLongInteger(theEnv,logicalName,(long) hack->secondPattern);
EnvPrintRouter(theEnv,logicalName," ");
EnvPrintRouter(theEnv,logicalName,ValueToString(FindIDSlotName(theEnv,(unsigned) hack->secondSlot)));
EnvPrintRouter(theEnv,logicalName,")");
#else
#if MAC_MCW || IBM_MCW || MAC_XCD
#pragma unused(theEnv)
#pragma unused(logicalName)
#pragma unused(theValue)
#endif
#endif
}
示例3: FactPNGetVar2
globle BOOLEAN FactPNGetVar2(
void *theValue,
DATA_OBJECT_PTR returnValue)
{
struct fact *factPtr;
struct factGetVarPN2Call *hack;
struct field *fieldPtr;
/*==========================================*/
/* Retrieve the arguments for the function. */
/*==========================================*/
hack = (struct factGetVarPN2Call *) ValueToBitMap(theValue);
/*==============================*/
/* Get the pointer to the fact. */
/*==============================*/
factPtr = CurrentPatternFact;
/*============================================*/
/* Extract the value from the specified slot. */
/*============================================*/
fieldPtr = &factPtr->theProposition.theFields[hack->whichSlot];
returnValue->type = fieldPtr->type;
returnValue->value = fieldPtr->value;
return(TRUE);
}
示例4: PrintFactPNGetVar3
globle void PrintFactPNGetVar3(
void *theEnv,
char *logicalName,
void *theValue)
{
#if DEVELOPER
struct factGetVarPN3Call *hack;
hack = (struct factGetVarPN3Call *) ValueToBitMap(theValue);
EnvPrintRouter(theEnv,logicalName,(char*)"(fact-pn-getvar-3 ");
if (hack->fromBeginning) EnvPrintRouter(theEnv,logicalName,(char*)"t ");
else EnvPrintRouter(theEnv,logicalName,(char*)"f ");
if (hack->fromEnd) EnvPrintRouter(theEnv,logicalName,(char*)"t B");
else EnvPrintRouter(theEnv,logicalName,(char*)"f B");
PrintLongInteger(theEnv,logicalName,(long long) hack->beginOffset);
EnvPrintRouter(theEnv,logicalName,(char*)" E");
PrintLongInteger(theEnv,logicalName,(long long) hack->endOffset);
EnvPrintRouter(theEnv,logicalName,(char*)" S");
PrintLongInteger(theEnv,logicalName,(long long) hack->whichSlot);
EnvPrintRouter(theEnv,logicalName,(char*)")");
#else
#endif
}
示例5: PrintFactPNConstant2
globle void PrintFactPNConstant2(
void *theEnv,
char *logicalName,
void *theValue)
{
#if DEVELOPER
struct factConstantPN2Call *hack;
hack = (struct factConstantPN2Call *) ValueToBitMap(theValue);
EnvPrintRouter(theEnv,logicalName,(char*)"(fact-pn-constant2 ");
PrintLongInteger(theEnv,logicalName,(long long) hack->whichSlot);
EnvPrintRouter(theEnv,logicalName,(char*)" ");
PrintLongInteger(theEnv,logicalName,(long long) hack->offset);
if (hack->testForEquality) EnvPrintRouter(theEnv,logicalName,(char*)" = ");
else EnvPrintRouter(theEnv,logicalName,(char*)" != ");
PrintAtom(theEnv,logicalName,GetFirstArgument()->type,GetFirstArgument()->value);
EnvPrintRouter(theEnv,logicalName,(char*)")");
#else
#endif
}
示例6: PrintFactJNGetVar1
globle void PrintFactJNGetVar1(
void *theEnv,
char *logicalName,
void *theValue)
{
#if DEVELOPER
struct factGetVarJN1Call *hack;
hack = (struct factGetVarJN1Call *) ValueToBitMap(theValue);
EnvPrintRouter(theEnv,logicalName,(char*)"(fact-jn-getvar-1 ");
if (hack->factAddress) EnvPrintRouter(theEnv,logicalName,(char*)"t ");
else EnvPrintRouter(theEnv,logicalName,(char*)"f ");
if (hack->allFields) EnvPrintRouter(theEnv,logicalName,(char*)"t ");
else EnvPrintRouter(theEnv,logicalName,(char*)"f ");
EnvPrintRouter(theEnv,logicalName,(char*)"p");
PrintLongInteger(theEnv,logicalName,(long long) hack->whichPattern + 1);
EnvPrintRouter(theEnv,logicalName,(char*)" ");
PrintLongInteger(theEnv,logicalName,(long long) hack->whichField);
EnvPrintRouter(theEnv,logicalName,(char*)" s");
PrintLongInteger(theEnv,logicalName,(long long) hack->whichSlot);
if (hack->lhs)
{ EnvPrintRouter(theEnv,logicalName,(char*)" L"); }
else if (hack->rhs)
{ EnvPrintRouter(theEnv,logicalName,(char*)" R"); }
EnvPrintRouter(theEnv,logicalName,(char*)")");
#else
#endif
}
示例7: PrintFactJNGetVar3
globle void PrintFactJNGetVar3(
void *theEnv,
char *logicalName,
void *theValue)
{
#if DEVELOPER
struct factGetVarJN3Call *hack;
hack = (struct factGetVarJN3Call *) ValueToBitMap(theValue);
EnvPrintRouter(theEnv,logicalName,(char*)"(fact-jn-getvar-3 ");
if (hack->fromBeginning) EnvPrintRouter(theEnv,logicalName,(char*)"t ");
else EnvPrintRouter(theEnv,logicalName,(char*)"f ");
if (hack->fromEnd) EnvPrintRouter(theEnv,logicalName,(char*)"t ");
else EnvPrintRouter(theEnv,logicalName,(char*)"f ");
PrintLongInteger(theEnv,logicalName,(long long) hack->beginOffset);
EnvPrintRouter(theEnv,logicalName,(char*)" ");
PrintLongInteger(theEnv,logicalName,(long long) hack->endOffset);
EnvPrintRouter(theEnv,logicalName,(char*)" ");
PrintLongInteger(theEnv,logicalName,(long long) hack->whichSlot);
EnvPrintRouter(theEnv,logicalName,(char*)" p");
PrintLongInteger(theEnv,logicalName,(long long) hack->whichPattern + 1);
if (hack->lhs)
{ EnvPrintRouter(theEnv,logicalName,(char*)" L"); }
else if (hack->rhs)
{ EnvPrintRouter(theEnv,logicalName,(char*)" R"); }
EnvPrintRouter(theEnv,logicalName,(char*)")");
#else
#endif
}
示例8: FactPNGetVar3
globle intBool FactPNGetVar3(
void *theEnv,
void *theValue,
DATA_OBJECT_PTR returnValue)
{
struct fact *factPtr;
struct multifield *segmentPtr;
struct field *fieldPtr;
struct factGetVarPN3Call *hack;
/*==========================================*/
/* Retrieve the arguments for the function. */
/*==========================================*/
hack = (struct factGetVarPN3Call *) ValueToBitMap(theValue);
/*==============================*/
/* Get the pointer to the fact. */
/*==============================*/
factPtr = FactData(theEnv)->CurrentPatternFact;
/*============================================================*/
/* Get the multifield value from which the data is retrieved. */
/*============================================================*/
segmentPtr = (struct multifield *) factPtr->theProposition.theFields[hack->whichSlot].value;
/*=========================================*/
/* If the beginning and end flags are set, */
/* then retrieve a multifield value. */
/*=========================================*/
if (hack->fromBeginning && hack->fromEnd)
{
returnValue->type = MULTIFIELD;
returnValue->value = (void *) segmentPtr;
returnValue->begin = (long) hack->beginOffset;
returnValue->end = (long) (segmentPtr->multifieldLength - (hack->endOffset + 1));
return(TRUE);
}
/*=====================================================*/
/* Return a single field value from a multifield slot. */
/*=====================================================*/
if (hack->fromBeginning)
{
fieldPtr = &segmentPtr->theFields[hack->beginOffset];
}
else
{
fieldPtr = &segmentPtr->theFields[segmentPtr->multifieldLength - (hack->endOffset + 1)];
}
returnValue->type = fieldPtr->type;
returnValue->value = fieldPtr->value;
return(TRUE);
}
示例9: PrintFactPNConstant2
globle void PrintFactPNConstant2(
char *logicalName,
void *theValue)
{
#if DEVELOPER
struct factConstantPN2Call *hack;
hack = (struct factConstantPN2Call *) ValueToBitMap(theValue);
PrintRouter(logicalName,"(fact-pn-constant2 ");
PrintLongInteger(logicalName,(long) hack->whichSlot);
PrintRouter(logicalName," ");
PrintLongInteger(logicalName,(long) hack->offset);
if (hack->testForEquality) PrintRouter(logicalName," = ");
else PrintRouter(logicalName," != ");
PrintAtom(logicalName,GetFirstArgument()->type,GetFirstArgument()->value);
PrintRouter(logicalName,")");
#else
#if MAC_MPW || MAC_MCW
#pragma unused(logicalName)
#pragma unused(theValue)
#endif
#endif
}
示例10: PrintFactPNGetVar3
globle void PrintFactPNGetVar3(
char *logicalName,
void *theValue)
{
#if DEVELOPER
struct factGetVarPN3Call *hack;
hack = (struct factGetVarPN3Call *) ValueToBitMap(theValue);
PrintRouter(logicalName,"(fact-pn-getvar-3 ");
if (hack->fromBeginning) PrintRouter(logicalName,"t ");
else PrintRouter(logicalName,"f ");
if (hack->fromEnd) PrintRouter(logicalName,"t B");
else PrintRouter(logicalName,"f B");
PrintLongInteger(logicalName,(long) hack->beginOffset);
PrintRouter(logicalName," E");
PrintLongInteger(logicalName,(long) hack->endOffset);
PrintRouter(logicalName," S");
PrintLongInteger(logicalName,(long) hack->whichSlot);
PrintRouter(logicalName,")");
#else
#if MAC_MPW || MAC_MCW
#pragma unused(logicalName)
#pragma unused(theValue)
#endif
#endif
}
示例11: PrintObjectGetVarJN2
static void PrintObjectGetVarJN2(
void *theEnv,
char *logicalName,
void *theValue)
{
#if DEVELOPER
struct ObjectMatchVar2 *hack;
hack = (struct ObjectMatchVar2 *) ValueToBitMap(theValue);
EnvPrintRouter(theEnv,logicalName,"(obj-slot-quick-var ");
PrintLongInteger(theEnv,logicalName,(long) hack->whichPattern);
EnvPrintRouter(theEnv,logicalName," ");
EnvPrintRouter(theEnv,logicalName,ValueToString(FindIDSlotName(theEnv,(unsigned) hack->whichSlot)));
if (hack->fromBeginning)
{
EnvPrintRouter(theEnv,logicalName," B");
PrintLongInteger(theEnv,logicalName,(long) (hack->beginningOffset + 1));
}
if (hack->fromEnd)
{
EnvPrintRouter(theEnv,logicalName," E");
PrintLongInteger(theEnv,logicalName,(long) (hack->endOffset + 1));
}
EnvPrintRouter(theEnv,logicalName,")");
#else
#if MAC_MCW || IBM_MCW || MAC_XCD
#pragma unused(theEnv)
#pragma unused(logicalName)
#pragma unused(theValue)
#endif
#endif
}
示例12: JNSimpleCompareFunction2
static CLIPS_BOOLEAN JNSimpleCompareFunction2(
void *theEnv,
void *theValue,
DATA_OBJECT *theResult)
{
INSTANCE_TYPE *ins1,*ins2;
struct multifieldMarker *theMarks;
struct ObjectCmpJoinSingleSlotVars2 *hack;
int rv;
FIELD f1;
INSTANCE_SLOT *is2;
hack = (struct ObjectCmpJoinSingleSlotVars2 *) ValueToBitMap(theValue);
GetPatternObjectAndMarks(theEnv,((int) hack->firstPattern) - 1,&ins1,&theMarks);
GetInsMultiSlotField(&f1,ins1,(unsigned) hack->firstSlot,
(unsigned) hack->fromBeginning,(unsigned) hack->offset);
GetPatternObjectAndMarks(theEnv,((int) hack->secondPattern) - 1,&ins2,&theMarks);
is2 = GetInsSlot(ins2,hack->secondSlot);
if (f1.type != is2->type)
rv = hack->fail;
else if (f1.value != is2->value)
rv = hack->fail;
else
rv = hack->pass;
theResult->type = SYMBOL;
theResult->value = rv ? EnvTrueSymbol(theEnv) : EnvFalseSymbol(theEnv);
return(rv);
}
示例13: PrintFactSlotLength
globle void PrintFactSlotLength(
void *theEnv,
const char *logicalName,
void *theValue)
{
#if DEVELOPER
struct factCheckLengthPNCall *hack;
hack = (struct factCheckLengthPNCall *) ValueToBitMap(theValue);
EnvPrintRouter(theEnv,logicalName,"(slot-length ");
PrintLongInteger(theEnv,logicalName,(long long) hack->whichSlot);
EnvPrintRouter(theEnv,logicalName," ");
if (hack->exactly) EnvPrintRouter(theEnv,logicalName,"= ");
else EnvPrintRouter(theEnv,logicalName,">= ");
PrintLongInteger(theEnv,logicalName,(long long) hack->minLength);
EnvPrintRouter(theEnv,logicalName,")");
#else
#if MAC_XCD
#pragma unused(theEnv)
#pragma unused(logicalName)
#pragma unused(theValue)
#endif
#endif
}
示例14: FactPNConstant1
globle intBool FactPNConstant1(
void *theEnv,
void *theValue,
DATA_OBJECT_PTR returnValue)
{
#if MAC_MCW || WIN_MCW || MAC_XCD
#pragma unused(returnValue)
#endif
struct factConstantPN1Call *hack;
struct field *fieldPtr;
struct expr *theConstant;
/*==========================================*/
/* Retrieve the arguments for the function. */
/*==========================================*/
hack = (struct factConstantPN1Call *) ValueToBitMap(theValue);
/*============================================*/
/* Extract the value from the specified slot. */
/*============================================*/
fieldPtr = &FactData(theEnv)->CurrentPatternFact->theProposition.theFields[hack->whichSlot];
/*====================================*/
/* Compare the value to the constant. */
/*====================================*/
theConstant = GetFirstArgument();
if (theConstant->type != fieldPtr->type) return(1 - hack->testForEquality);
if (theConstant->value != fieldPtr->value) return(1 - hack->testForEquality);
return(hack->testForEquality);
}
示例15: FactSlotLength
globle intBool FactSlotLength(
void *theEnv,
void *theValue,
DATA_OBJECT_PTR returnValue)
{
struct factCheckLengthPNCall *hack;
struct multifield *segmentPtr;
long extraOffset = 0;
struct multifieldMarker *tempMark;
returnValue->type = SYMBOL;
returnValue->value = EnvFalseSymbol(theEnv);
hack = (struct factCheckLengthPNCall *) ValueToBitMap(theValue);
for (tempMark = FactData(theEnv)->CurrentPatternMarks;
tempMark != NULL;
tempMark = tempMark->next)
{
if (tempMark->where.whichSlotNumber != hack->whichSlot) continue;
extraOffset += ((tempMark->endPosition - tempMark->startPosition) + 1);
}
segmentPtr = (struct multifield *) FactData(theEnv)->CurrentPatternFact->theProposition.theFields[hack->whichSlot].value;
if (segmentPtr->multifieldLength < (hack->minLength + extraOffset))
{ return(FALSE); }
if (hack->exactly && (segmentPtr->multifieldLength > (hack->minLength + extraOffset)))
{ return(FALSE); }
returnValue->value = EnvTrueSymbol(theEnv);
return(TRUE);
}