ContentsAbstractThis document contains the specification of the types mapped from the IDL to binary (C) UNO. You should be familiar with the document the idea of UNO. A slight knowledge about interfaces, C/C++, and a background about an object model like COM is helpful. Type SpecificationAll types which can be used in the IDL language are specified in this paragraph. The representation of the types is machine, language, and operating system dependent. The base types are swapped if the processor has little or big-endian format. The size of the types may vary depending on the processor bus size. The size of types may depend on the operating system. Another problem is the alignment of data structures: the alignment is processor and bus dependent. Alignment is defined through the following algorithm: Structure members are stored sequentially by the order in which they are declared. Every data object has an alignment-requirement. For structures, the requirement is the largest of its members. Every object then has an allocated offset so that
offset % alignment-requirement == 0
If it is possible that the maximum alignment can be restricted (e.g. Microsoft Visual C++ compiler) then the maximum alignment is set to 8. Under this condition the alignment is set to
min( n, sizeof( item ) ).
The size is rounded up to the largest integral base type. The following table shows the IDL type, size, and layout:
Remarks:
InterfacesAll interfaces are derived from the interface com.sun.star.uno.XInterface. This interface is specified in the IDL language:
interface XInterface
{
any queryInterface( [in] type aType );
[oneway] void acquire();
[oneway] void release();
};
In contrast to C++ vtable calling, binary UNO calls on a generic dispatcher function to perform calls on interfaces.
typedef void (SAL_CALL * uno_DispatchMethod)(
uno_Interface * pUnoI,
const typelib_TypeDescription * pMemberType,
void * pReturn,
void * pArgs[],
uno_Any ** ppException );
/** The binary C uno interface description. */
typedef struct _uno_Interface
{
void (SAL_CALL * acquire)( uno_Interface * pInterface );
void (SAL_CALL * release)( uno_Interface * pInterface );
uno_DispatchMethod pDispatcher;
} uno_Interface;
The lifetime of interfaces are controlled by acquire() and release(). Beware that the dispatch function expects an array of pointers to the parameter values (pArgs), which is for interfaces uno_Interface ** (pointer to interface reference storing an acquired pointer to the uno_Interface struct). To signal, that no exception has to be thrown, *ppException has to set to 0 before returning.
|


