本文整理匯總了C++中DefclassData函數的典型用法代碼示例。如果您正苦於以下問題:C++ DefclassData函數的具體用法?C++ DefclassData怎麽用?C++ DefclassData使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DefclassData函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: PutClassInTable
/*******************************************************
NAME : PutClassInTable
DESCRIPTION : Inserts a class in the class hash table
INPUTS : The class
RETURNS : Nothing useful
SIDE EFFECTS : Class inserted
NOTES : None
*******************************************************/
globle void PutClassInTable(
void *theEnv,
DEFCLASS *cls)
{
cls->hashTableIndex = HashClass(GetDefclassNamePointer((void *) cls));
cls->nxtHash = DefclassData(theEnv)->ClassTable[cls->hashTableIndex];
DefclassData(theEnv)->ClassTable[cls->hashTableIndex] = cls;
}
示例2: EnvSetClassDefaultsMode
globle unsigned short EnvSetClassDefaultsMode(
void *theEnv,
unsigned short value)
{
unsigned short ov;
ov = DefclassData(theEnv)->ClassDefaultsMode;
DefclassData(theEnv)->ClassDefaultsMode = value;
return(ov);
}
示例3: EnvSetClassDefaultsMode
globle unsigned short EnvSetClassDefaultsMode(
void *theEnv,
EXEC_STATUS,
unsigned short value)
{
unsigned short ov;
ov = DefclassData(theEnv,execStatus)->ClassDefaultsMode;
DefclassData(theEnv,execStatus)->ClassDefaultsMode = value;
return(ov);
}
示例4: AddWatchItem
/***********************************************************************
NAME : DefclassWatchPrint
DESCRIPTION : Parses a list of class names passed by
AddWatchItem() and displays the traces accordingly
INPUTS : 1) The logical name of the output
2) A code indicating which trace flag is to be examined
0 - Watch instance creation/deletion
1 - Watch slot changes to instances
3) A list of expressions containing the names
of the classes for which to examine traces
RETURNS : TRUE if all OK, FALSE otherwise
SIDE EFFECTS : Watch flags displayed for specified classes
NOTES : Accessory function for AddWatchItem()
***********************************************************************/
globle unsigned DefclassWatchPrint(
void *theEnv,
const char *logName,
int code,
EXPRESSION *argExprs)
{
if (code)
return(ConstructPrintWatchAccess(theEnv,DefclassData(theEnv)->DefclassConstruct,logName,argExprs,
EnvGetDefclassWatchSlots,EnvSetDefclassWatchSlots));
else
return(ConstructPrintWatchAccess(theEnv,DefclassData(theEnv)->DefclassConstruct,logName,argExprs,
EnvGetDefclassWatchInstances,EnvSetDefclassWatchInstances));
}
示例5: InitializeClasses
/***************************************************
NAME : InitializeClasses
DESCRIPTION : Allocates class hash table
Initializes class hash table
to all NULL addresses
Creates system classes
INPUTS : None
RETURNS : Nothing useful
SIDE EFFECTS : Hash table initialized
NOTES : None
***************************************************/
globle void InitializeClasses(
void *theEnv)
{
register int i;
DefclassData(theEnv)->ClassTable =
(DEFCLASS **) gm2(theEnv,(int) (sizeof(DEFCLASS *) * CLASS_TABLE_HASH_SIZE));
for (i = 0 ; i < CLASS_TABLE_HASH_SIZE ; i++)
DefclassData(theEnv)->ClassTable[i] = NULL;
DefclassData(theEnv)->SlotNameTable =
(SLOT_NAME **) gm2(theEnv,(int) (sizeof(SLOT_NAME *) * SLOT_NAME_TABLE_HASH_SIZE));
for (i = 0 ; i < SLOT_NAME_TABLE_HASH_SIZE ; i++)
DefclassData(theEnv)->SlotNameTable[i] = NULL;
}
示例6: GetDefclassListFunction
/*********************************************************
NAME : GetDefclassListFunction
DESCRIPTION : Groups names of all defclasses into
a multifield variable
INPUTS : A data object buffer
RETURNS : Nothing useful
SIDE EFFECTS : Multifield set to list of classes
NOTES : None
*********************************************************/
globle void GetDefclassListFunction(
void *theEnv,
EXEC_STATUS,
DATA_OBJECT_PTR returnValue)
{
GetConstructListFunction(theEnv,execStatus,"get-defclass-list",returnValue,DefclassData(theEnv,execStatus)->DefclassConstruct);
}
示例7: UpdateDefclassesScope
/***************************************************
NAME : UpdateDefclassesScope
DESCRIPTION : This function updates the scope
bitmaps for existing classes when
a new module is defined
INPUTS : None
RETURNS : Nothing
SIDE EFFECTS : Class scope bitmaps are updated
NOTES : None
***************************************************/
static void UpdateDefclassesScope(
void *theEnv)
{
register unsigned i;
DEFCLASS *theDefclass;
int newModuleID,count;
char *newScopeMap;
unsigned newScopeMapSize;
char *className;
struct defmodule *matchModule;
newModuleID = (int) ((struct defmodule *) EnvGetCurrentModule(theEnv))->bsaveID;
newScopeMapSize = (sizeof(char) * ((GetNumberOfDefmodules(theEnv) / BITS_PER_BYTE) + 1));
newScopeMap = (char *) gm2(theEnv,newScopeMapSize);
for (i = 0 ; i < CLASS_TABLE_HASH_SIZE ; i++)
for (theDefclass = DefclassData(theEnv)->ClassTable[i] ;
theDefclass != NULL ;
theDefclass = theDefclass->nxtHash)
{
matchModule = theDefclass->header.whichModule->theModule;
className = ValueToString(theDefclass->header.name);
ClearBitString((void *) newScopeMap,newScopeMapSize);
GenCopyMemory(char,theDefclass->scopeMap->size,
newScopeMap,ValueToBitMap(theDefclass->scopeMap));
DecrementBitMapCount(theEnv,theDefclass->scopeMap);
if (theDefclass->system)
SetBitMap(newScopeMap,newModuleID);
else if (FindImportedConstruct(theEnv,(char*)"defclass",matchModule,
className,&count,TRUE,NULL) != NULL)
SetBitMap(newScopeMap,newModuleID);
theDefclass->scopeMap = (BITMAP_HN *) EnvAddBitMap(theEnv,(void *) newScopeMap,newScopeMapSize);
IncrementBitMapCount(theDefclass->scopeMap);
}
rm(theEnv,(void *) newScopeMap,newScopeMapSize);
}
示例8: unused
static EXPRESSION *GenTypeExpression(
void *theEnv,
EXPRESSION *top,
int nonCOOLCode,
int primitiveCode,
char *COOLName)
{
#if OBJECT_SYSTEM
#if MAC_MCW || IBM_MCW
#pragma unused(nonCOOLCode)
#endif
#endif
EXPRESSION *tmp;
#if OBJECT_SYSTEM
if (primitiveCode != -1)
tmp = GenConstant(theEnv,0,(void *) DefclassData(theEnv)->PrimitiveClassMap[primitiveCode]);
else
tmp = GenConstant(theEnv,0,(void *) LookupDefclassByMdlOrScope(theEnv,COOLName));
#else
tmp = GenConstant(theEnv,0,EnvAddLong(theEnv,(long) nonCOOLCode));
#endif
tmp->nextArg = top;
return(tmp);
}
示例9: class
/*******************************************************************
NAME : EnvFindDefclass
DESCRIPTION : Looks up a specified class in the class hash table
(Only looks in current or specified module)
INPUTS : The name-string of the class (including module)
RETURNS : The address of the found class, NULL otherwise
SIDE EFFECTS : None
NOTES : None
******************************************************************/
globle void *EnvFindDefclass( // TBD Needs to look in imported
void *theEnv,
const char *classAndModuleName)
{
SYMBOL_HN *classSymbol = NULL;
DEFCLASS *cls;
struct defmodule *theModule = NULL;
const char *className;
SaveCurrentModule(theEnv);
className = ExtractModuleAndConstructName(theEnv,classAndModuleName);
if (className != NULL)
{
classSymbol = FindSymbolHN(theEnv,ExtractModuleAndConstructName(theEnv,classAndModuleName));
theModule = ((struct defmodule *) EnvGetCurrentModule(theEnv));
}
RestoreCurrentModule(theEnv);
if (classSymbol == NULL)
return(NULL);
cls = DefclassData(theEnv)->ClassTable[HashClass(classSymbol)];
while (cls != NULL)
{
if (cls->header.name == classSymbol)
{
if (cls->system || (cls->header.whichModule->theModule == theModule))
return(cls->installed ? (void *) cls : NULL);
}
cls = cls->nxtHash;
}
return(NULL);
}
示例10: FindInstanceBySymbol
/***************************************************
NAME : DetermineRestrictionClass
DESCRIPTION : Finds the class of an argument in
the ProcParamArray
INPUTS : The argument data object
RETURNS : The class address, NULL if error
SIDE EFFECTS : EvaluationError set on errors
NOTES : None
***************************************************/
static Defclass *DetermineRestrictionClass(
Environment *theEnv,
UDFValue *dobj)
{
Instance *ins;
Defclass *cls;
if (dobj->header->type == INSTANCE_NAME_TYPE)
{
ins = FindInstanceBySymbol(theEnv,dobj->lexemeValue);
cls = (ins != NULL) ? ins->cls : NULL;
}
else if (dobj->header->type == INSTANCE_ADDRESS_TYPE)
{
ins = dobj->instanceValue;
cls = (ins->garbage == 0) ? ins->cls : NULL;
}
else
return(DefclassData(theEnv)->PrimitiveClassMap[dobj->header->type]);
if (cls == NULL)
{
SetEvaluationError(theEnv,true);
PrintErrorID(theEnv,"GENRCEXE",3,false);
WriteString(theEnv,STDERR,"Unable to determine class of ");
WriteUDFValue(theEnv,STDERR,dobj);
WriteString(theEnv,STDERR," in generic function '");
WriteString(theEnv,STDERR,DefgenericName(DefgenericData(theEnv)->CurrentGeneric));
WriteString(theEnv,STDERR,"'.\n");
}
return(cls);
}
示例11: anywhere
/***************************************************
NAME : LookupDefclassByMdlOrScope
DESCRIPTION : Finds a class anywhere (if module
is specified) or in current or
imported modules
INPUTS : The class name
RETURNS : The class (NULL if not found)
SIDE EFFECTS : Error message printed on
ambiguous references
NOTES : Assumes no two classes of the same
name are ever in the same scope
***************************************************/
globle DEFCLASS *LookupDefclassByMdlOrScope(
void *theEnv,
const char *classAndModuleName)
{
DEFCLASS *cls;
const char *className;
SYMBOL_HN *classSymbol;
struct defmodule *theModule;
if (FindModuleSeparator(classAndModuleName) == FALSE)
return(LookupDefclassInScope(theEnv,classAndModuleName));
SaveCurrentModule(theEnv);
className = ExtractModuleAndConstructName(theEnv,classAndModuleName);
theModule = ((struct defmodule *) EnvGetCurrentModule(theEnv));
RestoreCurrentModule(theEnv);
if(className == NULL)
return(NULL);
if ((classSymbol = FindSymbolHN(theEnv,className)) == NULL)
return(NULL);
cls = DefclassData(theEnv)->ClassTable[HashClass(classSymbol)];
while (cls != NULL)
{
if ((cls->header.name == classSymbol) &&
(cls->header.whichModule->theModule == theModule))
return(cls->installed ? cls : NULL);
cls = cls->nxtHash;
}
return(NULL);
}
示例12: FindInstanceBySymbol
/***************************************************
NAME : DetermineRestrictionClass
DESCRIPTION : Finds the class of an argument in
the ProcParamArray
INPUTS : The argument data object
RETURNS : The class address, NULL if error
SIDE EFFECTS : EvaluationError set on errors
NOTES : None
***************************************************/
static DEFCLASS *DetermineRestrictionClass(
void *theEnv,
DATA_OBJECT *dobj)
{
INSTANCE_TYPE *ins;
DEFCLASS *cls;
if (dobj->type == INSTANCE_NAME)
{
ins = FindInstanceBySymbol(theEnv,(SYMBOL_HN *) dobj->value);
cls = (ins != NULL) ? ins->cls : NULL;
}
else if (dobj->type == INSTANCE_ADDRESS)
{
ins = (INSTANCE_TYPE *) dobj->value;
cls = (ins->garbage == 0) ? ins->cls : NULL;
}
else
return(DefclassData(theEnv)->PrimitiveClassMap[dobj->type]);
if (cls == NULL)
{
EnvSetEvaluationError(theEnv,true);
PrintErrorID(theEnv,"GENRCEXE",3,false);
EnvPrintRouter(theEnv,WERROR,"Unable to determine class of ");
PrintDataObject(theEnv,WERROR,dobj);
EnvPrintRouter(theEnv,WERROR," in generic function ");
EnvPrintRouter(theEnv,WERROR,EnvGetDefgenericName(theEnv,(void *) DefgenericData(theEnv)->CurrentGeneric));
EnvPrintRouter(theEnv,WERROR,".\n");
}
return(cls);
}
示例13: GetDefclassModuleCommand
/************************************************************
NAME : GetDefclassModuleCommand
DESCRIPTION : Determines to which module a class belongs
INPUTS : None
RETURNS : The symbolic name of the module
SIDE EFFECTS : None
NOTES : H/L Syntax: (defclass-module <class-name>)
************************************************************/
void GetDefclassModuleCommand(
Environment *theEnv,
UDFContext *context,
UDFValue *returnValue)
{
returnValue->value = GetConstructModuleCommand(context,"defclass-module",DefclassData(theEnv)->DefclassConstruct);
}
示例14: EnvGetDefclassList
/***************************************************************
NAME : EnvGetDefclassList
DESCRIPTION : Groups all defclass names into
a multifield list
INPUTS : 1) A data object buffer to hold
the multifield result
2) The module from which to obtain defclasses
RETURNS : Nothing useful
SIDE EFFECTS : Multifield allocated and filled
NOTES : External C access
***************************************************************/
globle void EnvGetDefclassList(
void *theEnv,
DATA_OBJECT *returnValue,
struct defmodule *theModule)
{
GetConstructList(theEnv,returnValue,DefclassData(theEnv)->DefclassConstruct,theModule);
}
示例15: EnvListDefclasses
/***************************************************
NAME : EnvListDefclasses
DESCRIPTION : Displays all defclass names
INPUTS : 1) The logical name of the output
2) The module
RETURNS : Nothing useful
SIDE EFFECTS : Defclass names printed
NOTES : C Interface
***************************************************/
globle void EnvListDefclasses(
void *theEnv,
const char *logicalName,
struct defmodule *theModule)
{
ListConstruct(theEnv,DefclassData(theEnv)->DefclassConstruct,logicalName,theModule);
}