Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

How It Works

Note: this page is intended for people who wish to modify or extend UPF, not for those who only use it.

ABI

There's a simple binary compatible layer written in plain C hidden in UPF -- the ABI. A call to object's method is translated into call of C function from the ABI, arguments are serialized into byte stream and deserialized by the callee.

The library export two functions (upf_init_ and upf_done) and variable upf_middleware which is a pointer upf_middlewareLayer structure. This structure contains pointers to various functions, number of ABI version (so that incompatible plugins are not loaded by mistake) and pointer to upf::IManager and upf::IServiceManager instances.

All instances are represented with upf_Object structure, which contains four members:

upf_InterfaceData contains opaque data pointer (this is typically not same as upf_Object's data pointer and it has different values for same upf_Object but different interfaces!) and dispatch function.

Dispatch function is called when a method call is being made. It takes 3 arguments: the data pointer, method ID and arguments. Method ID is method's number (starting from 0, in the order the methods appear in IDL, methods inherited from superinterface first). Arguments are stored in upf_Arguments using marchaller_write from upf_middleware. Basic types are stored as native types defined as C mapping of IDL types by CORBA (e.g. uint32_t for unsigned long), custom types may be serialized as the app wishes, interface pointers are serialized as void*.

Dispatch function is implemented in language-dependent manner, but it will usually contain a table of method pointers.

Language specific generated headers (or other files) then contains proxy classes and dispatcher function to translate native calls into ABI dispatches.


Generated on Tue Apr 24 22:55:25 2007 for Universal Plugins Framework by  doxygen 1.3.9.1