* fix construct/destruct order of mutex/data in AsnycCalls
Destroying a mutex which might still be owned leads to undefined behaviour.
It wasn't the case here but using the right order is more resistant to future bugs.
* proxy AsnycCalls: don't leave map in unspecified state
* fix 133: use thread-safe container for proxy interfaces list
* proxy callback payload uses concrete signalData
* proxy: revert adding the wrapper class InterfaceContainer
It's no longer required and simplifies the locking logic.
* Proxy: avoid additional lambda wrapper around signal callbacks
As proposed in
https://github.com/Kistler-Group/sdbus-cpp/pull/177#issuecomment-834439707
option 3.
Still TODO: Avoid relying on std::map's non-invalidatable by adding just
std::unique_ptr<Proxy::InterfaceData::SignalData> to the container.
* proxy: add missing underscore prefix
* proxy: put InterfaceData::SignalData into a unique_ptr
This ways, we avoid relying on std::map's non-invalidatable references.
* proxy: code style: get raw pointer directly
* style: fix code style
Co-authored-by: Stanislav Angelovic <stanislav.angelovic@siemens.com>
This provides access to the proxy's bus connection so code using
the proxy does not need to store an external reference to it.
A matching function is already available in IObject.
This should not be required in C++17 because there is an appropriate
class template deduction rule [1] which infers that it's going to be a
weak_ptr<T> when constructing from a shared_ptr<T>. However, in
clang/LLVM's libcxx C++ STL implementation this only got implemented in
May 2020 [2].
[1] https://en.cppreference.com/w/cpp/memory/weak_ptr/deduction_guides
[2] https://reviews.llvm.org/D69603
* Proxy::sdbus_signal_handler() needs to return 0 instead of 1 in
order to allow multiple proxies listening to a signal all being
triggered.
* Add test for emitting a signal to multiple proxies on same
connection.