Clean up some names (rename classes, methods, files)

* ConvenienceClasses.h/.inl/.cpp -> ConvenienceApiClasses.h/.inl/.cpp
  * IObjectProxy class -> IProxy
  * Interfaces class -> AdaptorInterfaces
  * Interfaces.h -> split into AdaptorInterfaces.h and ProxyInterfaces.h
  * createObjectProxy() method -> createProxy()
This commit is contained in:
sangelovic
2019-04-09 21:28:07 +02:00
parent e7c78460cf
commit 93b6e5237a
30 changed files with 421 additions and 318 deletions
+3 -3
View File
@@ -23,7 +23,7 @@
* along with sdbus-c++. If not, see <http://www.gnu.org/licenses/>.
*/
#include "perftest-proxy.h"
#include "perftests-proxy.h"
#include <sdbus-c++/sdbus-c++.h>
#include <vector>
#include <string>
@@ -36,11 +36,11 @@
using namespace std::chrono_literals;
class PerftestClient : public sdbus::ProxyInterfaces<org::sdbuscpp::perftest_proxy>
class PerftestClient : public sdbus::ProxyInterfaces<org::sdbuscpp::perftests_proxy>
{
public:
PerftestClient(std::string destination, std::string objectPath)
: sdbus::ProxyInterfaces<org::sdbuscpp::perftest_proxy>(std::move(destination), std::move(objectPath))
: sdbus::ProxyInterfaces<org::sdbuscpp::perftests_proxy>(std::move(destination), std::move(objectPath))
{
}
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<node name="/org/sdbuscpp/perftest">
<interface name="org.sdbuscpp.perftest">
<interface name="org.sdbuscpp.perftests">
<method name="sendDataSignals">
<arg type="u" name="numberOfSignals" direction="in" />
<arg type="u" name="signalMsgSize" direction="in" />
@@ -1,6 +1,6 @@
/*
* This file was automatically generated by sdbuscpp-xml2cpp; DO NOT EDIT!
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
*/
#ifndef __sdbuscpp__perftest_adaptor_h__adaptor__H__
@@ -13,13 +13,13 @@
namespace org {
namespace sdbuscpp {
class perftest_adaptor
class perftests_adaptor
{
public:
static constexpr const char* interfaceName = "org.sdbuscpp.perftests";
protected:
perftest_adaptor(sdbus::IObject& object)
perftests_adaptor(sdbus::IObject& object)
: object_(object)
{
object_.registerMethod("sendDataSignals").onInterface(interfaceName).implementedAs([this](const uint32_t& numberOfSignals, const uint32_t& signalMsgSize){ return this->sendDataSignals(numberOfSignals, signalMsgSize); });
@@ -1,6 +1,6 @@
/*
* This file was automatically generated by sdbuscpp-xml2cpp; DO NOT EDIT!
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
*/
#ifndef __sdbuscpp__perftest_proxy_h__proxy__H__
@@ -13,16 +13,16 @@
namespace org {
namespace sdbuscpp {
class perftest_proxy
class perftests_proxy
{
public:
static constexpr const char* interfaceName = "org.sdbuscpp.perftests";
protected:
perftest_proxy(sdbus::IObjectProxy& object)
: object_(object)
perftests_proxy(sdbus::IProxy& proxy)
: proxy_(proxy)
{
object_.uponSignal("dataSignal").onInterface(interfaceName).call([this](const std::string& data){ this->onDataSignal(data); });
proxy_.uponSignal("dataSignal").onInterface(interfaceName).call([this](const std::string& data){ this->onDataSignal(data); });
}
virtual void onDataSignal(const std::string& data) = 0;
@@ -30,18 +30,18 @@ protected:
public:
void sendDataSignals(const uint32_t& numberOfSignals, const uint32_t& signalMsgSize)
{
object_.callMethod("sendDataSignals").onInterface(interfaceName).withArguments(numberOfSignals, signalMsgSize);
proxy_.callMethod("sendDataSignals").onInterface(interfaceName).withArguments(numberOfSignals, signalMsgSize);
}
std::string concatenateTwoStrings(const std::string& string1, const std::string& string2)
{
std::string result;
object_.callMethod("concatenateTwoStrings").onInterface(interfaceName).withArguments(string1, string2).storeResultsTo(result);
proxy_.callMethod("concatenateTwoStrings").onInterface(interfaceName).withArguments(string1, string2).storeResultsTo(result);
return result;
}
private:
sdbus::IObjectProxy& object_;
sdbus::IProxy& proxy_;
};
}} // namespaces
+3 -3
View File
@@ -23,7 +23,7 @@
* along with sdbus-c++. If not, see <http://www.gnu.org/licenses/>.
*/
#include "perftest-adaptor.h"
#include "perftests-adaptor.h"
#include <sdbus-c++/sdbus-c++.h>
#include <vector>
#include <string>
@@ -35,11 +35,11 @@ using namespace std::chrono_literals;
std::string createRandomString(size_t length);
class PerftestServer : public sdbus::Interfaces<org::sdbuscpp::perftest_adaptor>
class PerftestServer : public sdbus::AdaptorInterfaces<org::sdbuscpp::perftests_adaptor>
{
public:
PerftestServer(sdbus::IConnection& connection, std::string objectPath)
: sdbus::Interfaces<org::sdbuscpp::perftest_adaptor>(connection, std::move(objectPath))
: sdbus::AdaptorInterfaces<org::sdbuscpp::perftests_adaptor>(connection, std::move(objectPath))
{
}