LibreOffice Module cli_ure (master) 1
|
An instance of Bridge represents exactly one mapping therefore either m_cli2uno or m_uno2cli is valid. More...
#include <cli_bridge.h>
Public Member Functions | |
~Bridge () | |
Bridge (uno_Environment *java_env, uno_ExtEnvironment *uno_env, bool registered_java2uno) | |
void | acquire () const |
ToDo I doubt that the case that the ref count raises from 0 to 1 can occur. More... | |
void | release () const |
void | map_to_uno (void *uno_data, System::Object^ cli_data, typelib_TypeDescriptionReference *type, bool assign) const |
void | map_to_cli (System::Object^ *cli_data, void const *uno_data, typelib_TypeDescriptionReference *type, System::Type^ info, bool bDontCreateObj) const |
System::Object | map_uno2cli (uno_Interface *pUnoI, typelib_InterfaceTypeDescription *pTD) const |
System::Object | call_uno (uno_Interface *pUnoI, typelib_TypeDescription *member_td, typelib_TypeDescriptionReference *return_type, sal_Int32 nParams, typelib_MethodParameter const *pParams, array< System::Object^>^ args, array< System::Type^>^ argTypes, System::Object^ *pException) const |
void | call_cli (System::Object^ cliI, sr::MethodInfo^ method, typelib_TypeDescriptionReference *return_type, typelib_MethodParameter *params, int nParams, void *uno_ret, void *uno_args[], uno_Any **uno_exc) const |
uno_Interface * | map_cli2uno (System::Object^ cliI, typelib_TypeDescription *pTD) const |
Public Attributes | |
oslInterlockedCount | m_ref |
uno_ExtEnvironment * | m_uno_env |
uno_Environment * | m_uno_cli_env |
Mapping | m_cli2uno |
Mapping | m_uno2cli |
bool | m_registered_cli2uno |
An instance of Bridge represents exactly one mapping therefore either m_cli2uno or m_uno2cli is valid.
Definition at line 57 of file cli_bridge.h.
cli_uno::Bridge::~Bridge | ( | ) |
Definition at line 225 of file cli_bridge.cxx.
References m_uno_cli_env, and m_uno_env.
cli_uno::Bridge::Bridge | ( | uno_Environment * | java_env, |
uno_ExtEnvironment * | uno_env, | ||
bool | registered_java2uno | ||
) |
Definition at line 199 of file cli_bridge.cxx.
References cli_uno::Mapping::m_bridge, m_cli2uno, m_ref, m_uno2cli, m_uno_cli_env, m_uno_env, cli_uno::Mapping_acquire(), cli_uno::Mapping_cli2uno(), cli_uno::Mapping_release(), and cli_uno::Mapping_uno2cli().
void cli_uno::Bridge::acquire | ( | ) | const |
ToDo I doubt that the case that the ref count raises from 0 to 1 can occur.
uno_ext_getMapping returns an acquired mapping. Every time that function is called then a new mapping is created. Following the rules of ref counted objects, then if the ref count is null no one has a reference to the object anymore. Hence no one can call acquire. If someone calls acquire then they must have kept an unacquired pointer which is illegal.
Definition at line 169 of file cli_bridge.cxx.
References cli_uno::Bridge_free(), m_cli2uno, m_ref, m_registered_cli2uno, m_uno2cli, m_uno_cli_env, m_uno_env, and uno_registerMapping().
Referenced by cli_uno::CliProxy::CliProxy(), cli_uno::Mapping_acquire(), cli_uno::UnoInterfaceInfo::UnoInterfaceInfo(), and cli_uno::UnoInterfaceProxy::UnoInterfaceProxy().
void cli_uno::Bridge::call_cli | ( | System::Object^ | cliI, |
sr::MethodInfo^ | method, | ||
typelib_TypeDescriptionReference * | return_type, | ||
typelib_MethodParameter * | params, | ||
int | nParams, | ||
void * | uno_ret, | ||
void * | uno_args[], | ||
uno_Any ** | uno_exc | ||
) | const |
Definition at line 198 of file cli_uno.cxx.
References cli_uno::rtl_mem::allocate(), args, map_to_cli(), map_to_uno(), cli_uno::mapCliString(), cli_uno::mapCliType(), n, nPos, sal_True, and uno_type_destructData().
Referenced by cli_proxy_dispatch().
System::Object cli_uno::Bridge::call_uno | ( | uno_Interface * | pUnoI, |
typelib_TypeDescription * | member_td, | ||
typelib_TypeDescriptionReference * | return_type, | ||
sal_Int32 | nParams, | ||
typelib_MethodParameter const * | pParams, | ||
array< System::Object^>^ | args, | ||
array< System::Type^>^ | argTypes, | ||
System::Object^ * | pException | ||
) | const |
Definition at line 41 of file cli_uno.cxx.
References args, cli_uno::TypeDescr::get(), map_to_cli(), map_to_uno(), n, nPos, NULL, type, and uno_type_destructData().
Referenced by cli_uno::UnoInterfaceProxy::CanCastTo(), and cli_uno::UnoInterfaceProxy::Invoke().
uno_Interface * cli_uno::Bridge::map_cli2uno | ( | System::Object^ | cliI, |
typelib_TypeDescription * | pTD | ||
) | const |
Definition at line 107 of file cli_data.cxx.
References cli_uno::CliProxy::create(), cli_uno::CliEnvHolder::g_cli_env, cli_uno::Cli_environment::getObjectIdentifier(), m_uno_env, cli_uno::mapCliString(), and NULL.
Referenced by cli_proxy_dispatch(), map_to_uno(), and cli_uno::Mapping_cli2uno().
void cli_uno::Bridge::map_to_cli | ( | System::Object^ * | cli_data, |
void const * | uno_data, | ||
typelib_TypeDescriptionReference * | type, | ||
System::Type^ | info, | ||
bool | bDontCreateObj | ||
) | const |
info | the type of the converted data. It may be a byref type. |
info | The expected target type. Currently info is provided when this method is called to convert the in/out and out parameters of a call from cli to uno. Then info is always a byref type, e.g. "System.String&". info is used for Any and Enum conversion. |
bDontCreateObj | false - a new object is created which holds the mapped uno value and is assigned to cli_data. true - cli_data already contains the newly constructed object. This is the case if a struct is converted then on the first call to map_to_cli the new object is created. If the struct inherits another struct then this function is called recursively while the newly created object is passed in cli_data. |
Definition at line 1448 of file cli_data.cxx.
References args, aStr, cli_uno::TypeDescr::get(), i, cli_uno::loadCliType(), map_to_cli(), map_uno2cli(), cli_uno::mapUnoString(), cli_uno::mapUnoType(), nElements, nPos, NULL, p, sal_True, sMessage, and type.
Referenced by call_cli(), call_uno(), and map_to_cli().
void cli_uno::Bridge::map_to_uno | ( | void * | uno_data, |
System::Object^ | cli_data, | ||
typelib_TypeDescriptionReference * | type, | ||
bool | assign | ||
) | const |
Definition at line 735 of file cli_data.cxx.
References cli_uno::rtl_mem::allocate(), assign(), cli_uno::TypeDescr::get(), i, cli_uno::BridgeRuntimeError::m_message, map_cli2uno(), map_to_uno(), cli_uno::mapCliString(), cli_uno::mapCliType(), cli_uno::mapUnoString(), nElements, nPos, NULL, p, sal_False, sal_True, cli_uno::seq_allocate(), type, typelib_typedescription_release(), typelib_typedescriptionreference_acquire(), typelib_typedescriptionreference_release(), uno_any_construct(), uno_any_destruct(), uno_destructData(), and uno_type_destructData().
Referenced by call_cli(), call_uno(), and map_to_uno().
System::Object cli_uno::Bridge::map_uno2cli | ( | uno_Interface * | pUnoI, |
typelib_InterfaceTypeDescription * | pTD | ||
) | const |
Definition at line 63 of file cli_data.cxx.
References cli_uno::UnoInterfaceProxy::create(), cli_uno::CliEnvHolder::g_cli_env, cli_uno::Cli_environment::getRegisteredInterface(), m_uno_env, cli_uno::mapUnoString(), cli_uno::mapUnoType(), and p.
Referenced by map_to_cli(), and cli_uno::Mapping_uno2cli().
void cli_uno::Bridge::release | ( | ) | const |
Definition at line 188 of file cli_bridge.cxx.
References m_cli2uno, m_ref, m_registered_cli2uno, m_uno2cli, and uno_revokeMapping().
Referenced by cli_uno::UnoInterfaceInfo::!UnoInterfaceInfo(), cli_uno::UnoInterfaceProxy::!UnoInterfaceProxy(), cli_uno::Mapping_release(), and cli_uno::CliProxy::~CliProxy().
Mapping cli_uno::Bridge::m_cli2uno |
Definition at line 63 of file cli_bridge.h.
Referenced by acquire(), Bridge(), release(), and cli_uno::uno_ext_getMapping().
|
mutable |
Definition at line 59 of file cli_bridge.h.
bool cli_uno::Bridge::m_registered_cli2uno |
Definition at line 65 of file cli_bridge.h.
Mapping cli_uno::Bridge::m_uno2cli |
Definition at line 64 of file cli_bridge.h.
Referenced by acquire(), Bridge(), release(), and cli_uno::uno_ext_getMapping().
uno_Environment* cli_uno::Bridge::m_uno_cli_env |
Definition at line 61 of file cli_bridge.h.
uno_ExtEnvironment* cli_uno::Bridge::m_uno_env |
Definition at line 60 of file cli_bridge.h.
Referenced by cli_uno::UnoInterfaceInfo::!UnoInterfaceInfo(), acquire(), cli_uno::CliProxy::acquire(), cli_uno::UnoInterfaceProxy::addUnoInterface(), Bridge(), cli_proxy_dispatch(), cli_uno::CliProxy::create(), map_cli2uno(), map_uno2cli(), cli_uno::CliProxy::release(), and ~Bridge().