forked from Kistler-Group/sdbus-cpp
Having explicit conversion operator is a good practice according to the C++ core guidelines, as it makes the code safer and better follows the principle of least astonishment. Also, it is consistent with the standard library style, where wrappers like std::variant, std::any, std::optional... also do not provide an implicit conversion to the underlying type. Last but not least, it paves the way for the upcoming std::variant <-> sdbus::Variant implicit conversions without surprising behavior in some edge cases.
60 lines
1.2 KiB
C++
60 lines
1.2 KiB
C++
|
|
/*
|
|
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
|
*/
|
|
|
|
#ifndef __sdbuscpp__examplemanager_planet1_client_glue_h__proxy__H__
|
|
#define __sdbuscpp__examplemanager_planet1_client_glue_h__proxy__H__
|
|
|
|
#include <sdbus-c++/sdbus-c++.h>
|
|
#include <string>
|
|
#include <tuple>
|
|
|
|
namespace org {
|
|
namespace sdbuscpp {
|
|
namespace ExampleManager {
|
|
|
|
class Planet1_proxy
|
|
{
|
|
public:
|
|
static inline const sdbus::InterfaceName INTERFACE_NAME{"org.sdbuscpp.ExampleManager.Planet1"};
|
|
|
|
protected:
|
|
Planet1_proxy(sdbus::IProxy& proxy)
|
|
: proxy_(&proxy)
|
|
{
|
|
}
|
|
|
|
Planet1_proxy(const Planet1_proxy&) = delete;
|
|
Planet1_proxy& operator=(const Planet1_proxy&) = delete;
|
|
Planet1_proxy(Planet1_proxy&&) = default;
|
|
Planet1_proxy& operator=(Planet1_proxy&&) = default;
|
|
|
|
~Planet1_proxy() = default;
|
|
|
|
void registerProxy()
|
|
{
|
|
}
|
|
|
|
public:
|
|
uint64_t GetPopulation()
|
|
{
|
|
uint64_t result;
|
|
proxy_->callMethod("GetPopulation").onInterface(INTERFACE_NAME).storeResultsTo(result);
|
|
return result;
|
|
}
|
|
|
|
public:
|
|
std::string Name()
|
|
{
|
|
return proxy_->getProperty("Name").onInterface(INTERFACE_NAME).get<std::string>();
|
|
}
|
|
|
|
private:
|
|
sdbus::IProxy* proxy_;
|
|
};
|
|
|
|
}}} // namespaces
|
|
|
|
#endif
|