Library interface and setup


struct  doModuleData


#define DOMD_IS_MAIN   4


typedef DynObj *(* CreateDynObjFn )(const char *type, int type_id, const DynI *pdi_init)
typedef doModuleData *(* InitDynLibFn )(DynI *pdi_init)
typedef bool(* ExitDynLibFn )(bool is_query)
typedef bool(* DestroyDynObjFn )(void *pv, DynObjType *pdt)

Detailed Description

Typedef Documentation

typedef DynObj*(* CreateDynObjFn)(const char *type, int type_id, const DynI *pdi_init)

Protoptype for library functions that create objects . This function is usually named 'CreateDynObj'. The create function is free to create an object even if only one of type_id or type is defined.

type The type string naming type of object to be created
type_id The type ID of the object to be created
di_init A DynI object to be passed to constructor of new object
The returned object is derived from DynObj (directly or indirectly)

typedef bool(* DestroyDynObjFn)(void *pv, DynObjType *pdt)

Protoptype for library functions that destroys objects. The default way to delete is through doDestroy, so this is not necessary to implement. When destroying objects not derived from DynObj/DynSharedI it is required.

pv is a pointer to object to destroy
pdt is a pointer to the type of the object
true on succesful destroy.

typedef bool(* ExitDynLibFn)(bool is_query)

Prototype for a function called at library unload. If is_query is true, the library will not be closed now, given that the function returns false.

is_query is set to true if the library can 'object' to shutdown.
true if library is ready to shut down (it may be shutdown anyway).

typedef doModuleData*(* InitDynLibFn)(DynI *pdi_init)

Protoptype for library init functions. Library init function is named 'InitDynLib'. It can be passed a DynI derived object from the app. It returns a pointer to a doModuleData structure. If the library is linked with DynObj.cpp this is not necessary it can return NULL.

pdi_init A pointer to a DynI derived object that the library can make sense of. It could also be DoRunTimeI which allows the library to connect with shared resources.
A pointer to a doModuleData structure that describes types implemented by the plugin library and the compiler used to generate it.

Generated on Sun Feb 15 16:35:57 2009 for DynObj by  doxygen 1.5.6