File: examplemanager-planet1-server-glue.h

package info (click to toggle)
sdbus-cpp 2.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,556 kB
  • sloc: cpp: 12,626; ansic: 239; xml: 170; makefile: 27
file content (54 lines) | stat: -rw-r--r-- 1,372 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

/*
 * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
 */

#ifndef __sdbuscpp__examplemanager_planet1_server_glue_h__adaptor__H__
#define __sdbuscpp__examplemanager_planet1_server_glue_h__adaptor__H__

#include <sdbus-c++/sdbus-c++.h>
#include <string>
#include <tuple>

namespace org {
namespace sdbuscpp {
namespace ExampleManager {

class Planet1_adaptor
{
public:
    static constexpr const char* INTERFACE_NAME = "org.sdbuscpp.ExampleManager.Planet1";

protected:
    Planet1_adaptor(sdbus::IObject& object)
        : m_object(object)
    {
    }

    Planet1_adaptor(const Planet1_adaptor&) = delete;
    Planet1_adaptor& operator=(const Planet1_adaptor&) = delete;
    Planet1_adaptor(Planet1_adaptor&&) = delete;
    Planet1_adaptor& operator=(Planet1_adaptor&&) = delete;

    ~Planet1_adaptor() = default;

    void registerAdaptor()
    {
        m_object.addVTable( sdbus::registerMethod("GetPopulation").withOutputParamNames("population").implementedAs([this](){ return this->GetPopulation(); })
                          , sdbus::registerProperty("Name").withGetter([this](){ return this->Name(); })
                          ).forInterface(INTERFACE_NAME);
    }

private:
    virtual uint64_t GetPopulation() = 0;

private:
    virtual std::string Name() = 0;

private:
    sdbus::IObject& m_object;
};

}}} // namespaces

#endif