The wpInitData method initializes the Stack's instance data. Zero initialization is statisfactory for the stack top pointer (pStackTop), so there is nothing to do with respect to the instance data. However, I will take this opportunity to increment the awake stack instance count being maintained by the class because I want to decrement it in wpUnInitData. There are three additional items to note when overriding wpInitData:

The following sample code shows the use of wpInitData:

SOM_Scope void SOMLINK stk_wpInitData(                       Stack *somSelf) // In  - pointer to the object
{
  StackData *somThis = StackGetData(somSelf);
  StackMethodDebug("Stack","stk_wpInitData");

  parent_wpInitData(somSelf);
  if (!(_bInitialized))
  {
     _bInitialized = TRUE;
     _clsIncObjectCount(_somGetClass(somSelf), STK_AWAKECOUNT);
   } /* Endif */
   return;

}  // End stk_wpInitData


[Back] [Next]