home *** CD-ROM | disk | FTP | other *** search
- --------------------------------------------------------------------------------
- -- FILE NAME: WIZCLASS.CT
- --
- -- DESCRIPTION:
- -- OLE Compound Document Framework class file template
- --
- -- COPYRIGHT:
- -- IBM Open Class Library
- -- (C) Copyright International Business Machines Corporation 1992, 1996
- -- Licensed Material - Program-Property of IBM - All Rights Reserved.
- -- US Government Users Restricted Rights - Use, duplication, or disclosure
- -- restricted by GSA ADP Schedule Contract with IBM Corp.
- --
- --------------------------------------------------------------------------------
- <include wizfile.ct>
- <define NULL>\</define>
- --------------------------------------------------------------------------------
- -- Basic class template
- --------------------------------------------------------------------------------
- <code CLASS>
- <define FILE_SRC_CLASSES>
- //----------------------------------------------------------------------
- // $CLASS_NAME$ Methods
- //----------------------------------------------------------------------
- $CLASS_MACROS$\<>
- $CLASS_MEMBERS$
- $STATIONERY_DEF$
- </define>
- <clear CLASS_NAME>
- <clear CLASS_MACROS>
- <clear CLASS_MEMBERS>
- <clear CLASS_MEMBERS_NOT_OLE>
- <clear CLASS_MEMBERS_OLE>
- <clear CLASS_SUPERS>
- <clear STATIONERY_DEF>
- </code CLASS>
-
- -------------------------------------------------------------------------------
- -- Standard operations template
- --------------------------------------------------------------------------------
- --
- -- options:
- -- ASSIGNMENT - if defined include operator=
- -- CONSTRUCT_ASSERT - if defined default and copy ctors assert(false)
- -- NO_DEF_CONSTRUCT - if defined no default ctors
- --
- <code STANDARD_OPERATIONS>
- <define CLASS_MEMBERS>
- <if ((!$NO_DEF_CONSTRUCT$) | ($NO_DEF_CONSTRUCT$ == f) )>
- $CLASS_NAME$::$CLASS_NAME$()
- -- \<>
- <if ($DEFAULT_INIT$)>: \<>
- </if>
- <repeat DEFAULT_INIT separate ,>
- $DEFAULT_INIT$
- </repeat>
- {
- <if ($CONSTRUCT_ASSERT$)>
- // default ctor not used
- assert(false);
- </if>
- }
- </if NO_DEF_CONSTRUCT>
-
- <if ((!$NO_COPY_CONSTRUCT$) | ($NO_COPY_CONSTRUCT$ == f) )>
- $CLASS_NAME$::$CLASS_NAME$( const $CLASS_NAME$ © )
- <if ($COPY_INIT$)>: \<>
- </if>
- <repeat COPY_INIT separate ,>
- $COPY_INIT$
- </repeat>
- {
- <if ($CONSTRUCT_ASSERT$)>
- // copy ctor not used
- assert(false);
- </if>
- }
- </if NO_COPY_CONSTRUCT>
-
- $CLASS_NAME$::~$CLASS_NAME$()
- {
- $FINALIZE$\<>
- }
-
- <if ($ASSIGNMENT$)>
- $CLASS_NAME$&
- $CLASS_NAME$::operator=( const $CLASS_NAME$& copy )
- {
- <repeat CLASS_SUPERS>
- $CLASS_SUPERS$::operator=( copy );
- </repeat>
- $ASSIGN$\<>
- }
-
- <clear ASSIGNMENT>
- </if>
- </define CLASS_MEMBERS>
- <clear NO_DEF_CONSTRUCT>
- <clear NO_COPY_CONSTRUCT>
- <clear CONSTRUCT_ASSERT>
- <clear DEFAULT_INIT>
- <clear COPY_INIT>
- <clear ASSIGN>
- <clear FINALIZE>
- </code STANDARD_OPERATIONS>
-
- -------------------------------------------------------------------------------
- -- Extended type template
- --------------------------------------------------------------------------------
- <code TYPE_EXTENSION>
- -- public macros
- <if ((!$CLASS_MACROS$) | ($CLASS_MACROS$ == $NULL$))>
- <define CLASS_MACROS>
- TypeExtensionMacro($CLASS_NAME$)
-
- </define>
- </if>
- $STANDARD_OPERATIONS$\<>
- </code TYPE_EXTENSION>
-
- -------------------------------------------------------------------------------
- -- Streaming operators template
- --------------------------------------------------------------------------------
- <code STREAMING>
- $TYPE_EXTENSION$\<>
- <define CLASS_MEMBERS_OLE>
- IBaseStream&
- $CLASS_NAME$::operator>>=( IBaseStream& toWhere ) const
- {
- writeVersion( toWhere );
- <repeat CLASS_SUPERS>
- $CLASS_SUPERS$::operator>>=( toWhere );
- </repeat>
- $STREAM_OUT$\<>
- return toWhere;
- }
-
- IBaseStream&
- $CLASS_NAME$::operator<<=( IBaseStream& fromWhere )
- {
- switch ( readVersion( fromWhere ) ) {
- case kOriginalVersion:
- <repeat CLASS_SUPERS>
- $CLASS_SUPERS$::operator<<=( fromWhere );
- </repeat>
- $STREAM_IN$\<>
- break;
- default:
- ITHROWLIBRARYERROR(IC_STREAM_VERSION_UNSUPPORTED,
- IBaseErrorInfo::invalidRequest,
- IException::recoverable);
- }
- return fromWhere;
- }
-
- </define CLASS_MEMBERS_OLE>
- --
- <define CLASS_MEMBERS>
- --<if (!$GEN_OLE$)>
- --$CLASS_MEMBERS_NOT_OLE$\<>
- --<else>
- $CLASS_MEMBERS_OLE$\<>
- --</if>
- </define CLASS_MEMBERS>
- <clear STREAM_IN>
- <clear STREAM_OUT>
- </code STREAMING>
-
- --------------------------------------------------------------------------------
- -- default definitions
- --------------------------------------------------------------------------------
- <code CLASS_MACROS>
- </code>
- <code CLASS_MEMBERS>
- </code>
- <code ASSIGN>
- </code>
- <code STREAM_IN>
- </code>
- <code STREAM_OUT>
- </code>
- <code STATIONERY_DEF>
- </code>
- <code FINALIZE>
- </code>