Implement #104: add getObjectPath() for classes (#105)

* Implement #104: add getObjectPath() for classes

* Implement #104: changes requested in review

Co-authored-by: Christian Schneider <cschneider@radiodata.biz>
This commit is contained in:
ChristianS99
2020-05-28 15:36:58 +02:00
committed by GitHub
parent fb35a9a196
commit ae8849e545
8 changed files with 39 additions and 0 deletions

View File

@ -131,6 +131,14 @@ namespace sdbus {
getObject().unregister();
}
/*!
* @brief Returns object path of the underlying DBus object
*/
const std::string& getObjectPath() const
{
return getObject().getObjectPath();
}
protected:
using base_type = AdaptorInterfaces;
};

View File

@ -435,6 +435,11 @@ namespace sdbus {
* @throws sdbus::Error in case of failure
*/
[[nodiscard]] SignalEmitter emitSignal(const std::string& signalName);
/*!
* @brief Returns object path of the underlying DBus object
*/
virtual const std::string& getObjectPath() const = 0;
};
// Out-of-line member definitions

View File

@ -266,6 +266,11 @@ namespace sdbus {
* @throws sdbus::Error in case of failure
*/
[[nodiscard]] PropertySetter setProperty(const std::string& propertyName);
/*!
* @brief Returns object path of the underlying DBus object
*/
virtual const std::string& getObjectPath() const = 0;
};
/********************************************//**

View File

@ -165,6 +165,14 @@ namespace sdbus {
getProxy().unregister();
}
/*!
* @brief Returns object path of the underlying DBus object
*/
const std::string& getObjectPath() const
{
return getProxy().getObjectPath();
}
protected:
using base_type = ProxyInterfaces;
};