OpenMAXBellagio 0.9.3
omx_classmagic.h
Go to the documentation of this file.
00001 
00039 #ifndef OMX_CLASSMAGIC_H_
00040 #define OMX_CLASSMAGIC_H_
00041 
00042 
00043 #ifdef DOXYGEN_PREPROCESSING
00044 #define CLASS(a) class a { public:
00045 #define DERIVEDCLASS(a, b) class a : public b { public:
00046 #define ENDCLASS(a) a##_FIELDS };
00047 #else
00048 #define CLASS(a) typedef struct a a; \
00049  struct a { 
00050 #define DERIVEDCLASS(a, b) typedef struct a a; \
00051  struct a {
00052 #define ENDCLASS(a) a##_FIELDS };
00053 #endif
00054 
00055 #if 0 /*EXAMPLES*/
00056 
00059 CLASS(A)
00060 #define A_FIELDS \
00061  \
00062     int a; \
00063  \
00064     int ash;
00065 ENDCLASS(A)
00066  
00067 
00070 DERIVEDCLASS(B,A)
00071 #define B_FIELDS A_FIELDS \
00072  \
00073     int b;
00074 ENDCLASS(B)
00075 
00076 
00079 DERIVEDCLASS(B2,A)
00080 #define B2_FIELDS A_FIELDS \
00081  \
00082     int b2;
00083 ENDCLASS(B2)
00084 
00085 
00088 DERIVEDCLASS(C,B)
00089 #define C_FIELDS B_FIELDS \
00090  \
00091     int c;
00092 ENDCLASS(C)
00093 
00094 #endif /* 0 */
00095 
00096 #endif