gwenhywfar
4.18.0
|
Typedefs | |
typedef void GWENHYWFAR_CB(* | GWEN_INHERIT_FREEDATAFN) (void *baseData, void *data) |
Macros To Be Used In Inherited Classes - Header Files | |
#define | GWEN_INHERIT_ELEMENT(t) GWEN_INHERITDATA_LIST *INHERIT__list; |
#define | GWEN_INHERIT_FUNCTION_LIB_DEFS(t, decl) |
#define | GWEN_INHERIT_FUNCTION_DEFS(t) GWEN_INHERIT_FUNCTION_LIB_DEFS(t, GWEN_DUMMY_EMPTY_ARG) |
Macros To Be Used In Inherited Classes - C Files | |
#define | GWEN_INHERIT_FUNCTIONS(t) |
#define | GWEN_INHERIT_INIT(t, element) |
#define | GWEN_INHERIT_FINI(t, element) |
Macros To Be Used In Inheriting Classes | |
#define | GWEN_INHERIT(bt, t) uint32_t t##__INHERIT_ID=0; |
#define | GWEN_INHERIT_GETDATA(bt, t, element) ((t*)GWEN_Inherit_FindData(bt##__INHERIT_GETLIST(element),t##__INHERIT_ID,0)) |
#define | GWEN_INHERIT_SETDATA(bt, t, element, data, fn) |
#define | GWEN_INHERIT_ISOFTYPE(bt, t, element) |
#define | GWEN_INHERIT_UNLINK(bt, t, element) |
#define GWEN_INHERIT | ( | bt, | |
t | |||
) | uint32_t t##__INHERIT_ID=0; |
Use this in the C file of inheriting classes. It initializes a global variable with a hash of the inheriting type name. This is used to speed up inheritance functions. This variable will be filled with a value upon the first invocation of the macro GWEN_INHERIT_SETDATA.
#define GWEN_INHERIT_ELEMENT | ( | t | ) | GWEN_INHERITDATA_LIST *INHERIT__list; |
#define GWEN_INHERIT_FINI | ( | t, | |
element | |||
) |
Use this macro in your C file in destructor functions for the base class. This macro deinitializes the elements defined by the macro GWEN_INHERIT_ELEMENT. This should be the first instruction in that function, because it also gives inheriting classes the opportunity to free their own data associated with the given element. It causes the least problems if inheriting classes free their data before the base class does.
#define GWEN_INHERIT_FUNCTION_DEFS | ( | t | ) | GWEN_INHERIT_FUNCTION_LIB_DEFS(t, GWEN_DUMMY_EMPTY_ARG) |
Use this macro in the header file of the base class. This defines the prototypes of some inheritance functions. This macro should be used in applications, not in libraries. In libraries please use the macro GWEN_INHERIT_FUNCTION_LIB_DEFS.
You should not care about these functions here, since you should not use them directly. Please use GWEN_INHERIT_GETDATA and GWEN_INHERIT_SETDATA instead.
#define GWEN_INHERIT_FUNCTION_LIB_DEFS | ( | t, | |
decl | |||
) |
Use this macro in the header file of the base class. This defines the prototypes of some inheritance functions. This macro should be used in libraries with the __declspec(dllexport) as the decl
argument.
You should not care about these functions here, since you should not use them directly. Please use GWEN_INHERIT_GETDATA and GWEN_INHERIT_SETDATA instead.
#define GWEN_INHERIT_FUNCTIONS | ( | t | ) |
#define GWEN_INHERIT_GETDATA | ( | bt, | |
t, | |||
element | |||
) | ((t*)GWEN_Inherit_FindData(bt##__INHERIT_GETLIST(element),t##__INHERIT_ID,0)) |
#define GWEN_INHERIT_INIT | ( | t, | |
element | |||
) |
Use this macro in your C file in constructor functions for the base class. This macro initializes the elements defined by the macro GWEN_INHERIT_ELEMENT.
#define GWEN_INHERIT_ISOFTYPE | ( | bt, | |
t, | |||
element | |||
) |
This macro checks whether the given element is of the given type.
bt | base type |
t | derived type |
element | pointer which is to be checked |
#define GWEN_INHERIT_SETDATA | ( | bt, | |
t, | |||
element, | |||
data, | |||
fn | |||
) |
This macro sets the private data of an inheriting class associated with an element of its base class. The last argument is a pointer to a function which frees the associated data. That function will be called when the element of the base class given is freed or new data is to be associated with the element. The prototype of that function is this:
Please note that the argument to that function is a pointer to the base type element. If you want to get the private data associated with the base type element (and you probably do) you must call GWEN_INHERIT_GETDATA. Every time the macro GWEN_INHERIT_SETDATA is used the previously associated data will be freed by calling the function whose prototype you've just learned.
#define GWEN_INHERIT_UNLINK | ( | bt, | |
t, | |||
element | |||
) |
This macro gives up the inheritance for the given type. After this macro has been executed there is no link left between the type and its base type.
bt | base type |
t | derived type |
typedef void GWENHYWFAR_CB(* GWEN_INHERIT_FREEDATAFN) (void *baseData, void *data) |
GWENHYWFAR_API void* GWEN_Inherit_FindData | ( | GWEN_INHERITDATA_LIST * | l, |
uint32_t | id, | ||
int | wantCreate | ||
) |
GWENHYWFAR_API GWEN_INHERITDATA* GWEN_Inherit_FindEntry | ( | GWEN_INHERITDATA_LIST * | l, |
uint32_t | id, | ||
int | wantCreate | ||
) |
GWENHYWFAR_API uint32_t GWEN_Inherit_MakeId | ( | const char * | typeName | ) |
GWENHYWFAR_API void GWEN_InheritData_clear | ( | GWEN_INHERITDATA * | d | ) |
GWENHYWFAR_API void GWEN_InheritData_free | ( | GWEN_INHERITDATA * | d | ) |
GWENHYWFAR_API void GWEN_InheritData_freeAllData | ( | GWEN_INHERITDATA * | d | ) |
GWENHYWFAR_API void GWEN_InheritData_freeData | ( | GWEN_INHERITDATA * | d | ) |
GWENHYWFAR_API void* GWEN_InheritData_GetData | ( | const GWEN_INHERITDATA * | d | ) |
GWENHYWFAR_API GWEN_INHERIT_FREEDATAFN GWEN_InheritData_GetFreeDataFn | ( | const GWEN_INHERITDATA * | d | ) |
GWENHYWFAR_API uint32_t GWEN_InheritData_GetId | ( | const GWEN_INHERITDATA * | d | ) |
GWENHYWFAR_API const char* GWEN_InheritData_GetTypeName | ( | const GWEN_INHERITDATA * | d | ) |
GWENHYWFAR_API GWEN_INHERITDATA* GWEN_InheritData_new | ( | const char * | t, |
uint32_t | id, | ||
void * | data, | ||
void * | baseData, | ||
GWEN_INHERIT_FREEDATAFN | fn | ||
) |