home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / TEMPOBJ.H < prev    next >
C/C++ Source or Header  |  1997-02-28  |  19KB  |  736 lines

  1. //====START_GENERATED_PROLOG======================================
  2. //
  3. //
  4. //   COMPONENT_NAME: odutils
  5. //
  6. //   CLASSES:   BaseTempObj
  7. //        BaseTempRef
  8. //        TempAEDesc
  9. //        TempODByteArray
  10. //        TempODByteArrayStruct
  11. //        TempODHandle
  12. //        TempODHandleLock
  13. //        TempODIText
  14. //        TempODPasteAsResult
  15. //        TempODPtr
  16. //        TempODString
  17. //        TempPlatformFile
  18. //
  19. //   ORIGINS: 82,27
  20. //
  21. //
  22. //   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  23. //   All Rights Reserved
  24. //   Licensed Materials - Property of IBM
  25. //   US Government Users Restricted Rights - Use, duplication or
  26. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  27. //       
  28. //   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  29. //   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  30. //   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  31. //   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  32. //   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  33. //   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  34. //   OR PERFORMANCE OF THIS SOFTWARE.
  35. //
  36. //====END_GENERATED_PROLOG========================================
  37. //
  38. // @(#) 1.8 com/src/utils/include/TempObj.h, odutils, od96os2, odos29646d 8/19/96 11:57:59 [ 11/15/96 15:29:03 ]
  39. /*
  40.     File:        TempObj.h
  41.  
  42.     Contains:    Template utilities for exception-safe temporary object references
  43.  
  44.     Owned by:    Jens Alfke
  45.  
  46.     Copyright:    ⌐ 1995 by Apple Computer, Inc., all rights reserved.
  47.  
  48.     Theory Of Operation:
  49.     
  50.         *** See the Tech Note "Temporary References/Objects" for full documentation.
  51.         
  52.     
  53.         TempObj<T>        T :ODObject                A pointer to a temporary object
  54.         TempRef<T>        T :ODRefCntObject        A pointer to a temporary reference
  55.         
  56.         These are simple template classes that act as a transparent wrapper around
  57.         an OpenDoc object pointer. The temp object can be used wherever a pointer
  58.         to the object would be used. When the temp object goes out of scope, the
  59.         object it wraps will be deleted (in the case of TempObj) or released (in
  60.         the case of TempRef.) This includes the case where an exception is thrown:
  61.         the wrapper is exception-safe.
  62.         
  63.         Example:
  64.         
  65.             RgnHandle r;
  66.             {
  67.                 TempODShape s = frame->GetUsedShape(ev,kODNULL);
  68.                 r = s->CopyQDRegion(ev);
  69.             }
  70.         
  71.         In this example, s is wrapped around the actual ODShape returned by
  72.         the GetUsedShape method. It is used just as an ODShape* in the next
  73.         line. In the normal course of events, the shape will be released after
  74.         GetQDRegion returns, since s goes out of scope. If GetUsedShape runs
  75.         out of memory and throws an exception, the shape will also be safely
  76.         released.
  77.         
  78.         There is a certain amount of overhead associated with the TempRef
  79.         object. However, the only safe alternative to using it would be to
  80.         wrap an exception handler around the call to GetUsedShape and release
  81.         the shape in the CATCH block (and then reraise the exception) as well
  82.         as after the ENDTRY. This ends up using significantly more code and
  83.         execution time than the TempRef object -- exception handlers are
  84.         quite expensive.
  85.  
  86.     In Progress:
  87.         
  88. */
  89.  
  90. #ifndef _TEMPOBJ_
  91. #define _TEMPOBJ_
  92.  
  93. #ifndef _ODEXCEPT_
  94. #include <ODExcept.h>
  95. #endif
  96.  
  97. #ifndef SOM_ODRefCntObject_xh
  98. #include "Part.xh"
  99. #endif
  100.  
  101. #ifndef SOM_ODWindow_xh
  102. #include "Window.xh"
  103. #endif
  104.  
  105. #ifndef _ODTYPES_
  106. #include <ODTypes.h>
  107. #endif
  108.  
  109. #ifndef _ODMVCLNK_
  110. #include <ODMvcLnk.h>
  111. #endif
  112.  
  113.  
  114. #ifdef _PLATFORM_MACINTOSH_
  115. class TempODPtr :Destructo
  116. #else
  117. #ifdef _NATIVE_EXCEPTIONS_  // OD_BUG?
  118. class TempODPtr
  119. #else
  120. class TempODPtr : private Destructo
  121. #endif
  122. #endif
  123. {
  124.     public:
  125.     _DLLIMPORTEXPORT_ TempODPtr( );
  126.     _DLLIMPORTEXPORT_ TempODPtr( void *block );
  127.     _DLLIMPORTEXPORT_ ~TempODPtr( );
  128.     operator void* ( )                {return fBlock;}
  129.     void* operator= ( void *b )        {return (fBlock = b);}
  130.     
  131.     protected:
  132.     void* fBlock;
  133.  
  134.     private: // disallow these:
  135.     TempODPtr(const TempODPtr& );
  136.     void operator=(const TempODPtr& );
  137. };
  138.  
  139. #ifdef _PLATFORM_MACINTOSH_
  140. class BaseTempObj :Destructo
  141. #else
  142. #ifdef _NATIVE_EXCEPTIONS_  // OD_BUG?
  143. class BaseTempObj
  144. #else
  145. class BaseTempObj : private Destructo
  146. #endif
  147. #endif
  148. {
  149.     public:
  150.     _DLLIMPORTEXPORT_ virtual ~BaseTempObj();
  151.     
  152.     protected:
  153.     ODObject *fObj;
  154.     BaseTempObj( );
  155.  
  156.     private: // disallow these:
  157.     BaseTempObj(const BaseTempObj& );
  158.     void operator=(const BaseTempObj& );
  159.     // Bitwise assigning one destructo to another smashes
  160.     // a list link with potentially unpleasant effects.
  161. };
  162.  
  163. #ifdef _PLATFORM_MACINTOSH_
  164. class BaseTempRef :Destructo
  165. #else
  166. #ifdef _NATIVE_EXCEPTIONS_  // OD_BUG?
  167. class BaseTempRef
  168. #else
  169. class BaseTempRef : private Destructo
  170. #endif
  171. #endif
  172. {
  173.     public:
  174.     _DLLIMPORTEXPORT_ void Release();
  175.     _DLLIMPORTEXPORT_ virtual ~BaseTempRef();
  176.     
  177.     protected:
  178.     ODRefCntObject *fObj;
  179.     BaseTempRef( );
  180.  
  181.     private: // disallow these:
  182.     BaseTempRef(const BaseTempRef& );
  183.     void operator=(const BaseTempRef& );
  184.     // Bitwise assigning one destructo to another smashes
  185.     // a list link with potentially unpleasant effects.
  186. };
  187.  
  188.  
  189. #ifdef _USE_TEMPLATES_
  190.  
  191.  
  192.     //===========================================================================
  193.     //    TempObj <T>
  194.     //===========================================================================
  195.     
  196.     
  197.     template<class T> class TempObj :public BaseTempObj
  198.     {
  199.         public:
  200.         TempObj( T* );
  201.         T* operator-> ()        {return (T*)fObj;}
  202.         operator T* ()            {return (T*)fObj;}
  203.     
  204.         T* operator= (T* t)        {fObj=t; return t;}
  205.         
  206.         T* DontDelete()            {T* temp=(T*)fObj; fObj=kODNULL; return temp;}
  207.     };
  208.     
  209.     // Implementation of the TempObj constructor:
  210.     template<class T> TempObj<T>::TempObj( T *obj )
  211.     {
  212.         fObj = obj;
  213.     }
  214.     
  215.     
  216.     //===========================================================================
  217.     //    TempRef <T>
  218.     //
  219.     //    Supports a few extra goodies:
  220.     //        Release()        Releases the object and sets the pointer to NULL.
  221.     //        DontRelease()    Sets the pointer to NULL (so the destructor will not
  222.     //                            release the object) but returns the old pointer.
  223.     //
  224.     //===========================================================================
  225.     
  226.     
  227.     template<class T> class TempRef :public BaseTempRef
  228.     {
  229.         public:
  230.         TempRef( T* );
  231.         T* operator-> ()        {return (T*)fObj;}
  232.         operator T* ()            {return (T*)fObj;}
  233.         T* operator=( T *t )    {fObj=t; return t;}
  234.         
  235.         T* DontRelease()        {T* temp=(T*)fObj; fObj=kODNULL; return temp;}
  236.     };
  237.     
  238.     
  239.     // Implementation of the TempRef constructor:
  240.     template<class T> TempRef<T>::TempRef( T *obj )
  241.     {
  242.         fObj = obj;
  243.     }
  244.  
  245.  
  246. #endif /*_USE_TEMPLATES_*/    
  247.  
  248.  
  249. //===========================================================================
  250. //    Instantiations of TempObj and TempRef. Add your own if necessary.
  251. //===========================================================================
  252.  
  253. class ODFocusSetIterator;
  254. class ODSession;
  255. class ODTypeList;
  256. class ODStorageUnitView;
  257.  
  258. class ODExtension;
  259. class ODSettingExtension;
  260.  
  261. class ODFrame;
  262. class ODPart;
  263. class ODShape;
  264. class ODTransform;
  265. class ODStorageUnit;
  266.  
  267. class ODDraft;
  268. class ODDocument;
  269. class ODContainer;
  270. class ODLink;
  271. class ODLinkSource;
  272. class ODMenuBar;
  273.  
  274. #ifdef _USE_TEMPLATES_
  275.  
  276.     typedef TempObj<ODObject>                TempODObject;
  277.     typedef TempObj<ODSession>                TempODSession;
  278.     typedef TempObj<ODTypeList>                TempODTypeList;
  279.     typedef TempObj<ODStorageUnitView>        TempODStorageUnitView;
  280.     
  281.     //typedef TempRef<ODExtension>            TempODExtension;
  282.     //typedef TempRef<ODSettingExtension>        TempODSettingExtension;
  283.  
  284.     typedef TempRef<ODRefCntObject>            TempODRefCntObject;
  285.     typedef TempRef<ODWindow>                TempODWindow;
  286.     typedef TempRef<ODFrame>                TempODFrame;
  287.     typedef TempRef<ODPart>                    TempODPart;
  288.     typedef TempRef<ODShape>                TempODShape;
  289.     typedef TempRef<ODTransform>            TempODTransform;
  290.     typedef TempRef<ODStorageUnit>            TempODStorageUnit;
  291.  
  292.     typedef TempRef<ODDraft>                TempODDraft;
  293.     typedef TempRef<ODDocument>                TempODDocument;
  294.     typedef TempRef<ODContainer>            TempODContainer;
  295.     typedef TempRef<ODLink>                    TempODLink;
  296.     typedef TempRef<ODLinkSource>            TempODLinkSource;
  297.     typedef TempRef<ODMenuBar>                TempODMenuBar;
  298.  
  299. #else /* not _USE_TEMPLATES_ */
  300.  
  301.     #ifdef __MWERKS__
  302.         // Make sure 'pragma once' mode is off so the .th files can be included
  303.         // more than once!
  304.         #pragma push
  305.         #pragma once off
  306.     #endif
  307.  
  308.     /* If not using templates, we rely on the preprocessor. A "template" for an
  309.         instantiation of TempObj is in TempObj.th, and for TempRef in TempRef.th.
  310.         Include one of these headers per instantiation. */
  311.  
  312.     #define _T_        ODObject
  313.     #define _C_        TempODObject
  314.     #include "TempObj.th"
  315.     #define _T_        ODSession
  316.     #define _C_        TempODSession
  317.     #include "TempObj.th"
  318.     #define _T_        ODTypeList
  319.     #define _C_        TempODTypeList
  320.     #include "TempObj.th"
  321.     #define _T_        ODStorageUnitView
  322.     #define _C_        TempODStorageUnitView
  323.     #include "TempObj.th"
  324.     
  325.     #define _T_        ODRefCntObject
  326.     #define _C_        TempODRefCntObject
  327.     #include "TempRef.th"
  328.     #define _T_        ODWindow
  329.     #define _C_        TempODWindow
  330.     #include "TempRef.th"
  331.     #define _T_        ODFrame
  332.     #define _C_        TempODFrame
  333.     #include "TempRef.th"
  334.     #define _T_        ODPart
  335.     #define _C_        TempODPart
  336.     #include "TempRef.th"
  337.     #define _T_        ODShape
  338.     #define _C_        TempODShape
  339.     #include "TempRef.th"
  340.     #define _T_        ODTransform
  341.     #define _C_        TempODTransform
  342.     #include "TempRef.th"
  343.     #define _T_        ODStorageUnit
  344.     #define _C_        TempODStorageUnit
  345.     #include "TempRef.th"
  346.  
  347.     #define _T_        ODDraft
  348.     #define _C_        TempODDraft
  349.     #include "TempRef.th"
  350.     #define _T_        ODDocument
  351.     #define _C_        TempODDocument
  352.     #include "TempRef.th"
  353.     #define _T_        ODContainer
  354.     #define _C_        TempODContainer
  355.     #include "TempRef.th"
  356.     #define _T_        ODLink
  357.     #define _C_        TempODLink
  358.     #include "TempRef.th"
  359.     #define _T_        ODLinkSource
  360.     #define _C_        TempODLinkSource
  361.     #include "TempRef.th"
  362.     #define _T_        ODMenuBar
  363.     #define _C_        TempODMenuBar
  364.     #include "TempRef.th"
  365.  
  366. /*
  367.     #define _T_        ODExtension
  368.     #define _C_        TempODExtension
  369.     #include "TempRef.th"
  370.     #define _T_        ODSettingsExtension
  371.     #define _C_        TempODSettingsExtension
  372.     #include "TempRef.th"
  373. */
  374.     #ifdef __MWERKS__
  375.         #pragma pop
  376.     #endif
  377.  
  378. #endif /*_USE_TEMPLATES_*/
  379.  
  380.  
  381. //===========================================================================
  382. //    Temp strings.
  383. //===========================================================================
  384.  
  385. #ifdef _PLATFORM_MACINTOSH_
  386. class TempODString :Destructo
  387. #else
  388. #ifdef _NATIVE_EXCEPTIONS_  // OD_BUG?
  389. class TempODString
  390. #else
  391. class TempODString : private Destructo
  392. #endif
  393. #endif
  394. {
  395.     protected:
  396.     char* fStr; 
  397.  
  398.     public:
  399.     _DLLIMPORTEXPORT_ ~TempODString();
  400.     _DLLIMPORTEXPORT_ TempODString( char* );
  401.     operator char* ()         { return fStr; }
  402.  
  403.     char* operator= (char* s) { fStr = s; return s; }
  404.     
  405.     char* DontDelete()        { char* s = fStr; fStr = kODNULL; return s;}
  406.  
  407.     private: // disallow these:
  408.     TempODString( );
  409.     TempODString(const TempODString& );
  410.     void operator=(const TempODString& );
  411. };
  412.  
  413. // typedef string  ODISOStr;
  414.     // typedef ODISOStr ODContainerType;
  415.     // typedef ODISOStr  ODPropertyName;
  416.     // typedef ODISOStr  ODStorageUnitName;
  417.     // typedef    ODISOStr    ODDraftName;
  418.  
  419.     // typedef ODISOStr  ODType;
  420.         // typedef ODType    ODValueType;
  421.         // typedef ODType   ODObjectType;
  422.         // typedef ODType   ODFocusType;
  423.  
  424. // typedef char* ODEditor;
  425.  
  426.  
  427. typedef TempODString TempODISOStr;
  428. typedef TempODString TempODType;
  429. typedef TempODString TempODValueType;
  430. typedef TempODString TempODObjectType;
  431. typedef TempODString TempODFocusType;
  432. typedef TempODString TempODContainerType;
  433. typedef TempODString TempODPropertyName;
  434. typedef TempODString TempODStorageUnitName;
  435. typedef TempODString TempODDraftName;
  436. typedef TempODString TempStringPtr;
  437.  
  438. typedef TempODString TempODEditor;
  439.  
  440. #ifdef __PRIVATE__
  441. //===========================================================================
  442. //    Temp handles.
  443. //===========================================================================
  444.  
  445. #ifdef _PLATFORM_MACINTOSH_
  446. class TempODHandle :Destructo
  447. #else
  448. #ifdef _NATIVE_EXCEPTIONS_  // OD_BUG?
  449. class TempODHandle
  450. #else
  451. class TempODHandle : private Destructo
  452. #endif
  453. #endif
  454. {
  455.     protected:
  456.     ODHandle fHandle; 
  457.  
  458.     public:
  459.     ~TempODHandle();
  460.     TempODHandle( ODHandle );
  461.     operator ODHandle ()           { return fHandle; }
  462.  
  463.     ODHandle operator= (ODHandle h)
  464.     { fHandle = h; return h; }
  465.     
  466.     ODHandle DontDelete()
  467.     { ODHandle h = fHandle; fHandle = kODNULL; return h;}
  468.  
  469.     private: // disallow these:
  470.     TempODHandle( );
  471.     TempODHandle(const TempODHandle& );
  472.     void operator=(const TempODHandle& );
  473. };
  474.  
  475. #ifdef _PLATFORM_MACINTOSH_
  476. class TempODHandleLock :Destructo
  477. #else
  478. #ifdef _NATIVE_EXCEPTIONS_  // OD_BUG?
  479. class TempODHandleLock
  480. #else
  481. class TempODHandleLock : private Destructo
  482. #endif
  483. #endif
  484. {
  485.     protected:
  486.     ODHandle fHandle; 
  487.  
  488.     public:
  489.     ~TempODHandleLock();            // unlocks the handle
  490.     TempODHandleLock( ODHandle );   // locks the handle
  491.     operator ODHandle ()           { return fHandle; }
  492.  
  493.     ODHandle operator= (ODHandle h)
  494.     { fHandle = h; return h; }
  495.  
  496.     private: // disallow these:
  497.     TempODHandleLock( );
  498.     TempODHandleLock(const TempODHandleLock& );
  499.     void operator=(const TempODHandleLock& );
  500. };
  501.  
  502. //===========================================================================
  503. //    Temp platform files.
  504. //===========================================================================
  505.  
  506. class PlatformFile;
  507.  
  508. #ifdef _PLATFORM_MACINTOSH_
  509. class TempPlatformFile :Destructo
  510. #else
  511. #ifdef _NATIVE_EXCEPTIONS_  // OD_BUG?
  512. class TempPlatformFile
  513. #else
  514. class TempPlatformFile : private Destructo
  515. #endif
  516. #endif
  517. {
  518.     protected:
  519.     PlatformFile* fFile; 
  520.  
  521.     public:
  522.     ~TempPlatformFile();
  523.     TempPlatformFile( PlatformFile* );
  524.     PlatformFile* operator-> ()         { return fFile; }
  525.     operator PlatformFile* ()           { return fFile; }
  526.  
  527.     PlatformFile* operator= (PlatformFile* f)
  528.     { fFile = f; return f; }
  529.     
  530.     PlatformFile* DontDelete()
  531.     { PlatformFile* f = fFile; fFile = kODNULL; return f;}
  532.  
  533.     private: // disallow these:
  534.     TempPlatformFile( );
  535.     TempPlatformFile(const TempPlatformFile& );
  536.     void operator=(const TempPlatformFile& );
  537. };
  538. #endif // __PRIVATE__
  539.  
  540. //===========================================================================
  541. //    Temp ODPasteAsResult.
  542. //===========================================================================
  543.  
  544. // struct ODPasteAsResult; // from ODTypesM.xh
  545.  
  546. #ifdef _PLATFORM_MACINTOSH_
  547. class TempODPasteAsResult :Destructo
  548. #else
  549. #ifdef _NATIVE_EXCEPTIONS_  // OD_BUG?
  550. class TempODPasteAsResult
  551. #else
  552. class TempODPasteAsResult : private Destructo
  553. #endif
  554. #endif
  555. {
  556.     protected:
  557.     ODPasteAsResult* fResult; 
  558.  
  559.     public:
  560.     _DLLIMPORTEXPORT_ ~TempODPasteAsResult();
  561.     _DLLIMPORTEXPORT_ TempODPasteAsResult( ODPasteAsResult* );
  562.     ODPasteAsResult* operator-> ()         { return fResult; }
  563.     operator ODPasteAsResult* ()           { return fResult; }
  564.  
  565.     ODPasteAsResult* operator= (ODPasteAsResult* r)
  566.     { fResult = r; return r; }
  567.     
  568.     ODPasteAsResult* DontDelete()
  569.     { ODPasteAsResult* r = fResult; fResult = kODNULL; return r;}
  570.  
  571.     private: // disallow these:
  572.     TempODPasteAsResult( );
  573.     TempODPasteAsResult(const TempODPasteAsResult& );
  574.     void operator=(const TempODPasteAsResult& );
  575. };
  576.  
  577.  
  578. #ifdef _PLATFORM_MACINTOSH_
  579. //===========================================================================
  580. //    Temp AEDescs.
  581. //===========================================================================
  582.  
  583. struct AEDesc;
  584.  
  585. class TempAEDesc :Destructo
  586. {
  587.     protected:
  588.     AEDesc* fDesc; 
  589.  
  590.     public:
  591.     ~TempAEDesc();
  592.     TempAEDesc( AEDesc* );
  593.     AEDesc* operator-> ()         { return fDesc; }
  594.     operator AEDesc* ()           { return fDesc; }
  595.  
  596.     AEDesc* operator= (AEDesc* d)
  597.     { fDesc = d; return d; }
  598.     
  599.     AEDesc* DontDelete()
  600.     { AEDesc* d = fDesc; fDesc = kODNULL; return d;}
  601.  
  602.     private: // disallow these:
  603.     TempAEDesc( );
  604.     TempAEDesc(const TempAEDesc& );
  605.     void operator=(const TempAEDesc& );
  606. };
  607. #endif
  608.  
  609.  
  610. //===========================================================================
  611. //    Temp ODIText.
  612. //===========================================================================
  613.  
  614. class ODIText;
  615.  
  616. #ifdef _PLATFORM_MACINTOSH_
  617. class TempODIText :Destructo
  618. #else
  619. #ifdef _NATIVE_EXCEPTIONS_  // OD_BUG?
  620. class TempODIText
  621. #else
  622. class TempODIText : private Destructo
  623. #endif
  624. #endif
  625. {
  626.     protected:
  627.     ODIText* fText; 
  628.  
  629.     public:
  630.     _DLLIMPORTEXPORT_ ~TempODIText();
  631.     _DLLIMPORTEXPORT_ TempODIText( ODIText* );
  632.     ODIText* operator-> ()          { return fText; }
  633.     operator ODIText* ()            { return fText; }
  634.  
  635.     ODIText* operator= (ODIText* t)
  636.     { fText = t; return t; }
  637.     
  638.     ODIText* DontDelete()
  639.     { ODIText* t = fText; fText = kODNULL; return t;}
  640.  
  641.     private: // disallow these:
  642.     TempODIText( );
  643.     TempODIText(const TempODIText& );
  644.     void operator=(const TempODIText& );
  645. };
  646.  
  647. // typedef ODIText ODName; 
  648. // typedef ODName  ODDocumentName;
  649.  
  650. typedef TempODIText TempODName;
  651. typedef TempODIText TempODDocumentName;
  652.  
  653. //===========================================================================
  654. //    Temp byte arrays.
  655. //===========================================================================
  656.  
  657. #ifdef _PLATFORM_MACINTOSH_
  658. class TempODByteArray :Destructo
  659. #else
  660. #ifdef _NATIVE_EXCEPTIONS_  // OD_BUG?
  661. class TempODByteArray
  662. #else
  663. class TempODByteArray : private Destructo
  664. #endif
  665. #endif
  666. {
  667.     protected:
  668.     ODByteArray* fBA; 
  669.  
  670.     public:
  671.     _DLLIMPORTEXPORT_ ~TempODByteArray();
  672.     _DLLIMPORTEXPORT_ TempODByteArray( ODByteArray* );
  673.     ODByteArray* operator-> ()          { return fBA; }
  674.     operator ODByteArray* ()            { return fBA; }
  675.  
  676.     ODByteArray* operator= (ODByteArray* ba) 
  677.     { fBA = ba; return ba; }
  678.     
  679.     ODByteArray* DontDelete()           
  680.     { ODByteArray* ba = fBA; fBA = kODNULL; return ba;}
  681.  
  682.     private: // disallow these:
  683.     TempODByteArray( );
  684.     TempODByteArray(const TempODByteArray& );
  685.     void operator=(const TempODByteArray& );
  686. };
  687.  
  688. #ifdef _PLATFORM_MACINTOSH_
  689. class TempODByteArrayStruct :Destructo
  690. #else
  691. #ifdef _NATIVE_EXCEPTIONS_  // OD_BUG?
  692. class TempODByteArrayStruct
  693. #else
  694. class TempODByteArrayStruct : private Destructo
  695. #endif
  696. #endif
  697. {
  698.     protected:
  699.     ODByteArray fBA; 
  700.  
  701.     public:
  702.     _DLLIMPORTEXPORT_ ~TempODByteArrayStruct();
  703.     _DLLIMPORTEXPORT_ TempODByteArrayStruct( );
  704.     _DLLIMPORTEXPORT_ TempODByteArrayStruct( ODByteArray ba );
  705.     ODByteArray* operator-> ()          { return &fBA; }
  706.     operator ODByteArray* ()            { return &fBA; }
  707.  
  708.     ODByteArray operator= ( ODByteArray ba ) 
  709.     { fBA = ba; return ba; }
  710.     
  711.     void DontDelete()           
  712.     { fBA._buffer = kODNULL;}
  713.  
  714.     private: // disallow these:
  715.     TempODByteArrayStruct(const TempODByteArrayStruct& );
  716.     void operator=(const TempODByteArrayStruct& );
  717. };
  718.  
  719. // typedef ODByteArray ODContainerID;
  720. // typedef ODByteArray ODActionData;
  721. // typedef ODByteArray ODContour;
  722. // typedef ODByteArray ODPolygon;
  723.  
  724. typedef TempODByteArray TempODContainerID;
  725. typedef TempODByteArray TempODActionData;
  726. typedef TempODByteArray TempODContour;
  727. // typedef TempODByteArray TempODPolygon; // use ODTempPolygon instead
  728.  
  729. typedef TempODByteArrayStruct TempODContainerIDStruct;
  730. typedef TempODByteArrayStruct TempODActionDataStruct;
  731. typedef TempODByteArrayStruct TempODContourStruct;
  732. // typedef TempODByteArrayStruct TempODPolygonStruct;
  733.  
  734.  
  735. #endif /*_TEMPOBJ_*/
  736.