Uno/Cpp/Spec/Purpose Bridge Implementation Helper
From Apache OpenOffice Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Type: Specification State: Evolving Availability: URE 1.3 (SRC680_m212)
Feature
A helper for implementing purpose environments, with probe support.
API
[cpp]
cppu/helper/purpenv/Base.hxx
class cppu::helper::purpenv::Base
{
public:
Base(uno_Environment * pEnv);
};
cppu/helper/purpenv/Mapping.hxx
void createMapping(uno_Mapping ** ppMapping, uno_Environment * pFrom, uno_Environment * pTo, ProbeFun * probeFun = NULL, void * pContext = NULL);
Usage Example
#include <cppu/helper/purpenv/Base.hxx>
#include <cppu/helper/purpenv/Mapping.hxx>
...
class SAL_DLLPRIVATE MyBridge : public cppu::helper::purpenv::Base
{
public:
explicit MyBridge(uno_Environment * pEnv);
virtual void v_callInto_v(uno_EnvCallee * pCallee, va_list param);
virtual void v_callOut_v (uno_EnvCallee * pCallee, va_list param);
virtual void v_enter(void);
virtual void v_leave(void);
virtual int v_isValid(rtl::OUString * pReason);
};
MyBridge::MyBridge(uno_Environment * pEnv)
{
...
}
void MyBridge::v_callInto_v(uno_EnvCallee * pCallee, va_list param)
{
...
}
void MyBridge::v_callOut_v(uno_EnvCallee * pCallee, va_list param)
{
...
}
void MyBridge::v_enter(void)
{
...
}
void MyBridge::v_leave(void)
{
...
}
int MyBridge::v_isValid(rtl::OUString * pReason)
{
...
}
extern "C" void SAL_DLLPUBLIC_EXPORT SAL_CALL uno_initEnvironment(uno_Environment * pEnv)
SAL_THROW_EXTERN_C()
{
new MyBridge(pEnv);
}
extern "C" void SAL_DLLPUBLIC_EXPORT SAL_CALL uno_ext_getMapping(uno_Mapping ** ppMapping,
uno_Environment * pFrom,
uno_Environment * pTo )
{
cppu::helper::purpenv::createMapping(ppMapping, pFrom, pTo);
}
Link Libraries
- C++ purpenv_helper