Bull DPX/20 Guia do Utilizador Página 131

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 424
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 130
SOM Kernel Reference 1-119
C Example
/*
* The following example is a hypothetical
* implementation of an override of the somNew method
* in a subclass of SOMClassMgr. It illustrates the
* proper use of the somMergeInto method.
*/
SOM_Scope SOMAny * SOMLINK somNew (MySOMClassMgr somSelf)
{
SOMAny *newInstance;
static int firstTime = 1;
/*
* Permit only one instance of MySOMClassMgr to be created.
*/
if (!firstTime)
return (SOMClassMgrObject);
newInstance = parent_SOMClassMgr_somNew (somSelf);
/*
* The next line will transfer the class registry
* information from SOMClassMgrObject into our
* new instance.
*/
_somMergeInto (SOMClassMgrObject, newInstance);
/* As a result of the above operation
* SOMClassMgrObject is now set to point to the
* new instance of MySOMClassMgr.
*/
firstTime = 0;
return (newInstance);
}
Original Class
SOMClassMgr
Vista de página 130
1 2 ... 126 127 128 129 130 131 132 133 134 135 136 ... 423 424

Comentários a estes Manuais

Sem comentários