home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.7 KB | 112 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWClaPrv.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWCLAPRV_H
- #define FWCLAPRV_H
-
- // ----- ODF RTTI private macros.
- // Clients should use the public RTTI macros defined in FWClaInf.h
-
- #define FW_CLASS_INFO_PTR(name) \
- (&name::fgClassInfo)
-
- #define _FW_CLASS_ANCESTORS(name) \
- name::fgAncestors
-
- #define _FW_CLASS_OFFSETS(name) \
- name::fgAncestorOffsets
-
- const unsigned long FW_kDummyAddress = 1024;
- #define _FW_BASE_OFFSET(derived, base) \
- (((char*)((base*)((derived*)FW_kDummyAddress))) - (char*)FW_kDummyAddress)
-
-
- #define _FW_DEFINE_CLASSINFO_OBJECT(name) \
- FW_SClassInfo \
- name::fgClassInfo = { #name, sizeof(name), _FW_CLASS_ANCESTORS(name), _FW_CLASS_OFFSETS(name) };
-
- #define _FW_CLASS_ANCESTORS_IMPLEMENT_M0(name) \
- const FW_SClassInfoPtr _FW_CLASS_ANCESTORS(name)[] = \
- { \
- 0 \
- }; \
- const size_t _FW_CLASS_OFFSETS(name)[] = \
- { \
- 0 \
- };
-
- #define _FW_CLASS_ANCESTORS_IMPLEMENT_M1(name, ancestor) \
- const FW_SClassInfoPtr _FW_CLASS_ANCESTORS(name)[] = \
- { \
- FW_CLASS_INFO_PTR(ancestor), \
- 0 \
- }; \
- const size_t _FW_CLASS_OFFSETS(name)[] = \
- { \
- _FW_BASE_OFFSET(name, ancestor), \
- 0 \
- };
-
- #define _FW_CLASS_ANCESTORS_IMPLEMENT_M2(name, ancestor1, ancestor2) \
- const FW_SClassInfoPtr _FW_CLASS_ANCESTORS(name)[] = \
- { \
- FW_CLASS_INFO_PTR(ancestor1), \
- FW_CLASS_INFO_PTR(ancestor2), \
- 0 \
- }; \
- const size_t _FW_CLASS_OFFSETS(name)[] = \
- { \
- _FW_BASE_OFFSET(name, ancestor1), \
- _FW_BASE_OFFSET(name, ancestor2), \
- 0 \
- };
-
-
- #define _FW_CLASS_ANCESTORS_IMPLEMENT_M3(name, ancestor1, ancestor2, ancestor3) \
- const FW_SClassInfoPtr _FW_CLASS_ANCESTORS(name)[] = \
- { \
- FW_CLASS_INFO_PTR(ancestor1), \
- FW_CLASS_INFO_PTR(ancestor2), \
- FW_CLASS_INFO_PTR(ancestor3), \
- 0 \
- }; \
- const size_t _FW_CLASS_OFFSETS(name)[] = \
- { \
- _FW_BASE_OFFSET(name, ancestor1), \
- _FW_BASE_OFFSET(name, ancestor2), \
- _FW_BASE_OFFSET(name, ancestor3), \
- 0 \
- };
-
- #define _FW_CLASS_ANCESTORS_IMPLEMENT_M4(name, ancestor1, ancestor2, ancestor3, ancestor4)\
- const FW_SClassInfoPtr _FW_CLASS_ANCESTORS(name)[] = \
- { \
- FW_CLASS_INFO_PTR(ancestor1), \
- FW_CLASS_INFO_PTR(ancestor2), \
- FW_CLASS_INFO_PTR(ancestor3), \
- FW_CLASS_INFO_PTR(ancestor4), \
- 0 \
- }; \
- const size_t _FW_CLASS_OFFSETS(name)[] = \
- { \
- _FW_BASE_OFFSET(name, ancestor1), \
- _FW_BASE_OFFSET(name, ancestor2), \
- _FW_BASE_OFFSET(name, ancestor3), \
- _FW_BASE_OFFSET(name, ancestor4), \
- 0 \
- };
-
- #define _FW_CLASSINFO_ACCESSOR_MEMBERS(name) \
- FW_SClassInfoPtr name::PrivVirtualGetClassInfo(void) const \
- { \
- return FW_CLASS_INFO_PTR(name); \
- }
-
- #endif
-