home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / som / include / defedidl.xh < prev    next >
Text File  |  1999-02-22  |  30KB  |  920 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: defedidl.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.29.1.17
  7.  *     SOM Emitter emitxh: 2.47
  8.  */
  9.  
  10. /*
  11.  *    COMPONENT_NAME: somp
  12.  * 
  13.  *    ORIGINS: 27
  14.  * 
  15.  * 
  16.  *     25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1994,1996
  17.  *    All Rights Reserved
  18.  *    Licensed Materials - Property of IBM
  19.  *    US Government Users Restricted Rights - Use, duplication or
  20.  *    disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  21.  * 
  22.  */
  23.  
  24.  
  25. #ifndef SOM_SOMPAttrEncoderDecoder_xh
  26. #define SOM_SOMPAttrEncoderDecoder_xh
  27.  
  28. class SOMPAttrEncoderDecoder;
  29.  
  30. /*
  31.  *  This class is an EncoderDecoder which can save/restore the IDL
  32.  *  attributes of a given persistent object.
  33.  * 
  34.  *  NOTE: This encoder/decoder assumes structure members have been
  35.  *        aligned. This is the default for most compilers. See your
  36.  *        compiler's documentation for discussion of aligned structures.
  37.  *        The encoder/decoder will also handle structures
  38.  *        which are naturally packed (e.g. a structure containing
  39.  *        members which are all declared "long") however, some compilers
  40.  *        allow options which will pack all structures. This encoder/
  41.  *        decoder will not handle these structures.
  42.  * 
  43.  *  For example, suppose you have an IDL Interface definition with attributes:
  44.  * 
  45.  *   attribute string   name;
  46.  *   attribute string   food;
  47.  *   attribute long     weight;
  48.  *   attribute short    height;
  49.  * 
  50.  *  You would make attributes "name" and "weight" persistent by specifying
  51.  *  the following SOM modifiers in the SOM implementation section of the
  52.  *  interface definition:
  53.  * 
  54.  *   name: persistent;
  55.  *   weight: persistent;
  56.  * 
  57.  *  An encoder/decoder is an object which is paired with a persistent object
  58.  *  and handles the reading/writing of that persistent object's
  59.  *  data.
  60.  * 
  61.  *  A persistent object's encoder/decoder is instantiated by an
  62.  *  IO Group Mgr at the moment that object is save/restored.
  63.  *  typedef enum mytckind {tk_null, tk_long} TCKind;
  64.  *  TCKind is a CORBA enumerated type. This type is definded by SOM
  65.  *  however, not in IDL and therefore this declaration.
  66.  */
  67.  
  68. #define SOMPAttrEncoderDecoder_MajorVersion 2
  69. #define SOMPAttrEncoderDecoder_MinorVersion 1
  70.  
  71. /* C++ SOM defs */
  72. #include <somcls.xh>
  73. #include <somcm.xh>
  74.  
  75. /* C++ parent defs */
  76. #ifndef SOM_SOMPEncoderDecoderAbstract_xh
  77. #include <eda.xh>
  78. #endif
  79.  
  80. #ifndef SOMPAttrEncoderDecoder_API
  81. #define SOMPAttrEncoderDecoder_API
  82. /*
  83.  * -- The Class API
  84.  */
  85.  
  86. /*
  87.  * Start of bindings for IDL types
  88.  */
  89.  
  90. class SOMClass;
  91. class SOMObject;
  92. class SOMPMediaInterfaceAbstract;
  93. class SOMPPersistentObject;
  94. class Container;
  95. class Repository;
  96.  
  97. /*
  98.  * End of bindings for IDL types.
  99.  */
  100.  
  101. /* A procedure to create the SOMPAttrEncoderDecoder Class */
  102. SOMEXTERN SOMClass * SOMLINK SOMPAttrEncoderDecoderNewClass(
  103.         integer4 majorVersion,
  104.         integer4 minorVersion);
  105.  
  106. /* The API to the SOMPAttrEncoderDecoder class object, and the methods it introduces. */
  107. SOMEXTERN struct SOMPAttrEncoderDecoderClassDataStructure {
  108.     SOMClass *classObject;
  109.     somMToken sompGetObjectAttributes;
  110.     somMToken sompGetAttribute;
  111.     somMToken sompSetObjectAttributes;
  112.     somMToken sompSetAttribute;
  113.     somMToken sompAttributeSize;
  114.     somMToken sompStoreBuffer;
  115.     somMToken sompRestoreBuffer;
  116.     somMToken sompDispatchSet;
  117.     somMToken sompPadSize;
  118.     somMToken sompCallStyleIDL;
  119.     somMToken sompLookupModifier;
  120. } SOMDLINK SOMPAttrEncoderDecoderClassData;
  121. #define _SOMPAttrEncoderDecoder SOMPAttrEncoderDecoderClassData.classObject
  122.  
  123. /* The API to parentMtabs for SOMPAttrEncoderDecoder, and the instance data it introduces. */
  124. SOMEXTERN struct SOMPAttrEncoderDecoderCClassDataStructure {
  125.     somMethodTabs parentMtab;
  126.     somDToken              instanceDataToken;
  127. } SOMDLINK SOMPAttrEncoderDecoderCClassData;
  128.  
  129. /*
  130.  * -- Typedefs for SOMPAttrEncoderDecoder Method Procedures
  131.  */
  132. SOMEXTERN {
  133.  
  134. /*
  135.  * -- Typedefs for Reintroduced Wrapper Methods
  136.  */
  137. typedef void   SOMLINK somTP_SOMPAttrEncoderDecoder_sompEDWrite(SOMPAttrEncoderDecoder *somSelf, Environment *ev, 
  138.         SOMPMediaInterfaceAbstract* thisMedia, 
  139.         SOMPPersistentObject* thisObject);
  140. typedef somTP_SOMPAttrEncoderDecoder_sompEDWrite *somTD_SOMPAttrEncoderDecoder_sompEDWrite;
  141. typedef void   SOMLINK somTP_SOMPAttrEncoderDecoder_sompEDRead(SOMPAttrEncoderDecoder *somSelf, Environment *ev, 
  142.         SOMPMediaInterfaceAbstract* thisMedia, 
  143.         SOMPPersistentObject* thisObject);
  144. typedef somTP_SOMPAttrEncoderDecoder_sompEDRead *somTD_SOMPAttrEncoderDecoder_sompEDRead;
  145. typedef void   SOMLINK somTP_SOMPAttrEncoderDecoder_somDefaultInit(SOMPAttrEncoderDecoder *somSelf, 
  146.         som3InitCtrl* ctrl);
  147. typedef somTP_SOMPAttrEncoderDecoder_somDefaultInit *somTD_SOMPAttrEncoderDecoder_somDefaultInit;
  148. typedef void   SOMLINK somTP_SOMPAttrEncoderDecoder_somDestruct(SOMPAttrEncoderDecoder *somSelf, 
  149.         octet doFree, 
  150.         som3DestructCtrl* ctrl);
  151. typedef somTP_SOMPAttrEncoderDecoder_somDestruct *somTD_SOMPAttrEncoderDecoder_somDestruct;
  152. typedef void   SOMLINK somTP_SOMPAttrEncoderDecoder_somDefaultCopyInit(SOMPAttrEncoderDecoder *somSelf, 
  153.         som3InitCtrl* ctrl, 
  154.         SOMObject* fromObj);
  155. typedef somTP_SOMPAttrEncoderDecoder_somDefaultCopyInit *somTD_SOMPAttrEncoderDecoder_somDefaultCopyInit;
  156. typedef SOMPAttrEncoderDecoder*   SOMLINK somTP_SOMPAttrEncoderDecoder_somDefaultAssign(SOMPAttrEncoderDecoder *somSelf, 
  157.         som3AssignCtrl* ctrl, 
  158.         SOMObject* fromObj);
  159. typedef somTP_SOMPAttrEncoderDecoder_somDefaultAssign *somTD_SOMPAttrEncoderDecoder_somDefaultAssign;
  160. typedef void   SOMLINK somTP_SOMPAttrEncoderDecoder_somDefaultConstCopyInit(SOMPAttrEncoderDecoder *somSelf, 
  161.         som3InitCtrl* ctrl, 
  162.         SOMObject* fromObj);
  163. typedef somTP_SOMPAttrEncoderDecoder_somDefaultConstCopyInit *somTD_SOMPAttrEncoderDecoder_somDefaultConstCopyInit;
  164. typedef void   SOMLINK somTP_SOMPAttrEncoderDecoder_somDefaultVCopyInit(SOMPAttrEncoderDecoder *somSelf, 
  165.         som3InitCtrl* ctrl, 
  166.         SOMObject* fromObj);
  167. typedef somTP_SOMPAttrEncoderDecoder_somDefaultVCopyInit *somTD_SOMPAttrEncoderDecoder_somDefaultVCopyInit;
  168. typedef void   SOMLINK somTP_SOMPAttrEncoderDecoder_somDefaultConstVCopyInit(SOMPAttrEncoderDecoder *somSelf, 
  169.         som3InitCtrl* ctrl, 
  170.         SOMObject* fromObj);
  171. typedef somTP_SOMPAttrEncoderDecoder_somDefaultConstVCopyInit *somTD_SOMPAttrEncoderDecoder_somDefaultConstVCopyInit;
  172. typedef SOMPAttrEncoderDecoder*   SOMLINK somTP_SOMPAttrEncoderDecoder_somDefaultConstAssign(SOMPAttrEncoderDecoder *somSelf, 
  173.         som3AssignCtrl* ctrl, 
  174.         SOMObject* fromObj);
  175. typedef somTP_SOMPAttrEncoderDecoder_somDefaultConstAssign *somTD_SOMPAttrEncoderDecoder_somDefaultConstAssign;
  176. typedef SOMPAttrEncoderDecoder*   SOMLINK somTP_SOMPAttrEncoderDecoder_somDefaultVAssign(SOMPAttrEncoderDecoder *somSelf, 
  177.         som3AssignCtrl* ctrl, 
  178.         SOMObject* fromObj);
  179. typedef somTP_SOMPAttrEncoderDecoder_somDefaultVAssign *somTD_SOMPAttrEncoderDecoder_somDefaultVAssign;
  180. typedef SOMPAttrEncoderDecoder*   SOMLINK somTP_SOMPAttrEncoderDecoder_somDefaultConstVAssign(SOMPAttrEncoderDecoder *somSelf, 
  181.         som3AssignCtrl* ctrl, 
  182.         SOMObject* fromObj);
  183. typedef somTP_SOMPAttrEncoderDecoder_somDefaultConstVAssign *somTD_SOMPAttrEncoderDecoder_somDefaultConstVAssign;
  184. typedef void   SOMLINK somTP_SOMPAttrEncoderDecoder_somInit(SOMPAttrEncoderDecoder *somSelf);
  185. typedef somTP_SOMPAttrEncoderDecoder_somInit *somTD_SOMPAttrEncoderDecoder_somInit;
  186. typedef void   SOMLINK somTP_SOMPAttrEncoderDecoder_somFree(SOMPAttrEncoderDecoder *somSelf);
  187. typedef somTP_SOMPAttrEncoderDecoder_somFree *somTD_SOMPAttrEncoderDecoder_somFree;
  188. typedef void   SOMLINK somTP_SOMPAttrEncoderDecoder_somUninit(SOMPAttrEncoderDecoder *somSelf);
  189. typedef somTP_SOMPAttrEncoderDecoder_somUninit *somTD_SOMPAttrEncoderDecoder_somUninit;
  190. typedef SOMClass*   SOMLINK somTP_SOMPAttrEncoderDecoder_somGetClass(SOMPAttrEncoderDecoder *somSelf);
  191. typedef somTP_SOMPAttrEncoderDecoder_somGetClass *somTD_SOMPAttrEncoderDecoder_somGetClass;
  192. typedef string   SOMLINK somTP_SOMPAttrEncoderDecoder_somGetClassName(SOMPAttrEncoderDecoder *somSelf);
  193. typedef somTP_SOMPAttrEncoderDecoder_somGetClassName *somTD_SOMPAttrEncoderDecoder_somGetClassName;
  194. typedef long   SOMLINK somTP_SOMPAttrEncoderDecoder_somGetSize(SOMPAttrEncoderDecoder *somSelf);
  195. typedef somTP_SOMPAttrEncoderDecoder_somGetSize *somTD_SOMPAttrEncoderDecoder_somGetSize;
  196. typedef boolean   SOMLINK somTP_SOMPAttrEncoderDecoder_somIsA(SOMPAttrEncoderDecoder *somSelf, 
  197.         SOMClass* aClassObj);
  198. typedef somTP_SOMPAttrEncoderDecoder_somIsA *somTD_SOMPAttrEncoderDecoder_somIsA;
  199. typedef boolean   SOMLINK somTP_SOMPAttrEncoderDecoder_somIsInstanceOf(SOMPAttrEncoderDecoder *somSelf, 
  200.         SOMClass* aClassObj);
  201. typedef somTP_SOMPAttrEncoderDecoder_somIsInstanceOf *somTD_SOMPAttrEncoderDecoder_somIsInstanceOf;
  202. typedef boolean   SOMLINK somTP_SOMPAttrEncoderDecoder_somRespondsTo(SOMPAttrEncoderDecoder *somSelf, 
  203.         somId mId);
  204. typedef somTP_SOMPAttrEncoderDecoder_somRespondsTo *somTD_SOMPAttrEncoderDecoder_somRespondsTo;
  205. typedef boolean   SOMLINK somTP_SOMPAttrEncoderDecoder_somDispatch(SOMPAttrEncoderDecoder *somSelf, 
  206.         somToken* retValue, 
  207.         somId methodId, 
  208.         va_list ap);
  209. typedef somTP_SOMPAttrEncoderDecoder_somDispatch *somTD_SOMPAttrEncoderDecoder_somDispatch;
  210. typedef boolean   SOMLINK somTP_SOMPAttrEncoderDecoder_somClassDispatch(SOMPAttrEncoderDecoder *somSelf, 
  211.         SOMClass* clsObj, 
  212.         somToken* retValue, 
  213.         somId methodId, 
  214.         va_list ap);
  215. typedef somTP_SOMPAttrEncoderDecoder_somClassDispatch *somTD_SOMPAttrEncoderDecoder_somClassDispatch;
  216. typedef boolean   SOMLINK somTP_SOMPAttrEncoderDecoder_somCastObj(SOMPAttrEncoderDecoder *somSelf, 
  217.         SOMClass* cls);
  218. typedef somTP_SOMPAttrEncoderDecoder_somCastObj *somTD_SOMPAttrEncoderDecoder_somCastObj;
  219. typedef boolean   SOMLINK somTP_SOMPAttrEncoderDecoder_somResetObj(SOMPAttrEncoderDecoder *somSelf);
  220. typedef somTP_SOMPAttrEncoderDecoder_somResetObj *somTD_SOMPAttrEncoderDecoder_somResetObj;
  221. typedef void   SOMLINK somTP_SOMPAttrEncoderDecoder_somDispatchV(SOMPAttrEncoderDecoder *somSelf, 
  222.         somId methodId, 
  223.         somId descriptor, 
  224.         va_list ap);
  225. typedef somTP_SOMPAttrEncoderDecoder_somDispatchV *somTD_SOMPAttrEncoderDecoder_somDispatchV;
  226. typedef long   SOMLINK somTP_SOMPAttrEncoderDecoder_somDispatchL(SOMPAttrEncoderDecoder *somSelf, 
  227.         somId methodId, 
  228.         somId descriptor, 
  229.         va_list ap);
  230. typedef somTP_SOMPAttrEncoderDecoder_somDispatchL *somTD_SOMPAttrEncoderDecoder_somDispatchL;
  231. typedef void*   SOMLINK somTP_SOMPAttrEncoderDecoder_somDispatchA(SOMPAttrEncoderDecoder *somSelf, 
  232.         somId methodId, 
  233.         somId descriptor, 
  234.         va_list ap);
  235. typedef somTP_SOMPAttrEncoderDecoder_somDispatchA *somTD_SOMPAttrEncoderDecoder_somDispatchA;
  236. typedef double   SOMLINK somTP_SOMPAttrEncoderDecoder_somDispatchD(SOMPAttrEncoderDecoder *somSelf, 
  237.         somId methodId, 
  238.         somId descriptor, 
  239.         va_list ap);
  240. typedef somTP_SOMPAttrEncoderDecoder_somDispatchD *somTD_SOMPAttrEncoderDecoder_somDispatchD;
  241. typedef SOMObject*   SOMLINK somTP_SOMPAttrEncoderDecoder_somPrintSelf(SOMPAttrEncoderDecoder *somSelf);
  242. typedef somTP_SOMPAttrEncoderDecoder_somPrintSelf *somTD_SOMPAttrEncoderDecoder_somPrintSelf;
  243. typedef void   SOMLINK somTP_SOMPAttrEncoderDecoder_somDumpSelf(SOMPAttrEncoderDecoder *somSelf, 
  244.         long level);
  245. typedef somTP_SOMPAttrEncoderDecoder_somDumpSelf *somTD_SOMPAttrEncoderDecoder_somDumpSelf;
  246. typedef void   SOMLINK somTP_SOMPAttrEncoderDecoder_somDumpSelfInt(SOMPAttrEncoderDecoder *somSelf, 
  247.         long level);
  248. typedef somTP_SOMPAttrEncoderDecoder_somDumpSelfInt *somTD_SOMPAttrEncoderDecoder_somDumpSelfInt;
  249. }
  250.  
  251. #endif /* SOMPAttrEncoderDecoder_API */
  252.  
  253.  
  254. /*
  255.  * -- This emitter treats Method Tokens as Thunks by default.
  256.  * -- Use the sc modifier "nothunks" to change this default
  257.  */
  258. #undef somresolve_
  259. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  260.  
  261. /*
  262.  * -- The C++ Wrapper Class for SOMPAttrEncoderDecoder
  263.  */
  264. class SOMPAttrEncoderDecoder : public SOMPEncoderDecoderAbstract
  265. {
  266. /*
  267.  *  This class is an EncoderDecoder which can save/restore the IDL
  268.  *  attributes of a given persistent object.
  269.  * 
  270.  *  NOTE: This encoder/decoder assumes structure members have been
  271.  *        aligned. This is the default for most compilers. See your
  272.  *        compiler's documentation for discussion of aligned structures.
  273.  *        The encoder/decoder will also handle structures
  274.  *        which are naturally packed (e.g. a structure containing
  275.  *        members which are all declared "long") however, some compilers
  276.  *        allow options which will pack all structures. This encoder/
  277.  *        decoder will not handle these structures.
  278.  * 
  279.  *  For example, suppose you have an IDL Interface definition with attributes:
  280.  * 
  281.  *   attribute string   name;
  282.  *   attribute string   food;
  283.  *   attribute long     weight;
  284.  *   attribute short    height;
  285.  * 
  286.  *  You would make attributes "name" and "weight" persistent by specifying
  287.  *  the following SOM modifiers in the SOM implementation section of the
  288.  *  interface definition:
  289.  * 
  290.  *   name: persistent;
  291.  *   weight: persistent;
  292.  * 
  293.  *  An encoder/decoder is an object which is paired with a persistent object
  294.  *  and handles the reading/writing of that persistent object's
  295.  *  data.
  296.  * 
  297.  *  A persistent object's encoder/decoder is instantiated by an
  298.  *  IO Group Mgr at the moment that object is save/restored.
  299.  *  typedef enum mytckind {tk_null, tk_long} TCKind;
  300.  *  TCKind is a CORBA enumerated type. This type is definded by SOM
  301.  *  however, not in IDL and therefore this declaration.
  302.  */
  303. public:
  304.  
  305. // SOMPAttrEncoderDecoder::new creates the class object if necessary, and then uses somNewNoInit
  306. // to allocate memory and create the object. Initialization is in ctors.
  307. void *operator new(size_t)
  308. {
  309.    if (!_SOMPAttrEncoderDecoder) SOMPAttrEncoderDecoderNewClass(SOMPAttrEncoderDecoder_MajorVersion,SOMPAttrEncoderDecoder_MinorVersion);
  310.    return (void*)
  311.       SOM_Resolve(_SOMPAttrEncoderDecoder,SOMClass,somNewNoInit)
  312.          ((SOMClass *)((void*)_SOMPAttrEncoderDecoder));
  313. }
  314.  
  315. // SOMPAttrEncoderDecoder::delete uses somDestruct.
  316. void operator delete(void * obj)
  317. {
  318.    if (obj && *(void**)obj) {
  319.       SOM_Resolve(obj,SOMObject,somFree)
  320.          ((SOMObject*)obj);
  321.    }
  322. }
  323.  
  324. SOMPAttrEncoderDecoder& operator=(SOMPAttrEncoderDecoder& fromObj)
  325. {
  326.    this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
  327.    return *this;
  328. }
  329.  
  330. SOMPAttrEncoderDecoder()
  331. {
  332.    if (*(void**)this != 
  333.        ((somParentMtabStructPtr)
  334.         (SOMPAttrEncoderDecoderCClassData.parentMtab))->mtab)
  335.       return;
  336.    ((SOMObject*)((void*)this))->somDefaultInit(0);
  337. }
  338.  
  339. SOMPAttrEncoderDecoder(SOMPAttrEncoderDecoder* fromObj)
  340. {
  341.    if (*(void**)this != 
  342.        ((somParentMtabStructPtr)
  343.         (SOMPAttrEncoderDecoderCClassData.parentMtab))->mtab)
  344.       return;
  345.    ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
  346. }
  347.  
  348. #ifdef __IBMCPP__
  349. #pragma info(nocnv,nopar)
  350. #endif
  351. SOMPAttrEncoderDecoder(const SOMPAttrEncoderDecoder* fromObj)
  352. {
  353.    if (*(void**)this != 
  354.        ((somParentMtabStructPtr)
  355.         (SOMPAttrEncoderDecoderCClassData.parentMtab))->mtab)
  356.       return;
  357.    ((SOMObject*)((void*)this))->somDefaultConstCopyInit(0,((SOMObject*)((void*)fromObj)));
  358. }
  359. #ifdef __IBMCPP__
  360. #pragma info(restore)
  361. #endif
  362.  
  363.  
  364. /*
  365.  * Reintroduce inherited methods
  366.  */
  367.  
  368. /* method: sompEDWrite */
  369. void   sompEDWrite(Environment *ev, 
  370.         SOMPMediaInterfaceAbstract* thisMedia, 
  371.         SOMPPersistentObject* thisObject)
  372. {
  373. /*
  374.  *  This method is responsible for writing out the persistent data of
  375.  *  object <thisObject> in a format that is compatible with sompEDRead.
  376.  *  This routine should make use of the media interface that is passed in
  377.  *  as the first argument <thisMedia>.  This method should assume that
  378.  *  the media interface has been initialized and opened.  This method
  379.  *  should also assume that the media interface will be closed by the
  380.  *  caller of this method.
  381.  * 
  382.  *  Refer to the class interface of the media interface passed in for
  383.  *  the methods which can be used to write instance data.
  384.  */
  385.    SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMPEncoderDecoderAbstract,sompEDWrite)
  386.     (this, ev,thisMedia,thisObject);
  387. }
  388.  
  389.  
  390. /* method: sompEDRead */
  391. void   sompEDRead(Environment *ev, 
  392.         SOMPMediaInterfaceAbstract* thisMedia, 
  393.         SOMPPersistentObject* thisObject)
  394. {
  395. /*
  396.  *  This method is responsible for reading in the persistent data of
  397.  *  object <thisObject>.  It should expect the data to be in the format
  398.  *  of sompEDWrite.  This routine should make use of the media interface
  399.  *  that is passed in as the first argument <thisMedia>.  This method
  400.  *  should assume that the media interface has been initialized and
  401.  *  opened.  This method should also assume that the media interface will
  402.  *  be closed by the caller of this method.
  403.  * 
  404.  *  Refer to the class interface of the media interface passed in for
  405.  *  the methods which can be used to read instance data.
  406.  */
  407.    SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMPEncoderDecoderAbstract,sompEDRead)
  408.     (this, ev,thisMedia,thisObject);
  409. }
  410.  
  411.  
  412. /* initializer method: somDefaultInit */
  413. void   somDefaultInit(som3InitCtrl* ctrl)
  414. {
  415. /*
  416.  *  A default initializer for a SOM object. Passing a null ctrl
  417.  *  indicates to the receiver that its class is the class of the
  418.  *  object being initialized, whereby the initializer will determine
  419.  *  an appropriate control structure.
  420.  */
  421.    SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDefaultInit)
  422.     (this,ctrl);
  423. }
  424.  
  425.  
  426. /* method: somDestruct */
  427. void   somDestruct(octet doFree, 
  428.         som3DestructCtrl* ctrl)
  429. {
  430. /*
  431.  *  The default destructor for a SOM object. A nonzero <doFree>
  432.  *  indicates that the object storage should be freed by the
  433.  *  object's class (via somDeallocate) after uninitialization.
  434.  *  As with somDefaultInit, a null ctrl can be passed.
  435.  */
  436.    SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDestruct)
  437.     (this,doFree,ctrl);
  438. }
  439.  
  440.  
  441. /* initializer method: somDefaultCopyInit */
  442. void   somDefaultCopyInit(som3InitCtrl* ctrl, 
  443.         SOMObject* fromObj)
  444. {
  445. /*
  446.  *  A default copy constructor. Use this to make copies of objects for
  447.  *  calling methods with "by-value" argument semantics.
  448.  */
  449.    SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDefaultCopyInit)
  450.     (this,ctrl,fromObj);
  451. }
  452.  
  453.  
  454. /* method: somDefaultAssign */
  455. SOMPAttrEncoderDecoder*  somDefaultAssign(som3AssignCtrl* ctrl, 
  456.         SOMObject* fromObj)
  457. {
  458. /*
  459.  *  A default assignment operator. Use this to "assign" the state of one
  460.  *  object to another.
  461.  */
  462.    return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDefaultAssign)
  463.     (this,ctrl,fromObj);
  464. }
  465.  
  466.  
  467. /* initializer method: somDefaultConstCopyInit */
  468. void   somDefaultConstCopyInit(som3InitCtrl* ctrl, 
  469.         SOMObject* fromObj)
  470. {
  471. /*
  472.  *  A default copy constructor that uses a const fromObj.
  473.  */
  474.    SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDefaultConstCopyInit)
  475.     (this,ctrl,fromObj);
  476. }
  477.  
  478.  
  479. /* initializer method: somDefaultVCopyInit */
  480. void   somDefaultVCopyInit(som3InitCtrl* ctrl, 
  481.         SOMObject* fromObj)
  482. {
  483. /*
  484.  *  A default copy constructor that uses a volatile fromObj.
  485.  */
  486.    SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDefaultVCopyInit)
  487.     (this,ctrl,fromObj);
  488. }
  489.  
  490.  
  491. /* initializer method: somDefaultConstVCopyInit */
  492. void   somDefaultConstVCopyInit(som3InitCtrl* ctrl, 
  493.         SOMObject* fromObj)
  494. {
  495. /*
  496.  *  A default copy constructor that uses a const volatile fromObj.
  497.  */
  498.    SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDefaultConstVCopyInit)
  499.     (this,ctrl,fromObj);
  500. }
  501.  
  502.  
  503. /* method: somDefaultConstAssign */
  504. SOMPAttrEncoderDecoder*  somDefaultConstAssign(som3AssignCtrl* ctrl, 
  505.         SOMObject* fromObj)
  506. {
  507. /*
  508.  *  A default assignment operator that uses a const fromObj.
  509.  */
  510.    return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDefaultConstAssign)
  511.     (this,ctrl,fromObj);
  512. }
  513.  
  514.  
  515. /* method: somDefaultVAssign */
  516. SOMPAttrEncoderDecoder*  somDefaultVAssign(som3AssignCtrl* ctrl, 
  517.         SOMObject* fromObj)
  518. {
  519. /*
  520.  *  A default assignment operator that uses a volatile fromObj.
  521.  */
  522.    return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDefaultVAssign)
  523.     (this,ctrl,fromObj);
  524. }
  525.  
  526.  
  527. /* method: somDefaultConstVAssign */
  528. SOMPAttrEncoderDecoder*  somDefaultConstVAssign(som3AssignCtrl* ctrl, 
  529.         SOMObject* fromObj)
  530. {
  531. /*
  532.  *  A default assignment operator that uses a const volatile fromObj.
  533.  */
  534.    return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDefaultConstVAssign)
  535.     (this,ctrl,fromObj);
  536. }
  537.  
  538.  
  539. /* method: somInit */
  540. void   somInit()
  541. {
  542. /*
  543.  *  Obsolete but still supported. Override somDefaultInit instead of somInit.
  544.  */
  545.    SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somInit)
  546.     (this);
  547. }
  548.  
  549.  
  550. /* method: somFree */
  551. void   somFree()
  552. {
  553. /*
  554.  *  Use as directed by framework implementations.
  555.  */
  556.    SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somFree)
  557.     (this);
  558. }
  559.  
  560.  
  561. /* method: somUninit */
  562. void   somUninit()
  563. {
  564. /*
  565.  *  Obsolete but still supported. Override somDestruct instead of somUninit.
  566.  */
  567.    SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somUninit)
  568.     (this);
  569. }
  570.  
  571.  
  572. /* method: somGetClass */
  573. SOMClass*   somGetClass()
  574. {
  575. /*
  576.  *  Return the receiver's class.
  577.  */
  578.    return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somGetClass)
  579.     (this);
  580. }
  581.  
  582.  
  583. /* method: somGetClassName */
  584. string   somGetClassName()
  585. {
  586. /*
  587.  *  Return the name of the receiver's class.
  588.  */
  589.    return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somGetClassName)
  590.     (this);
  591. }
  592.  
  593.  
  594. /* method: somGetSize */
  595. long   somGetSize()
  596. {
  597. /*
  598.  *  Return the size of the receiver.
  599.  */
  600.    return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somGetSize)
  601.     (this);
  602. }
  603.  
  604.  
  605. /* method: somIsA */
  606. boolean   somIsA(SOMClass* aClassObj)
  607. {
  608. /*
  609.  *  Returns 1 (true) if the receiver responds to methods
  610.  *  introduced by <aClassObj>, and 0 (false) otherwise.
  611.  */
  612.    return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somIsA)
  613.     (this,aClassObj);
  614. }
  615.  
  616.  
  617. /* method: somIsInstanceOf */
  618. boolean   somIsInstanceOf(SOMClass* aClassObj)
  619. {
  620. /*
  621.  *  Returns 1 (true) if the receiver is an instance of
  622.  *  <aClassObj> and 0 (false) otherwise.
  623.  */
  624.    return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somIsInstanceOf)
  625.     (this,aClassObj);
  626. }
  627.  
  628.  
  629. /* method: somRespondsTo */
  630. boolean   somRespondsTo(somId mId)
  631. {
  632. /*
  633.  *  Returns 1 (true) if the indicated method can be invoked
  634.  *  on the receiver and 0 (false) otherwise.
  635.  */
  636.    return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somRespondsTo)
  637.     (this,mId);
  638. }
  639.  
  640.  
  641. /* va_list method: somDispatch */
  642.  
  643. /*
  644.  *  This method provides a generic, class-specific dispatch mechanism.
  645.  *  It accepts as input <retValue> a pointer to the memory area to be
  646.  *  loaded with the result of dispatching the method indicated by
  647.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  648.  *  on which the method is to be invoked as the first argument.
  649.  */
  650. /* the va_list invocation form */
  651. boolean   SOMPAttrEncoderDecoder_somDispatch(somToken* retValue, 
  652.         somId methodId, 
  653.         va_list ap)
  654. {return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDispatch)
  655.     (this,retValue,methodId,ap);
  656. }
  657.  
  658. /* the varargs invocation form */
  659. boolean   somDispatch(somToken* retValue, 
  660.         somId methodId, 
  661.         ...)
  662. {
  663. /*
  664.  *  This method provides a generic, class-specific dispatch mechanism.
  665.  *  It accepts as input <retValue> a pointer to the memory area to be
  666.  *  loaded with the result of dispatching the method indicated by
  667.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  668.  *  on which the method is to be invoked as the first argument.
  669.  */
  670.    va_list ap;
  671.    va_start(ap, methodId);
  672.    boolean __somResult = 
  673.       SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDispatch)
  674.     (this,retValue,methodId,ap);
  675.    va_end(ap);
  676.    return __somResult;
  677. }
  678.  
  679.  
  680. /* va_list method: somClassDispatch */
  681.  
  682. /*
  683.  *  Like somDispatch, but method resolution for static methods is done
  684.  *  according to the clsObj instance method table.
  685.  */
  686. /* the va_list invocation form */
  687. boolean   SOMPAttrEncoderDecoder_somClassDispatch(SOMClass* clsObj, 
  688.         somToken* retValue, 
  689.         somId methodId, 
  690.         va_list ap)
  691. {return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somClassDispatch)
  692.     (this,clsObj,retValue,methodId,ap);
  693. }
  694.  
  695. /* the varargs invocation form */
  696. boolean   somClassDispatch(SOMClass* clsObj, 
  697.         somToken* retValue, 
  698.         somId methodId, 
  699.         ...)
  700. {
  701. /*
  702.  *  Like somDispatch, but method resolution for static methods is done
  703.  *  according to the clsObj instance method table.
  704.  */
  705.    va_list ap;
  706.    va_start(ap, methodId);
  707.    boolean __somResult = 
  708.       SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somClassDispatch)
  709.     (this,clsObj,retValue,methodId,ap);
  710.    va_end(ap);
  711.    return __somResult;
  712. }
  713.  
  714.  
  715. /* method: somCastObj */
  716. boolean   somCastObj(SOMClass* cls)
  717. {
  718. /*
  719.  *  cast the receiving object to cls (which must be an ancestor of the
  720.  *  objects true class. Returns true on success.
  721.  */
  722.    return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somCastObj)
  723.     (this,cls);
  724. }
  725.  
  726.  
  727. /* method: somResetObj */
  728. boolean   somResetObj()
  729. {
  730. /*
  731.  *  reset an object to its true class. Returns true always.
  732.  */
  733.    return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somResetObj)
  734.     (this);
  735. }
  736.  
  737.  
  738. /* va_list method: somDispatchV */
  739.  
  740. /*
  741.  *  Obsolete. Use somDispatch instead.
  742.  */
  743. /* the va_list invocation form */
  744. void   SOMPAttrEncoderDecoder_somDispatchV(somId methodId, 
  745.         somId descriptor, 
  746.         va_list ap)
  747. {   SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDispatchV)
  748.     (this,methodId,descriptor,ap);
  749. }
  750.  
  751. /* the varargs invocation form */
  752. void   somDispatchV(somId methodId, 
  753.         somId descriptor, 
  754.         ...)
  755. {
  756. /*
  757.  *  Obsolete. Use somDispatch instead.
  758.  */
  759.    va_list ap;
  760.    va_start(ap, descriptor);
  761.    SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDispatchV)
  762.     (this,methodId,descriptor,ap);
  763.    va_end(ap);
  764. }
  765.  
  766.  
  767. /* va_list method: somDispatchL */
  768.  
  769. /*
  770.  *  Obsolete. Use somDispatch instead.
  771.  */
  772. /* the va_list invocation form */
  773. long   SOMPAttrEncoderDecoder_somDispatchL(somId methodId, 
  774.         somId descriptor, 
  775.         va_list ap)
  776. {return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDispatchL)
  777.     (this,methodId,descriptor,ap);
  778. }
  779.  
  780. /* the varargs invocation form */
  781. long   somDispatchL(somId methodId, 
  782.         somId descriptor, 
  783.         ...)
  784. {
  785. /*
  786.  *  Obsolete. Use somDispatch instead.
  787.  */
  788.    va_list ap;
  789.    va_start(ap, descriptor);
  790.    long __somResult = 
  791.       SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDispatchL)
  792.     (this,methodId,descriptor,ap);
  793.    va_end(ap);
  794.    return __somResult;
  795. }
  796.  
  797.  
  798. /* va_list method: somDispatchA */
  799.  
  800. /*
  801.  *  Obsolete. Use somDispatch instead.
  802.  */
  803. /* the va_list invocation form */
  804. void*   SOMPAttrEncoderDecoder_somDispatchA(somId methodId, 
  805.         somId descriptor, 
  806.         va_list ap)
  807. {return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDispatchA)
  808.     (this,methodId,descriptor,ap);
  809. }
  810.  
  811. /* the varargs invocation form */
  812. void*   somDispatchA(somId methodId, 
  813.         somId descriptor, 
  814.         ...)
  815. {
  816. /*
  817.  *  Obsolete. Use somDispatch instead.
  818.  */
  819.    va_list ap;
  820.    va_start(ap, descriptor);
  821.    void* __somResult = 
  822.       SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDispatchA)
  823.     (this,methodId,descriptor,ap);
  824.    va_end(ap);
  825.    return __somResult;
  826. }
  827.  
  828.  
  829. /* va_list method: somDispatchD */
  830.  
  831. /*
  832.  *  Obsolete. Use somDispatch instead.
  833.  */
  834. /* the va_list invocation form */
  835. double   SOMPAttrEncoderDecoder_somDispatchD(somId methodId, 
  836.         somId descriptor, 
  837.         va_list ap)
  838. {return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDispatchD)
  839.     (this,methodId,descriptor,ap);
  840. }
  841.  
  842. /* the varargs invocation form */
  843. double   somDispatchD(somId methodId, 
  844.         somId descriptor, 
  845.         ...)
  846. {
  847. /*
  848.  *  Obsolete. Use somDispatch instead.
  849.  */
  850.    va_list ap;
  851.    va_start(ap, descriptor);
  852.    double __somResult = 
  853.       SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDispatchD)
  854.     (this,methodId,descriptor,ap);
  855.    va_end(ap);
  856.    return __somResult;
  857. }
  858.  
  859.  
  860. /* method: somPrintSelf */
  861. SOMObject*   somPrintSelf()
  862. {
  863. /*
  864.  *  Uses <SOMOutCharRoutine> to write a brief string with identifying
  865.  *  information about this object.  The default implementation just gives
  866.  *  the object's class name and its address in memory.
  867.  *  <self> is returned.
  868.  */
  869.    return SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somPrintSelf)
  870.     (this);
  871. }
  872.  
  873.  
  874. /* method: somDumpSelf */
  875. void   somDumpSelf(long level)
  876. {
  877. /*
  878.  *  Uses <SOMOutCharRoutine> to write a detailed description of this object
  879.  *  and its current state.
  880.  * 
  881.  *  <level> indicates the nesting level for describing compound objects
  882.  *  it must be greater than or equal to zero.  All lines in the
  883.  *  description will be preceeded by <2*level> spaces.
  884.  * 
  885.  *  This routine only actually writes the data that concerns the object
  886.  *  as a whole, such as class, and uses <somDumpSelfInt> to describe
  887.  *  the object's current state.  This approach allows readable
  888.  *  descriptions of compound objects to be constructed.
  889.  * 
  890.  *  Generally it is not necessary to override this method, if it is
  891.  *  overriden it generally must be completely replaced.
  892.  */
  893.    SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDumpSelf)
  894.     (this,level);
  895. }
  896.  
  897.  
  898. /* method: somDumpSelfInt */
  899. void   somDumpSelfInt(long level)
  900. {
  901. /*
  902.  *  Uses <SOMOutCharRoutine> to write in the current state of this object.
  903.  *  Generally this method will need to be overridden.  When overriding
  904.  *  it, begin by calling the parent class form of this method and then
  905.  *  write in a description of your class's instance data. This will
  906.  *  result in a description of all the object's instance data going
  907.  *  from its root ancestor class to its specific class.
  908.  */
  909.    SOM_ResolveD(this,SOMPAttrEncoderDecoder,SOMObject,somDumpSelfInt)
  910.     (this,level);
  911. }
  912.  
  913.  
  914.  
  915. };   /* SOMPAttrEncoderDecoder */
  916.  
  917.  
  918.  
  919. #endif       /* SOM_SOMPAttrEncoderDecoder_xh */
  920.