XInterface, which uses the same mechanism as COM to access it (
queryInterface) which allows the interface to be extended
cppu::defaultBootstrap_InitialComponentContext(). This function finds the configuration file for the URE, which stores information about the types and services that are implemented in UNO.
rtl::OUStringclass and the enumeration in the type library is
com.sun.star.table.CellVertJustifyis defined as
rtl_uStrings to the enumerator names, and an array of integers to define the enumerator name indices. The following is a basic unit test that creates and then releases an enumerator:
typelib_CompoundTypeDescriptionstruct in the C type library. Whilst the struct is meant to be opaque, it is still interesting to see how it has been implemented by the LibreOffice developers:
aBase., which describes the actual struct type (which will be the base type other types can inherit from). UNO structs support single-inheritence, and this points to the parent struct, which is
pBaseTypeDescription. If this is a nullptr, then it means that the struct is the root class in the heirachy.
ppTypeRefs, and names of each member,
ppMemberNames. To get to each member, you need to know the memory offset of each member so an offset table,
pMemberOffsets, is used.
ParameterizedStruct<T, B>.The plain struct is defined by
typelib_CompoundTypeDescriptionand parameterized structs are defined by
Typeclass, which wraps a
typelib_TypeDescriptionReferencepointer. To construct a new Type, you pass it a
TypeClassenum (translates to
typelib_TypeClass) and a type description string; alternatively you can pass a
typelib_TypeDescriptionReferencepointer. To create a type, you just call on the
<OBI>[:purpose]*. Some examples are:
java:unsafefor a Java based environment that is thread-unsafe
unofor an environment that implements the binary UNO ABI and which is thread-safe
gcc3:debugfor an environment that implements the GCC3 C++ OBI and that is thread unsafe
uno_getMapping()function. The mapping is stored in a structure, which has a pointer to an acquire, release and map function. It works as follows:
uno_Mappingpointer, and three input parameters to the environment to map from, the environment to map to and the name of the environment purpose. The first task of the function is to ensure that the mapping is released, and it is then cleared.
unordered_mapof mapping names to mapping entries, and an
uno_Mappingsto mapping entries. You can also register callbacks to find mappings. There is also a list of external bridging libraries that have already been loaded, kept so that they are not loaded a second time. This is all defined in the structure
MappingsData, and is lazy loaded via the
Mappinginstance to a
XInterface. It provides lifetime control by reference counting and the possibility of querying for other interfaces of the same logical object. Deriving from XInterface, an object needs to implement the
release()functions - for object lifetime - and the
queryInterface()- this allows a UNO type to be safely casted, even across process boundaries. To find out if an implementation supports a given interface, it passes
queryInterface()the Type object it wishes to check. If the implementation supports the interface, then it returns a reference to the interface being queries, otherwise if not then it returns a void type.
static_typeis defined to return the
Typeof the object. This is necessary, because I use the helper
queryInterface()function in cppuhelper:
static_type()function to compare it against the type being tested, and if this matches then it returns the implementation as an
Anyobject. If it does not match, then it returns a void