LibreOffice Module binaryurp (master) 1
|
#include <bridge.hxx>
Classes | |
struct | SubStub |
Public Member Functions | |
Bridge (rtl::Reference< BridgeFactory > const &factory, OUString name, com::sun::star::uno::Reference< com::sun::star::connection::XConnection > const &connection, com::sun::star::uno::Reference< com::sun::star::bridge::XInstanceProvider > provider) | |
void | start () |
void | terminate (bool final) |
const com::sun::star::uno::Reference< com::sun::star::connection::XConnection > & | getConnection () const |
const com::sun::star::uno::Reference< com::sun::star::bridge::XInstanceProvider > & | getProvider () const |
com::sun::star::uno::Mapping & | getCppToBinaryMapping () |
BinaryAny | mapCppToBinaryAny (com::sun::star::uno::Any const &cppAny) |
uno_ThreadPool | getThreadPool () |
rtl::Reference< Writer > | getWriter () |
com::sun::star::uno::UnoInterfaceReference | registerIncomingInterface (OUString const &oid, com::sun::star::uno::TypeDescription const &type) |
OUString | registerOutgoingInterface (com::sun::star::uno::UnoInterfaceReference const &object, com::sun::star::uno::TypeDescription const &type) |
com::sun::star::uno::UnoInterfaceReference | findStub (OUString const &oid, com::sun::star::uno::TypeDescription const &type) |
void | releaseStub (OUString const &oid, com::sun::star::uno::TypeDescription const &type) |
void | resurrectProxy (Proxy &proxy) |
void | revokeProxy (Proxy &proxy) |
void | freeProxy (Proxy &proxy) |
void | incrementCalls (bool normalCall) noexcept |
void | decrementCalls () |
void | incrementActiveCalls () noexcept |
void | decrementActiveCalls () noexcept |
bool | makeCall (OUString const &oid, com::sun::star::uno::TypeDescription const &member, bool setter, std::vector< BinaryAny > &&inArguments, BinaryAny *returnValue, std::vector< BinaryAny > *outArguments) |
void | sendRequestChangeRequest () |
void | handleRequestChangeReply (bool exception, BinaryAny const &returnValue) |
void | handleCommitChangeReply (bool exception, BinaryAny const &returnValue) |
void | handleRequestChangeRequest (rtl::ByteSequence const &tid, std::vector< BinaryAny > const &inArguments) |
void | handleCommitChangeRequest (rtl::ByteSequence const &tid, std::vector< BinaryAny > const &inArguments) |
OutgoingRequest | lastOutgoingRequest (rtl::ByteSequence const &tid) |
bool | isProtocolPropertiesRequest (std::u16string_view oid, com::sun::star::uno::TypeDescription const &type) const |
void | setCurrentContextMode () |
bool | isCurrentContextMode () |
Private Types | |
enum | State { STATE_INITIAL , STATE_STARTED , STATE_TERMINATED , STATE_FINAL } |
enum | Mode { MODE_REQUESTED , MODE_REPLY_MINUS1 , MODE_REPLY_0 , MODE_REPLY_1 , MODE_WAIT , MODE_NORMAL , MODE_NORMAL_WAIT } |
typedef std::vector< com::sun::star::uno::Reference< com::sun::star::lang::XEventListener > > | Listeners |
typedef std::map< com::sun::star::uno::TypeDescription, SubStub > | Stub |
typedef std::map< OUString, Stub > | Stubs |
Private Member Functions | |
Bridge (const Bridge &)=delete | |
Bridge & | operator= (const Bridge &)=delete |
virtual | ~Bridge () override |
virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL | getInstance (OUString const &sInstanceName) override |
virtual OUString SAL_CALL | getName () override |
virtual OUString SAL_CALL | getDescription () override |
virtual void SAL_CALL | dispose () override |
virtual void SAL_CALL | addEventListener (com::sun::star::uno::Reference< com::sun::star::lang::XEventListener > const &xListener) override |
virtual void SAL_CALL | removeEventListener (com::sun::star::uno::Reference< com::sun::star::lang::XEventListener > const &aListener) override |
void | sendCommitChangeRequest () |
void | sendProtPropRequest (OutgoingRequest::Kind kind, std::vector< BinaryAny > const &inArguments) |
void | makeReleaseCall (OUString const &oid, com::sun::star::uno::TypeDescription const &type) |
void | sendRequest (rtl::ByteSequence const &tid, OUString const &oid, com::sun::star::uno::TypeDescription const &type, com::sun::star::uno::TypeDescription const &member, std::vector< BinaryAny > &&inArguments) |
void | throwException (bool exception, BinaryAny const &value) |
com::sun::star::uno::Any | mapBinaryToCppAny (BinaryAny const &binaryAny) |
bool | becameUnused () const |
void | terminateWhenUnused (bool unused) |
void | checkDisposed () |
Private Attributes | |
rtl::Reference< BridgeFactory > | factory_ |
OUString | name_ |
com::sun::star::uno::Reference< com::sun::star::connection::XConnection > | connection_ |
com::sun::star::uno::Reference< com::sun::star::bridge::XInstanceProvider > | provider_ |
com::sun::star::uno::Environment | binaryUno_ |
com::sun::star::uno::Mapping | cppToBinaryMapping_ |
com::sun::star::uno::Mapping | binaryToCppMapping_ |
rtl::ByteSequence | protPropTid_ |
OUString | protPropOid_ |
com::sun::star::uno::TypeDescription | protPropType_ |
com::sun::star::uno::TypeDescription | protPropRequest_ |
com::sun::star::uno::TypeDescription | protPropCommit_ |
OutgoingRequests | outgoingRequests_ |
osl::Condition | passive_ |
osl::Condition | terminated_ |
std::mutex | mutex_ |
State | state_ |
Listeners | listeners_ |
uno_ThreadPool | threadPool_ |
rtl::Reference< Writer > | writer_ |
rtl::Reference< Reader > | reader_ |
bool | currentContextMode_ |
Stubs | stubs_ |
std::size_t | proxies_ |
std::size_t | calls_ |
bool | normalCall_ |
std::size_t | activeCalls_ |
Mode | mode_ |
sal_Int32 | random_ |
Definition at line 67 of file bridge.hxx.
|
private |
Definition at line 225 of file bridge.hxx.
|
private |
Definition at line 229 of file bridge.hxx.
|
private |
Definition at line 231 of file bridge.hxx.
|
private |
Enumerator | |
---|---|
MODE_REQUESTED | |
MODE_REPLY_MINUS1 | |
MODE_REPLY_0 | |
MODE_REPLY_1 | |
MODE_WAIT | |
MODE_NORMAL | |
MODE_NORMAL_WAIT |
Definition at line 235 of file bridge.hxx.
|
private |
Enumerator | |
---|---|
STATE_INITIAL | |
STATE_STARTED | |
STATE_TERMINATED | |
STATE_FINAL |
Definition at line 233 of file bridge.hxx.
binaryurp::Bridge::Bridge | ( | rtl::Reference< BridgeFactory > const & | factory, |
OUString | name, | ||
com::sun::star::uno::Reference< com::sun::star::connection::XConnection > const & | connection, | ||
com::sun::star::uno::Reference< com::sun::star::bridge::XInstanceProvider > | provider | ||
) |
|
privatedelete |
|
overrideprivatevirtual |
Definition at line 838 of file bridge.cxx.
References dispose(), mutex_, name_, SAL_WARN_IF, state_, STATE_STARTED, and STATE_TERMINATED.
|
overrideprivatevirtual |
Definition at line 925 of file bridge.cxx.
References listeners_, mutex_, state_, STATE_INITIAL, and STATE_STARTED.
|
private |
Definition at line 1030 of file bridge.cxx.
References calls_, normalCall_, proxies_, and stubs_.
Referenced by decrementCalls(), freeProxy(), and releaseStub().
|
private |
Definition at line 1043 of file bridge.cxx.
References state_, STATE_INITIAL, and STATE_STARTED.
Referenced by getThreadPool(), and getWriter().
|
noexcept |
Definition at line 578 of file bridge.cxx.
References activeCalls_, mutex_, and passive_.
Referenced by makeCall().
void binaryurp::Bridge::decrementCalls | ( | ) |
Definition at line 558 of file bridge.cxx.
References becameUnused(), calls_, mutex_, and terminateWhenUnused().
Referenced by handleCommitChangeReply(), handleRequestChangeReply(), and makeCall().
|
overrideprivatevirtual |
Definition at line 912 of file bridge.cxx.
References passive_, and terminate().
Referenced by ~Bridge().
css::uno::UnoInterfaceReference binaryurp::Bridge::findStub | ( | OUString const & | oid, |
com::sun::star::uno::TypeDescription const & | type | ||
) |
Definition at line 459 of file bridge.cxx.
References i, mutex_, stubs_, type, and typelib_typedescription_isAssignableFrom().
Referenced by registerIncomingInterface().
void binaryurp::Bridge::freeProxy | ( | Proxy & | proxy | ) |
Definition at line 532 of file bridge.cxx.
References becameUnused(), binaryurp::Proxy::getOid(), binaryurp::Proxy::getType(), makeReleaseCall(), mutex_, proxies_, SAL_INFO, SAL_WARN, and terminateWhenUnused().
|
inline |
Definition at line 90 of file bridge.hxx.
References connection_.
|
inline |
Definition at line 95 of file bridge.hxx.
References cppToBinaryMapping_.
|
overrideprivatevirtual |
Definition at line 907 of file bridge.cxx.
References connection_, and name_.
|
overrideprivatevirtual |
Definition at line 851 of file bridge.cxx.
References binaryToCppMapping_, binaryurp::BinaryAny::getType(), binaryurp::BinaryAny::getValue(), i, makeCall(), p, t, and throwException().
|
overrideprivatevirtual |
Definition at line 903 of file bridge.cxx.
References name_.
|
inline |
Definition at line 93 of file bridge.hxx.
References provider_.
uno_ThreadPool binaryurp::Bridge::getThreadPool | ( | ) |
Definition at line 365 of file bridge.cxx.
References checkDisposed(), mutex_, and threadPool_.
Referenced by makeCall().
rtl::Reference< Writer > binaryurp::Bridge::getWriter | ( | ) |
Definition at line 372 of file bridge.cxx.
References checkDisposed(), mutex_, and writer_.
Referenced by handleCommitChangeReply(), handleCommitChangeRequest(), handleRequestChangeReply(), handleRequestChangeRequest(), sendProtPropRequest(), and sendRequest().
void binaryurp::Bridge::handleCommitChangeReply | ( | bool | exception, |
BinaryAny const & | returnValue | ||
) |
Definition at line 696 of file bridge.cxx.
References decrementCalls(), getWriter(), mode_, MODE_NORMAL, MODE_REPLY_1, MODE_REQUESTED, setCurrentContextMode(), and throwException().
void binaryurp::Bridge::handleCommitChangeRequest | ( | rtl::ByteSequence const & | tid, |
std::vector< BinaryAny > const & | inArguments | ||
) |
Definition at line 765 of file bridge.cxx.
References getWriter(), mapBinaryToCppAny(), mapCppToBinaryAny(), mode_, MODE_NORMAL, MODE_NORMAL_WAIT, MODE_REQUESTED, MODE_WAIT, protPropCommit_, sendRequestChangeRequest(), and setCurrentContextMode().
void binaryurp::Bridge::handleRequestChangeReply | ( | bool | exception, |
BinaryAny const & | returnValue | ||
) |
Definition at line 634 of file bridge.cxx.
References decrementCalls(), binaryurp::BinaryAny::getValue(), getWriter(), mode_, MODE_NORMAL, MODE_REPLY_0, MODE_REPLY_1, MODE_REPLY_MINUS1, MODE_REQUESTED, MODE_WAIT, n, SAL_WARN, sendCommitChangeRequest(), sendRequestChangeRequest(), and throwException().
void binaryurp::Bridge::handleRequestChangeRequest | ( | rtl::ByteSequence const & | tid, |
std::vector< BinaryAny > const & | inArguments | ||
) |
Definition at line 714 of file bridge.cxx.
References getWriter(), mode_, MODE_NORMAL, MODE_NORMAL_WAIT, MODE_REPLY_0, MODE_REPLY_1, MODE_REPLY_MINUS1, MODE_REQUESTED, n2, protPropRequest_, and random_.
|
noexcept |
Definition at line 569 of file bridge.cxx.
References activeCalls_, calls_, mutex_, and passive_.
Referenced by makeCall().
|
noexcept |
Definition at line 551 of file bridge.cxx.
References calls_, mutex_, and normalCall_.
Referenced by makeCall(), and sendProtPropRequest().
bool binaryurp::Bridge::isCurrentContextMode | ( | ) |
Definition at line 833 of file bridge.cxx.
References currentContextMode_, and mutex_.
bool binaryurp::Bridge::isProtocolPropertiesRequest | ( | std::u16string_view | oid, |
com::sun::star::uno::TypeDescription const & | type | ||
) | const |
Definition at line 822 of file bridge.cxx.
References protPropOid_, protPropType_, and type.
OutgoingRequest binaryurp::Bridge::lastOutgoingRequest | ( | rtl::ByteSequence const & | tid | ) |
Definition at line 816 of file bridge.cxx.
References outgoingRequests_, binaryurp::OutgoingRequests::pop(), and binaryurp::OutgoingRequests::top().
bool binaryurp::Bridge::makeCall | ( | OUString const & | oid, |
com::sun::star::uno::TypeDescription const & | member, | ||
bool | setter, | ||
std::vector< BinaryAny > && | inArguments, | ||
BinaryAny * | returnValue, | ||
std::vector< BinaryAny > * | outArguments | ||
) |
Definition at line 587 of file bridge.cxx.
References decrementActiveCalls(), decrementCalls(), getThreadPool(), incrementActiveCalls(), incrementCalls(), binaryurp::OutgoingRequest::KIND_NORMAL, outgoingRequests_, sendRequest(), and uno_threadpool_enter().
Referenced by getInstance().
|
private |
Definition at line 977 of file bridge.cxx.
References sendRequest(), binaryurp::cache::size, and type.
Referenced by freeProxy(), and registerIncomingInterface().
|
private |
Definition at line 1019 of file bridge.cxx.
References binaryToCppMapping_, in, and uno_copyAndConvertData().
Referenced by handleCommitChangeRequest(), and throwException().
BinaryAny binaryurp::Bridge::mapCppToBinaryAny | ( | com::sun::star::uno::Any const & | cppAny | ) |
Definition at line 354 of file bridge.cxx.
References cppToBinaryMapping_, binaryurp::BinaryAny::get(), in, uno_copyAndConvertData(), and binaryurp::BinaryAny::~BinaryAny().
Referenced by handleCommitChangeRequest(), and sendCommitChangeRequest().
css::uno::UnoInterfaceReference binaryurp::Bridge::registerIncomingInterface | ( | OUString const & | oid, |
com::sun::star::uno::TypeDescription const & | type | ||
) |
Definition at line 379 of file bridge.cxx.
References binaryUno_, findStub(), makeReleaseCall(), mutex_, proxies_, and type.
OUString binaryurp::Bridge::registerOutgoingInterface | ( | com::sun::star::uno::UnoInterfaceReference const & | object, |
com::sun::star::uno::TypeDescription const & | type | ||
) |
Definition at line 412 of file bridge.cxx.
References binaryUno_, i, binaryurp::Proxy::isProxy(), mutex_, SAL_MAX_UINT32, stubs_, and type.
void binaryurp::Bridge::releaseStub | ( | OUString const & | oid, |
com::sun::star::uno::TypeDescription const & | type | ||
) |
Definition at line 482 of file bridge.cxx.
References becameUnused(), binaryUno_, i, mutex_, stubs_, terminateWhenUnused(), and type.
|
overrideprivatevirtual |
Definition at line 941 of file bridge.cxx.
References i, listeners_, and mutex_.
void binaryurp::Bridge::resurrectProxy | ( | Proxy & | proxy | ) |
Definition at line 516 of file bridge.cxx.
References binaryUno_, binaryurp::Proxy::getOid(), binaryurp::Proxy::getType(), and p.
void binaryurp::Bridge::revokeProxy | ( | Proxy & | proxy | ) |
Definition at line 527 of file bridge.cxx.
References binaryUno_.
|
private |
Definition at line 952 of file bridge.cxx.
References a, binaryurp::OutgoingRequest::KIND_COMMIT_CHANGE, mapCppToBinaryAny(), mode_, MODE_REPLY_1, MODE_REQUESTED, and sendProtPropRequest().
Referenced by handleRequestChangeReply().
|
private |
Definition at line 960 of file bridge.cxx.
References getWriter(), incrementCalls(), binaryurp::OutgoingRequest::KIND_COMMIT_CHANGE, binaryurp::OutgoingRequest::KIND_REQUEST_CHANGE, outgoingRequests_, protPropCommit_, protPropOid_, protPropRequest_, protPropTid_, and protPropType_.
Referenced by sendCommitChangeRequest(), and sendRequestChangeRequest().
|
private |
Definition at line 1004 of file bridge.cxx.
References getWriter(), and type.
Referenced by makeCall(), and makeReleaseCall().
void binaryurp::Bridge::sendRequestChangeRequest | ( | ) |
Definition at line 624 of file bridge.cxx.
References a, binaryurp::OutgoingRequest::KIND_REQUEST_CHANGE, mode_, MODE_REQUESTED, random_, and sendProtPropRequest().
Referenced by handleCommitChangeRequest(), and handleRequestChangeReply().
void binaryurp::Bridge::setCurrentContextMode | ( | ) |
Definition at line 828 of file bridge.cxx.
References currentContextMode_, and mutex_.
Referenced by handleCommitChangeReply(), and handleCommitChangeRequest().
void binaryurp::Bridge::start | ( | ) |
Definition at line 208 of file bridge.cxx.
References mutex_, reader_, state_, STATE_INITIAL, STATE_STARTED, threadPool_, uno_threadpool_create(), w, and writer_.
void binaryurp::Bridge::terminate | ( | bool | final | ) |
Definition at line 232 of file bridge.cxx.
References binaryUno_, connection_, factory_, listeners_, mutex_, reader_, SAL_INFO, SAL_WARN, state_, STATE_FINAL, STATE_INITIAL, STATE_STARTED, STATE_TERMINATED, stubs_, terminated_, threadPool_, toString(), uno_threadpool_destroy(), uno_threadpool_dispose(), w, and writer_.
Referenced by dispose(), and terminateWhenUnused().
|
private |
Definition at line 1034 of file bridge.cxx.
References terminate().
Referenced by decrementCalls(), freeProxy(), and releaseStub().
|
private |
Definition at line 1013 of file bridge.cxx.
References mapBinaryToCppAny(), cppu::throwException(), and value.
Referenced by getInstance(), handleCommitChangeReply(), and handleRequestChangeReply().
|
private |
Definition at line 272 of file bridge.hxx.
Referenced by decrementActiveCalls(), and incrementActiveCalls().
|
private |
Definition at line 247 of file bridge.hxx.
Referenced by getInstance(), and mapBinaryToCppAny().
|
private |
Definition at line 245 of file bridge.hxx.
Referenced by registerIncomingInterface(), registerOutgoingInterface(), releaseStub(), resurrectProxy(), revokeProxy(), and terminate().
|
private |
Definition at line 270 of file bridge.hxx.
Referenced by becameUnused(), decrementCalls(), incrementActiveCalls(), and incrementCalls().
|
private |
Definition at line 242 of file bridge.hxx.
Referenced by getConnection(), getDescription(), and terminate().
|
private |
Definition at line 246 of file bridge.hxx.
Referenced by getCppToBinaryMapping(), and mapCppToBinaryAny().
|
private |
Definition at line 267 of file bridge.hxx.
Referenced by isCurrentContextMode(), and setCurrentContextMode().
|
private |
Definition at line 239 of file bridge.hxx.
Referenced by terminate().
|
private |
Definition at line 263 of file bridge.hxx.
Referenced by addEventListener(), removeEventListener(), and terminate().
|
private |
Definition at line 275 of file bridge.hxx.
Referenced by handleCommitChangeReply(), handleCommitChangeRequest(), handleRequestChangeReply(), handleRequestChangeRequest(), sendCommitChangeRequest(), and sendRequestChangeRequest().
|
private |
Definition at line 261 of file bridge.hxx.
Referenced by addEventListener(), decrementActiveCalls(), decrementCalls(), findStub(), freeProxy(), getThreadPool(), getWriter(), incrementActiveCalls(), incrementCalls(), isCurrentContextMode(), registerIncomingInterface(), registerOutgoingInterface(), releaseStub(), removeEventListener(), setCurrentContextMode(), start(), terminate(), and ~Bridge().
|
private |
Definition at line 240 of file bridge.hxx.
Referenced by getDescription(), getName(), and ~Bridge().
|
private |
Definition at line 271 of file bridge.hxx.
Referenced by becameUnused(), and incrementCalls().
|
private |
Definition at line 253 of file bridge.hxx.
Referenced by lastOutgoingRequest(), makeCall(), and sendProtPropRequest().
|
private |
Definition at line 254 of file bridge.hxx.
Referenced by decrementActiveCalls(), dispose(), and incrementActiveCalls().
|
private |
Definition at line 252 of file bridge.hxx.
Referenced by handleCommitChangeRequest(), and sendProtPropRequest().
|
private |
Definition at line 249 of file bridge.hxx.
Referenced by isProtocolPropertiesRequest(), and sendProtPropRequest().
|
private |
Definition at line 251 of file bridge.hxx.
Referenced by handleRequestChangeRequest(), and sendProtPropRequest().
|
private |
Definition at line 248 of file bridge.hxx.
Referenced by sendProtPropRequest().
|
private |
Definition at line 250 of file bridge.hxx.
Referenced by isProtocolPropertiesRequest(), and sendProtPropRequest().
|
private |
Definition at line 244 of file bridge.hxx.
Referenced by getProvider().
|
private |
Definition at line 269 of file bridge.hxx.
Referenced by becameUnused(), freeProxy(), and registerIncomingInterface().
|
private |
Definition at line 276 of file bridge.hxx.
Referenced by handleRequestChangeRequest(), and sendRequestChangeRequest().
|
private |
Definition at line 266 of file bridge.hxx.
Referenced by start(), and terminate().
|
private |
Definition at line 262 of file bridge.hxx.
Referenced by addEventListener(), checkDisposed(), start(), terminate(), and ~Bridge().
|
private |
Definition at line 268 of file bridge.hxx.
Referenced by becameUnused(), findStub(), registerOutgoingInterface(), releaseStub(), and terminate().
|
private |
Definition at line 259 of file bridge.hxx.
Referenced by terminate().
|
private |
Definition at line 264 of file bridge.hxx.
Referenced by getThreadPool(), start(), and terminate().
|
private |
Definition at line 265 of file bridge.hxx.
Referenced by getWriter(), start(), and terminate().