home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / som30tk.zip / som30os2.zip / include / somcls.sc < prev    next >
Text File  |  1996-12-24  |  22KB  |  502 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: d:\u\otp\include\somcls.sc.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.29.1.19
  7.  *     SOM Emitter emitsc: 2.49
  8.  */
  9.  
  10. /*
  11.  *  96F8647, 96F8648, 96F8850 (C) Copyright IBM Corp. 1992, 1994
  12.  *  All Rights Reserved
  13.  *  Licensed Materials - Property of IBM
  14.  *   SOMObject: System Object Model root class
  15.  */
  16.  
  17. #include <somobj.sc>
  18.  
  19. class: SOMClass, 
  20.     majorversion = 1, minorversion = 6, 
  21.     filestem = somcls;
  22.  
  23.     --   SOMClass is the root SOM metaclass. Because it is a metaclass, its
  24.     --   instances are classes. Because it is the root metaclass, all other
  25.     --   metaclasses inherit its methods.
  26.     -- 
  27.     --   SOMClass defines the default behavior for SOM class objects
  28.     --   accessed using methods available through the SOMClass interface.
  29.     --   Other metaclasses are allowed to specialize the behavior of
  30.     --   classes by introducing new methods and overriding SOMClass
  31.     --   methods.
  32.     -- 
  33.     --   Generally, when SOMClass methods are overridden by user-defined
  34.     --   metaclasses, a relative parent call should be made at some point to
  35.     --   allow the default behavior implemented by SOMClass to execute
  36.     --   (in addition to whatever additional behavior might be desired by the
  37.     --   new metaclasses).
  38.     -- 
  39.  
  40.  
  41. parent class: SOMObject;
  42.  
  43.  
  44. release order:
  45.     somNew, somRenew, 
  46.     somcPrivate1, somClassReady, 
  47.     somGetName, somcPrivate2, 
  48.     somDescendedFrom, somCheckVersion, 
  49.     somFindMethod, somFindMethodOk, 
  50.     somSupportsMethod, somGetNumMethods, 
  51.     somGetInstanceSize, somcPrivate3, 
  52.     somGetInstancePartSize, somGetMethodIndex, 
  53.     somGetNumStaticMethods, somGetPClsMtab, 
  54.     somGetClassMtab, somAddStaticMethod, 
  55.     somOverrideSMethod, somAddDynamicMethod, 
  56.     somcUnused1, somGetApplyStub, 
  57.     somFindSMethod, somFindSMethodOk, 
  58.     somGetMethodDescriptor, somGetNthMethodInfo, 
  59.     somSetClassData, somGetClassData, 
  60.     somNewNoInit, somRenewNoInit, 
  61.     somGetInstanceToken, somGetMemberToken, 
  62.     somcUnused2, somGetMethodData, 
  63.     somOverrideMtab, somGetMethodToken, 
  64.     somGetParents, somUnused3, 
  65.     somInitMIClass, somGetVersionNumbers, 
  66.     somLookupMethod, _get_somInstanceDataOffsets, 
  67.     somRenewNoZero, somRenewNoInitNoZero, 
  68.     somAllocate, somDeallocate, 
  69.     somGetRdStub, somGetNthMethodData, 
  70.     somcPrivate8, somcPrivate9, 
  71.     _get_somDirectInitClasses, somcPrivate10, 
  72.     somcPrivate11, somcPrivate12, 
  73.     somcPrivate13, somcPrivate14, 
  74.     somMethodImplOwner, somcPrivate15, 
  75.     somcPrivate16, somDefinedMethod, 
  76.     somcPrivate17, somcPrivate18, 
  77.     somcPrivate19, somClassOfNewClassWithParents, 
  78.     somcPrivate20, somcUnused5, 
  79.     somcUnused6, somcUnused7, 
  80.     _get_somDataAlignment, somcPrivate21, 
  81.     somcUnused8, somcPrivate22, 
  82.     somcUnused9, somcUnused10, 
  83.     somGetMarshalPlan, somcUnused11, 
  84.     somPrivate23, somJoin, 
  85.     somEndow;
  86.  
  87. methods:
  88.  
  89.  
  90.     SOMObject*   somNew(), descriptor = ::SOMClass::somNew;
  91.  
  92.     --  Uses somAllocate to allocate storage for a new
  93.     --  instance of the receiving class, calls somRenewNoInitNoZero
  94.     --  to load the new object's method table pointer, and then
  95.     --  calls somDefaultInit to initialize the new object.
  96.     --  Overrides are not expected. NULL is returned on failure.
  97.  
  98.     SOMObject*   somNewNoInit(), descriptor = ::SOMClass::somNewNoInit;
  99.  
  100.     --  Equivalent to somNew except that somDefaultInit is not called.
  101.     --  Overrides are not expected.
  102.  
  103.     SOMObject*   somRenew(void* obj), descriptor = ::SOMClass::somRenew;
  104.  
  105.     --  Equivalent to somNew except that storage is not allocated.
  106.     --  <obj> is taken as the address of the new object.
  107.     --  Overrides are not expected.
  108.  
  109.     SOMObject*   somRenewNoInit(void* obj), descriptor = ::SOMClass::somRenewNoInit;
  110.  
  111.     --  Equivalent to somRenew except that somDefaultInit is not called.
  112.     --  Overrides are not expected.
  113.  
  114.     SOMObject*   somRenewNoZero(void* obj), descriptor = ::SOMClass::somRenewNoZero;
  115.  
  116.     --  Equivalent to somRenew except that memory is not zeroed out.
  117.     --  Overrides are not expected.
  118.  
  119.     SOMObject*   somRenewNoInitNoZero(void* obj), descriptor = ::SOMClass::somRenewNoInitNoZero;
  120.  
  121.     --  This method loads an object's method table pointer, turning raw
  122.     --  memory into an uninitialized SOM object. The other somNew and
  123.     --  somRenew methods all call this method, so metaclasses can override
  124.     --  this method to track object creation if this is desired. A relative
  125.     --  parent call should be done from overrides.
  126.  
  127.     somToken   somAllocate(long size), descriptor = ::SOMClass::somAllocate, nonstatic;
  128.  
  129.     --  nonstatic
  130.     --  Uses the memory allocation routine associated with the receiving
  131.     --  class to allocate memory to hold an object of the indicated size.
  132.     --  NULL is returned on failure. The default allocation routine uses
  133.     --  SOMMalloc.
  134.  
  135.     void   somDeallocate(somToken memptr), descriptor = ::SOMClass::somDeallocate, nonstatic;
  136.  
  137.     --  nonstatic
  138.     --  Uses the memory deallocation routine associated with the receiving
  139.     --  class to deallocate memory beginning at the address indicated by
  140.     --  memptr. The first word of this memory (normally a method table
  141.     --  pointer) is loaded with NULL. The deallocation routine receives
  142.     --  a void* (memptr) and a size_t (size) as arguments.
  143.  
  144.     SOMClass*   somJoin(SOMClass* secondParent,
  145.         string nameOfNewClass), descriptor = ::SOMClass::somJoin;
  146.  
  147.     --  Creates the multiple inheritance join of the target class and the
  148.     --  secondParent with the class name nameOfNewClass.
  149.  
  150.     SOMClass*   somEndow(SOMClass* parent,
  151.         string nameOfNewClass), descriptor = ::SOMClass::somEndow;
  152.  
  153.     --  Creates the a subclass of parent with the class name nameOfNewClass
  154.     --  where the target class is an added metaclass constraint.
  155.     --  NOTE: this means that the target class must be a metaclass.
  156.  
  157.     SOMClass*   somClassOfNewClassWithParents(string newClassName,
  158.         SOMClass_SOMClassSequence* parents,
  159.         SOMClass* explicitMeta), descriptor = ::SOMClass::somClassOfNewClassWithParents, procedure, 
  160.     noself;
  161.  
  162.     --  procedure
  163.     --  returns a metaclass appropriate for use as the class of a new
  164.     --  class with the given parents and explicit metaclass.
  165.  
  166.     void   somInitMIClass(unsigned long inherit_vars,
  167.         string className,
  168.         SOMClass_SOMClassSequence* parentClasses,
  169.         long dataSize,
  170.         long dataAlignment,
  171.         long maxNDMethods,
  172.         long majorVersion,
  173.         long minorVersion), descriptor = ::SOMClass::somInitMIClass, pcall;
  174.  
  175.     --  Perform inheritance into a class object from the specified parent
  176.     --  classes, determine the layout of instances for the receiving class, and
  177.     --  determine the layout of the instance method table for the receiving class.
  178.     --  Overrides should perform relative parent calls.
  179.  
  180.     somMToken   somAddStaticMethod(somId methodId,
  181.         somId methodDescriptor,
  182.         somMethodPtr method,
  183.         somMethodPtr redispatchStub,
  184.         somMethodPtr applyStub), descriptor = ::SOMClass::somAddStaticMethod;
  185.  
  186.     --  Introduce a new static method with the indicated methodId into
  187.     --  the receiving class. Overrides should perform relative parent calls.
  188.  
  189.     void   somOverrideSMethod(somId methodId,
  190.         somMethodPtr method), descriptor = ::SOMClass::somOverrideSMethod;
  191.  
  192.     --  Replace the implementation for the indicated method in the instances
  193.     --  of the receiving class. Overrides should perform relative parent calls.
  194.  
  195.     void   somClassReady(), descriptor = ::SOMClass::somClassReady, pcall;
  196.  
  197.     --  This method is invoked when all of the static initialization for
  198.     --  the class has been finished (i.e., its instance method table has
  199.     --  been loaded) and allows final setup for the class to be done. When
  200.     --  overriding this method, all setup should be done before doing a
  201.     --  relative pcall, since SOMClass's implementation will register the
  202.     --  class with the class manager.
  203.  
  204.     void   somAddDynamicMethod(somId methodId,
  205.         somId methodDescriptor,
  206.         somMethodPtr methodImpl,
  207.         somMethodPtr applyStub), descriptor = ::SOMClass::somAddDynamicMethod;
  208.  
  209.     --  If the receiving class supports a static method with the indicated
  210.     --  methodId, then override the method with the indicated implementation.
  211.     --  Otherwise, a dynamic method with the indicated methodId is added to
  212.     --  the receiving class.
  213.  
  214.     string   somGetName(), descriptor = ::SOMClass::somGetName, dual_owned_result;
  215.  
  216.     --  This object's class name as a NULL terminated string.
  217.     --  Overrides are not expected.
  218.  
  219.     void   somGetVersionNumbers(long* majorVersion,
  220.         long* minorVersion), descriptor = ::SOMClass::somGetVersionNumbers;
  221.  
  222.     --  Returns the class' major and minor version numbers in the corresponding
  223.     --  output parameters.
  224.     --  Overrides are not expected.
  225.  
  226.     long   somGetNumMethods(), descriptor = ::SOMClass::somGetNumMethods;
  227.  
  228.     --  The number of methods currently supported by this class,
  229.     --  including inherited methods (static, nonstatic, and dynamic).
  230.     --  Overrides are not expected.
  231.  
  232.     long   somGetNumStaticMethods(), descriptor = ::SOMClass::somGetNumStaticMethods;
  233.  
  234.     --  The number of nondynamic methods that this class has.  Can
  235.     --  be used by a child class when initializing its method table.
  236.     --  Overrides are not expected.
  237.  
  238.     SOMClass_SOMClassSequence   somGetParents(), descriptor = ::SOMClass::somGetParents;
  239.  
  240.     --  Returns a sequence containing pointers to the receiver's parent classes.
  241.     --  Caller is responsible for using SOMFree on the returned sequence buffer.
  242.     --  Overrides are not expected.
  243.  
  244.     long   somGetInstanceSize(), descriptor = ::SOMClass::somGetInstanceSize;
  245.  
  246.     --  The total size of an instance of the receiving class.
  247.     --  Overrides are not expected.
  248.  
  249.     long   somGetInstancePartSize(), descriptor = ::SOMClass::somGetInstancePartSize;
  250.  
  251.     --  The size in bytes of the instance data introduced by the receiving
  252.     --  class.
  253.     --  Overrides are not expected.
  254.  
  255.     somDToken   somGetInstanceToken(), descriptor = ::SOMClass::somGetInstanceToken;
  256.  
  257.     --  A data token that identifies the introduced portion of this class
  258.     --  within itself or any derived class.  This token can be subsequently
  259.     --  passed to the run-time somDataResolve function to locate the instance
  260.     --  data introduced by this class in any object derived from this class.
  261.     --  Overrides are not expected.
  262.  
  263.     somDToken   somGetMemberToken(long memberOffset,
  264.         somDToken instanceToken), descriptor = ::SOMClass::somGetMemberToken;
  265.  
  266.     --  Returns a data token that for the data member at offset
  267.     --  "memberOffset" within the introduced portion of the class identified
  268.     --  by instanceToken.  The instance token must have been obtained from a
  269.     --  previous invocation of somGetInstanceToken.  The returned member
  270.     --  token can be subsequently passed to the run-time somDataResolve
  271.     --  function to locate the data member.
  272.     --  Overrides are not expected.
  273.  
  274.     somMethodTab*   somGetClassMtab(), descriptor = ::SOMClass::somGetClassMtab;
  275.  
  276.     --  A pointer to the method table used by instances of this class. This
  277.     --  method was misnamed; it should have been called somGetInstanceMtab.
  278.     --  Overrides are not expected.
  279.  
  280.     somClassDataStructurePtr   somGetClassData(), descriptor = ::SOMClass::somGetClassData;
  281.  
  282.     void   somSetClassData(somClassDataStructurePtr cds), descriptor = ::SOMClass::somSetClassData;
  283.  
  284.     --  The pointer to the static <className>ClassData structure.
  285.     --  Overrides are not expected.
  286.  
  287. group: somDataAlignment, nodata;
  288.  
  289.     long   _get_somDataAlignment(), attribute, nodata, 
  290.     descriptor = ::SOMClass::_get_somDataAlignment;
  291.  
  292.     --  The alignment required for the instance data structure
  293.     --  introduced by the receiving class.
  294.     --  Overrides are not expected.
  295.  
  296. group: somInstanceDataOffsets, nodata;
  297.  
  298.     SOMClass_somOffsets   _get_somInstanceDataOffsets(), dual_owned_result, attribute, 
  299.     nodata, descriptor = ::SOMClass::_get_somInstanceDataOffsets;
  300.  
  301.     --  A sequence of the instance data offsets for all classes used in
  302.     --  the derivation of the receiving class (including the receiver).
  303.     --  The caller is responsible for freeing the returned sequence buffer.
  304.     --  Overrides are not expected.
  305.  
  306. group: somDirectInitClasses, nodata;
  307.  
  308.     SOMClass_SOMClassSequence   _get_somDirectInitClasses(), attribute, nodata, 
  309.     descriptor = ::SOMClass::_get_somDirectInitClasses;
  310.  
  311.     --  The ancestors whose initializers the receiving class wants to
  312.     --  directly invoke. Caller is responsible for freeing the returned
  313.     --  sequence buffer.
  314.     --  Overrides are not expected.
  315.  
  316. methods:
  317.  
  318.  
  319.     somId   somGetMethodDescriptor(somId methodId), descriptor = ::SOMClass::somGetMethodDescriptor;
  320.  
  321.     --  Returns the method descriptor for the indicated method.    If
  322.     --  this object does not support the indicated method then NULL is
  323.     --  returned.
  324.     --  Overrides are not expected.
  325.  
  326.     long   somGetMethodIndex(somId id), descriptor = ::SOMClass::somGetMethodIndex;
  327.  
  328.     --  Returns the index for the specified method. (A number that may
  329.     --  change if any methods are added or deleted to this class object or
  330.     --  any of its ancestors).  This number is the basis for other calls to
  331.     --  get info about the method. Indexes start at 0. A -1 is returned if
  332.     --  the method cannot be found.
  333.     --  Overrides are not expected.
  334.  
  335.     somMToken   somGetMethodToken(somId methodId), descriptor = ::SOMClass::somGetMethodToken;
  336.  
  337.     --  Returns the specified method's access token. This token can then
  338.     --  be passed to method resolution routines, which use the token
  339.     --  to select a method pointer from a method table.
  340.     --  Overrides are not expected.
  341.  
  342.     somId   somGetNthMethodInfo(long n,
  343.         somId* descriptor), descriptor = ::SOMClass::somGetNthMethodInfo;
  344.  
  345.     --  Returns the id of the <n>th method if one exists and NULL
  346.     --  otherwise.
  347.     -- 
  348.     --  The ordering of the methods is unpredictable, but will not change
  349.     --  unless some change is made to the class or one of its ancestor classes.
  350.     -- 
  351.     --  See CORBA documentation for info on method descriptors.
  352.     --  Overrides are not expected.
  353.  
  354.     somToken   somGetMarshalPlan(somId methodId), descriptor = ::SOMClass::somGetMarshalPlan;
  355.  
  356.     --  uses namelookup from the target class to locate a method that has the
  357.     --  indicated methodId, and returns that method's marshal plan if there
  358.     --  is one. Otherwise, null is returned.
  359.     --  Overrides are not expected.
  360.  
  361.     boolean   somGetMethodData(somId methodId,
  362.         somMethodData* md), descriptor = ::SOMClass::somGetMethodData;
  363.  
  364.     --  If the receiving class supports a method with the specified somId,
  365.     --  then the method data pointed to by md is loaded with information
  366.     --  for the method and 1 (TRUE) is returned. Otherwise md->id is set to
  367.     --  NULL and 0 (FALSE) is returned. On success, the md->method field is
  368.     --  loaded with a the address of a function that invokes the method
  369.     --  implementation appropriate for instances of the receiving class.
  370.     --  Successive calls for the same method are *not* guaranteed to load
  371.     --  md->method with the same address. All somId-based method resolution
  372.     --  routines use the md->method address computed by somGetMethodData
  373.     --  as their resolution result.
  374.  
  375.     boolean   somGetNthMethodData(long n,
  376.         somMethodData* md), descriptor = ::SOMClass::somGetNthMethodData;
  377.  
  378.     --  This method is similar to somGetMethodData. The method
  379.     --  whose data is returned is the method for which the receiving
  380.     --  class would return n from somGetMethodIndex.
  381.  
  382.     boolean   somFindMethod(somId methodId,
  383.         somMethodPtr* m), descriptor = ::SOMClass::somFindMethod;
  384.  
  385.     --  If the receiving class supports a method with the specified
  386.     --  methodId, m is set to the address of a function that
  387.     --  will invoke the method implementation appropriate for instances
  388.     --  of the receiving class and 1 (TRUE) is returned. Otherwise, m is
  389.     --  set to NULL and 0 (FALSE) is returned. Successive calls on the
  390.     --  same class with the same arguments are not guaranteed to return
  391.     --  the same function address.
  392.     --  Overrides are not expected.
  393.  
  394.     boolean   somFindMethodOk(somId methodId,
  395.         somMethodPtr* m), descriptor = ::SOMClass::somFindMethodOk;
  396.  
  397.     --  Just like <somFindMethod> except that if the method is not
  398.     --  supported then an error is raised and execution is halted.
  399.     --  Overrides are not expected.
  400.  
  401.     somMethodPtr   somFindSMethod(somId methodId), descriptor = ::SOMClass::somFindSMethod, nonstatic;
  402.  
  403.     --  Finds the indicated method, which must be a static method supported
  404.     --  by this class, and returns a pointer to a function that will
  405.     --  invoke the method implementation appropriate for instances of the
  406.     --  receiving class. If the method is not supported by the receiver
  407.     --  (as a static method or at all) then a NULL pointer is returned.
  408.     --  Overrides are not expected.
  409.  
  410.     somMethodPtr   somFindSMethodOk(somId methodId), descriptor = ::SOMClass::somFindSMethodOk;
  411.  
  412.     --  Uses <somFindSMethod>, and raises an error if the result is NULL.
  413.     --  Overrides are not expected.
  414.  
  415.     somMethodPtr   somLookupMethod(somId methodId), descriptor = ::SOMClass::somLookupMethod;
  416.  
  417.     --  Like <somFindSMethodOK>, but without restriction to static methods.
  418.     --  Overrides are not expected.
  419.  
  420.     somMethodPtr   somGetApplyStub(somId methodId), descriptor = ::SOMClass::somGetApplyStub;
  421.  
  422.     --  Returns the apply stub associated with the specified method,
  423.     --  if one exists; otherwise NULL is returned. This method is obsolete,
  424.     --  and retained for binary compatability. In SOMr2, users never access
  425.     --  apply stubs directly; The function somApply is used to invoke apply
  426.     --  stubs. See somApply documentation for further information on apply
  427.     --  stubs, and see somAddStaticMethod documentation for information
  428.     --  on how apply stubs are registered by class implementations.
  429.     --  Overrides are not expected.
  430.  
  431.     somMethodTabs   somGetPClsMtab(), descriptor = ::SOMClass::somGetPClsMtab, dual_owned_result;
  432.  
  433.     --  Returns a list of the method tables of this class's parent classes in the
  434.     --  specific format required by somParentNumResolve (for making parent method
  435.     --  calls. The first entry on the list is actually the method table of the
  436.     --  receiving class. Because the CClassData structure contains this list, the
  437.     --  method table for any class with a CClassData structure is statically
  438.     --  available. This method now returns a list because older SI emitters load
  439.     --  CClassData.parentMtab with the result of this call, and the new runtime
  440.     --  requires a list of classes in that position.
  441.     --  Overrides are not expected.
  442.  
  443.     boolean   somCheckVersion(long majorVersion,
  444.         long minorVersion), descriptor = ::SOMClass::somCheckVersion;
  445.  
  446.     --  Returns 1 (true) if the implementation of this class is
  447.     --  compatible with the specified major and minor version number and
  448.     --  false (0) otherwise.  An implementation is compatible with the
  449.     --  specified version numbers if it has the same major version number
  450.     --  and a minor version number that is equal to or greater than
  451.     --  <minorVersion>.    The major, minor version number pair (0,0) is
  452.     --  considered to match any version.  This method is usually called
  453.     --  immediately after creating the class object to verify that a
  454.     --  dynamically loaded class definition is compatible with a using
  455.     --  application.
  456.     --  Overrides are not expected.
  457.  
  458.     boolean   somDescendedFrom(SOMClass* aClassObj), descriptor = ::SOMClass::somDescendedFrom;
  459.  
  460.     --  Returns 1 (true) if <self> is a descendent class of <aClassObj> and
  461.     --  0 (false) otherwise.  Note: a class object is considered to be
  462.     --  descended itself for the purposes of this method.
  463.     --  Overrides are not expected.
  464.  
  465.     boolean   somSupportsMethod(somId mId), descriptor = ::SOMClass::somSupportsMethod;
  466.  
  467.     --  Returns 1 (true) if the indicated method is supported by this
  468.     --  class and 0 (false) otherwise.
  469.     --  Overrides are not expected.
  470.  
  471.     somMethodPtr   somDefinedMethod(somMToken method), descriptor = ::SOMClass::somDefinedMethod;
  472.  
  473.     --  If the receiving class explicitly defines an implementation for
  474.     --  the indicated method, then the address of a function that will invoke
  475.     --  this implementation is returned. Otherwise NULL is returned.
  476.     --  Overrides are not expected.
  477.  
  478.     SOMClass*   somMethodImplOwner(somMethodData* md), descriptor = ::SOMClass::somMethodImplOwner, nonstatic;
  479.  
  480.     --  Returns the owner of the implementation of the method indicated by md
  481.     --  for instances of the receiving class, and loads md->method with a
  482.     --  pointer to the method implementation. If the receiving class doesn't
  483.     --  support the method, md->method is not changed, and null is returned.
  484.     --  Implementations that are automatically installed by SOM (such as for
  485.     --  SOMObject's initializers and for legacy support of somInit) are
  486.     --  reported as being owned by SOMObject.
  487.     --  Overrides are not expected.
  488.  
  489.     somMethodProc*   somGetRdStub(somId methodId), descriptor = ::SOMClass::somGetRdStub;
  490.  
  491.     --  Returns a redispatch stub for the indicated method if possible.
  492.     --  If not possible (because a valid redispatch stub has not been
  493.     --  registered, and there is insufficient information to dynamically
  494.     --  construct one), then a pointer to a function that prints an
  495.     --  informative message and terminates execution is returned.
  496.  
  497.     void   somOverrideMtab(), descriptor = ::SOMClass::somOverrideMtab;
  498.  
  499.     --  Overrides the method table pointers to point to the redispatch stubs.
  500.     --  All the methods except somDispatch methods are overriden.
  501.  
  502.