forked from Kistler-Group/sdbus-cpp
Add unregister function to IObject and IProxy API
This commit is contained in:
@@ -35,9 +35,15 @@ class TestingAdaptor : public sdbus::AdaptorInterfaces<testing_adaptor>
|
||||
{
|
||||
public:
|
||||
TestingAdaptor(sdbus::IConnection& connection) :
|
||||
sdbus::AdaptorInterfaces<::testing_adaptor>(connection, OBJECT_PATH) { }
|
||||
AdaptorInterfaces(connection, OBJECT_PATH)
|
||||
{
|
||||
registerAdaptor();
|
||||
}
|
||||
|
||||
virtual ~TestingAdaptor() { }
|
||||
~TestingAdaptor()
|
||||
{
|
||||
unregisterAdaptor();
|
||||
}
|
||||
|
||||
bool wasMultiplyCalled() const { return m_multiplyCalled; }
|
||||
double getMultiplyResult() const { return m_multiplyResult; }
|
||||
|
||||
@@ -31,7 +31,16 @@
|
||||
class TestingProxy : public sdbus::ProxyInterfaces<::testing_proxy, sdbus::introspectable_proxy>
|
||||
{
|
||||
public:
|
||||
using sdbus::ProxyInterfaces<::testing_proxy, sdbus::introspectable_proxy>::ProxyInterfaces;
|
||||
TestingProxy(std::string destination, std::string objectPath)
|
||||
: ProxyInterfaces(std::move(destination), std::move(objectPath))
|
||||
{
|
||||
registerProxy();
|
||||
}
|
||||
|
||||
~TestingProxy()
|
||||
{
|
||||
unregisterProxy();
|
||||
}
|
||||
|
||||
int getSimpleCallCount() const { return m_simpleCallCounter; }
|
||||
std::map<int32_t, std::string> getMap() const { return m_map; }
|
||||
|
||||
Reference in New Issue
Block a user