home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * This file was generated by the SOM Compiler.
- * Generated using:
- * SOM incremental update: 2.33
- */
-
-
- /*
- File: ODDesc.cpp
-
- Contains: Implementation of ODDesc class
-
- Owned by: Nick Pilch
-
- Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <9> 8/25/95 NP 1269331: Empty ODDescs have type typeNull,
- not 'dead'.
- <8> 8/16/95 NP 1275241: IDL Review. Remove unnecessary
- overrides.
- <7> 8/3/95 RR #1257260: Collapse B classes. Remove
- somInit methods. Don't call IsInitialized
- or SubclassResponsibility
- <6> 6/22/95 NP Put ODDebug around memory trashing code.
- <5> 6/20/95 NP 1261016: Added debug code.
- <4> 5/21/95 NP 1248898: GetUserToken, ODDescToAEDesc, etc.
- recipe change.
- <3> 3/2/95 eeh 1214783: add assert to ODDescSetAEDesc
- <2> 2/3/95 eeh 1217393: re-add AEDisposeDesc to
- ODDescsomUninit
- <1> 1/26/95 NP first checked in
-
- To Do:
- */
-
- #define ODDesc_Class_Source
- #define VARIABLE_MACROS
- #include <ODDesc.xih>
-
- #ifndef __APPLEEVENTS__
- #include <AppleEvents.h>
- #endif
-
- #ifndef _BARRAY_
- #include "BArray.h"
- #endif
-
- //------------------------------------------------------------------------------
- // ODDescInitODDesc
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK ODDescInitODDesc(ODDesc *somSelf, Environment *ev)
- {
- ODDescData *somThis = ODDescGetData(somSelf);
- ODDescMethodDebug("ODDesc","ODDescInitODDesc");
-
- // LAZILY ALLOCATE STRUCT. PREVENTS UNNECESSARY MEMORY ALLOCATIONS
- // SET DATA DEFAULTS TO VALUES THAT WILL CAUSE ACCESS FAULTS OR WILL LOOK
- // SUSPICIOUS IN A DEBUGGER.
-
- // _fDescType = 'dead';
- _fDescType = typeNull;
- _fData._maximum = 0xFFFFFFFF;
- _fData._length = 0xFFFFFFFF;
- _fData._buffer = (octet*)0x50FF8001;
- _fAllocated = kODFalse;
-
- SOM_TRY
-
- somSelf->InitObject(ev);
-
- SOM_CATCH_ALL
- SOM_ENDTRY
-
- }
-
- //------------------------------------------------------------------------------
- // ODDescsomUninit
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK ODDescsomUninit(ODDesc *somSelf)
- {
- ODDescData *somThis = ODDescGetData(somSelf);
- ODDescMethodDebug("ODDesc","ODDescsomUninit");
-
- #if ODDebug
- _fDescType = 'dead';
- #endif
-
- if (_fAllocated)
- {
- #if ODDebug
- _fAllocated = 459867;
- octet* dataPtr = _fData._buffer;
- ODULong i;
- for (i = 0; i < _fData._length; i++)
- {
- *dataPtr = 0xef;
- ++dataPtr;
- }
- #endif
- DisposeByteArrayStruct(_fData);
- #if ODDebug
- _fData._maximum = 0xFFFFFFFF;
- _fData._length = 0xFFFFFFFF;
- _fData._buffer = (octet*)0x50FF8001;
- #endif
- }
- }
-
- //------------------------------------------------------------------------------
- // ODDescSetDescType
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK ODDescSetDescType(ODDesc *somSelf, Environment *ev,
- ODDescType descType)
- {
- ODDescData *somThis = ODDescGetData(somSelf);
- ODDescMethodDebug("ODDesc","ODDescSetDescType");
-
- _fDescType = descType;
- }
-
- //------------------------------------------------------------------------------
- // ODDescSetRawData
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK ODDescSetRawData(ODDesc *somSelf, Environment *ev,
- ODByteArray* data)
- {
- ODDescData *somThis = ODDescGetData(somSelf);
- ODDescMethodDebug("ODDesc","ODDescSetRawData");
-
- SOM_TRY
- if (_fAllocated)
- DisposeByteArrayStruct(_fData);
- _fData = CopyByteArrayStruct(data);
- _fAllocated = kODTrue;
- SOM_CATCH_ALL
- SOM_ENDTRY
- }
-
- //------------------------------------------------------------------------------
- // ODDescGetDescType
- //------------------------------------------------------------------------------
-
- SOM_Scope ODDescType SOMLINK ODDescGetDescType(ODDesc *somSelf, Environment *ev)
- {
- ODDescData *somThis = ODDescGetData(somSelf);
- ODDescMethodDebug("ODDesc","ODDescGetDescType");
-
- return _fDescType;
- }
-
- //------------------------------------------------------------------------------
- // ODDescGetRawData
- //------------------------------------------------------------------------------
-
- SOM_Scope ODByteArray SOMLINK ODDescGetRawData(ODDesc *somSelf, Environment *ev)
- {
- ODDescData *somThis = ODDescGetData(somSelf);
- ODDescMethodDebug("ODDesc","ODDescGetRawData");
-
- ODByteArray result;
-
- SOM_TRY
- if (!_fAllocated)
- result = CreateEmptyByteArrayStruct(0);
- else
- result = CopyByteArrayStruct(&_fData);
- SOM_CATCH_ALL
- SOM_ENDTRY
-
- return result;
- }
-
- #if 0
- SOM_Scope AEDesc* SOMLINK ODDescGetAEDesc(ODDesc *somSelf, Environment *ev)
- {
- ODDescData *somThis = ODDescGetData(somSelf);
- ODDescMethodDebug("ODDesc","ODDescGetAEDesc");
-
- return _fDesc;
- }
-
- SOM_Scope void SOMLINK ODDescSetAEDesc(ODDesc *somSelf, Environment *ev,
- AEDesc* desc)
- {
- ODDescData *somThis = ODDescGetData(somSelf);
- ODDescMethodDebug("ODDesc","ODDescSetAEDesc");
-
- WASSERT( !_fHadToAllocate );
- _fDesc = desc;
- }
-
- SOM_Scope void SOMLINK ODDescSetHadToAllocate(ODDesc *somSelf, Environment *ev)
- {
- ODDescData *somThis = ODDescGetData(somSelf);
- ODDescMethodDebug("ODDesc","ODDescSetAEDesc");
-
- _fHadToAllocate = kODTrue;
- }
- #endif /* 0 */
-