00001
00004 #ifndef FBXFILESDK_COMPONENTS_KBASELIB_OBJECT_I_IOBJECT_H
00005 #define FBXFILESDK_COMPONENTS_KBASELIB_OBJECT_I_IOBJECT_H
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include <fbxfilesdk/components/kbaselib/kbaselib_h.h>
00042
00043 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00044
00045 #ifdef KFBX_PLUGIN
00046 #define IObject IKObject
00047 #define HIObject HIKObject
00048 #define IObjectID IKObjectID
00049 #define IKObjectID 0
00050 #define IObjectDerived public IKObject
00051 #else
00052 #define IObjectID 0
00053 #define IObjectDerived public IObject
00054 #endif
00055
00057 KFBX_FORWARD( IObject )
00058
00059
00060 typedef unsigned long kInterfaceID;
00061
00063 #define KFBX_FncDefine(PFNC,ISPURE) virtual PFNC##ISPURE
00064 #define KFBX_Pure =0;
00065 #define KFBX_Implementation ;
00066 #define KFBX_IObjectImplement(ClassName,KFBX_IObjectOwner) \
00067 HIObject ClassName##::IQuery(kInterfaceID pInterfaceID,int IsLocal) {\
00068 if ((KFBX_IObjectOwner!=NULL) && (!IsLocal)) {\
00069 return KFBX_IObjectOwner->IQuery(pInterfaceID);\
00070 }\
00071 switch (pInterfaceID)
00072 #define KFBX_IObjectEnd return NULL; }
00073 #define KFBX_ILOCAL 1
00074
00075 #define KFBX_IQUERY(Object,Interface) ((H##Interface)((Object)->IQuery(Interface##ID,0)))
00076 #define KFBX_IQUERYLOCAL(Object,Interface) ( (H##Interface)((Object)->IQuery(Interface##ID,KFBX_ILOCAL)))
00077
00078 #define KFBX_IQ(Object,Interface) KFBX_IQUERY(Object,Interface)
00079 #define KFBX_IQL(Object,Interface) KFBX_IQUERYLOCAL(Object,Interface)
00080
00081
00082
00083
00084
00085
00086 #define KFBX_IObject_Declare(IsPure)\
00087 public:\
00088 virtual HIObject IQuery(kInterfaceID pInterfaceID, int IsLocal=0)IsPure\
00089 virtual void Destroy(int IsLocal=0)IsPure\
00090
00091 #define KFBX_IQuery_Declare(IsPure)\
00092 public:\
00093 virtual HIObject IQuery (kInterfaceID pInterfaceID, int IsLocal=0)IsPure\
00094
00095 class IObject {
00096 KFBX_IObject_Declare(KFBX_Pure)
00097 };
00098
00099 typedef HIObject (* kObjectCreatorFnc)(HIObject pOwner,char *pName,void *pData);
00100
00101 #ifdef KARCH_DEV_MSC
00102 #define KFBX_INTERFACE_SPECIAL __declspec(novtable)
00103 #define NO_DLL __declspec() // Use for the Module parameter if the interface is not exported
00104 #else
00105 #define KFBX_INTERFACE_SPECIAL
00106 #define NO_DLL // Use for the Module parameter if the interface is not exported
00107 #endif
00108
00109 #define KFBX_INTERFACE( Name,Id ) \
00110 KFBX_FORWARD( Name ) \
00111 const int Name##ID = Id; \
00112 class KFBX_INTERFACE_SPECIAL Name : IObjectDerived { \
00113 Name##_Declare(KFBX_Pure) \
00114 }
00115
00116 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00117
00118 #endif // FBXFILESDK_COMPONENTS_KBASELIB_OBJECT_I_IOBJECT_H
00119