summaryrefslogtreecommitdiff
path: root/src/test/src-gen/dbus/v1_0/commonapi/tests/ExtendedInterfaceDBusStubAdapter.cpp
blob: 3e3fdacf1209fdade82fc80442ba4080f5f588d5 (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
/*
* This file was generated by the CommonAPI Generators.
* Used org.genivi.commonapi.core 3.1.2.v201506150834.
* Used org.franca.core 0.9.1.201412191134.
*
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file, You can obtain one at
* http://mozilla.org/MPL/2.0/.
*/
#include <v1_0/commonapi/tests/ExtendedInterface.hpp>
#include <v1_0/commonapi/tests/ExtendedInterfaceDBusStubAdapter.hpp>

namespace v1_0 {
namespace commonapi {
namespace tests {

std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createExtendedInterfaceDBusStubAdapter(
                   const CommonAPI::DBus::DBusAddress &_address,
                   const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection,
                   const std::shared_ptr<CommonAPI::StubBase> &_stub) {
    return std::make_shared<ExtendedInterfaceDBusStubAdapter>(_address, _connection, _stub);
}

INITIALIZER(registerExtendedInterfaceDBusStubAdapter) {
    CommonAPI::DBus::Factory::get()->registerStubAdapterCreateMethod(
    	ExtendedInterface::getInterface(), &createExtendedInterfaceDBusStubAdapter);
}

ExtendedInterfaceDBusStubAdapterInternal::~ExtendedInterfaceDBusStubAdapterInternal() {
    deactivateManagedInstances();
    ExtendedInterfaceDBusStubAdapterHelper::deinit();
}

void ExtendedInterfaceDBusStubAdapterInternal::deactivateManagedInstances() {

}

const char* ExtendedInterfaceDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const {
    static const std::string introspectionData =
        std::string(TestInterfaceDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData()) +
        "<method name=\"TestIntMethodExtended\">\n"
            "<arg name=\"_inInt\" type=\"u\" direction=\"in\" />\n"
        "</method>\n"

    ;
    return introspectionData.c_str();
}

CommonAPI::DBus::DBusGetAttributeStubDispatcher<
        ExtendedInterfaceStub,
        CommonAPI::Version
        > ExtendedInterfaceDBusStubAdapterInternal::getExtendedInterfaceInterfaceVersionStubDispatcher(&ExtendedInterfaceStub::getInterfaceVersion, "uu");


#ifdef WIN32
CommonAPI::DBus::DBusGetAttributeStubDispatcher<
        ExtendedInterfaceStub,
        uint32_t
        > ExtendedInterfaceDBusStubAdapterInternal::getTestPredefinedTypeAttributeAttributeStubDispatcher(&ExtendedInterfaceStub::getTestPredefinedTypeAttributeAttribute, "u");
CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher<
        ExtendedInterfaceStub,
        uint32_t
        > ExtendedInterfaceDBusStubAdapterInternal::setTestPredefinedTypeAttributeAttributeStubDispatcher(
                &ExtendedInterfaceStub::getTestPredefinedTypeAttributeAttribute,
                &ExtendedInterfaceStubRemoteEvent::onRemoteSetTestPredefinedTypeAttributeAttribute,
                &ExtendedInterfaceStubRemoteEvent::onRemoteTestPredefinedTypeAttributeAttributeChanged
                ,&ExtendedInterfaceStubAdapter::fireTestPredefinedTypeAttributeAttributeChanged
                ,"u"
                );
CommonAPI::DBus::DBusGetAttributeStubDispatcher<
        ExtendedInterfaceStub,
        ::commonapi::tests::DerivedTypeCollection::TestStructExtended
        > ExtendedInterfaceDBusStubAdapterInternal::getTestDerivedStructAttributeAttributeStubDispatcher(&ExtendedInterfaceStub::getTestDerivedStructAttributeAttribute, "(sqi)");
CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher<
        ExtendedInterfaceStub,
        ::commonapi::tests::DerivedTypeCollection::TestStructExtended
        > ExtendedInterfaceDBusStubAdapterInternal::setTestDerivedStructAttributeAttributeStubDispatcher(
                &ExtendedInterfaceStub::getTestDerivedStructAttributeAttribute,
                &ExtendedInterfaceStubRemoteEvent::onRemoteSetTestDerivedStructAttributeAttribute,
                &ExtendedInterfaceStubRemoteEvent::onRemoteTestDerivedStructAttributeAttributeChanged
                ,&ExtendedInterfaceStubAdapter::fireTestDerivedStructAttributeAttributeChanged
                ,"(sqi)"
                );
CommonAPI::DBus::DBusGetAttributeStubDispatcher<
        ExtendedInterfaceStub,
        ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64
        > ExtendedInterfaceDBusStubAdapterInternal::getTestDerivedArrayAttributeAttributeStubDispatcher(&ExtendedInterfaceStub::getTestDerivedArrayAttributeAttribute, "at");
CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher<
        ExtendedInterfaceStub,
        ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64
        > ExtendedInterfaceDBusStubAdapterInternal::setTestDerivedArrayAttributeAttributeStubDispatcher(
                &ExtendedInterfaceStub::getTestDerivedArrayAttributeAttribute,
                &ExtendedInterfaceStubRemoteEvent::onRemoteSetTestDerivedArrayAttributeAttribute,
                &ExtendedInterfaceStubRemoteEvent::onRemoteTestDerivedArrayAttributeAttributeChanged
                ,&ExtendedInterfaceStubAdapter::fireTestDerivedArrayAttributeAttributeChanged
                ,"at"
                );
#endif

CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
    ExtendedInterfaceStub,
    std::tuple<uint32_t>,
    std::tuple<>
    > ExtendedInterfaceDBusStubAdapterInternal::testIntMethodExtendedStubDispatcher(&ExtendedInterfaceStub::TestIntMethodExtended, "", std::tuple<uint32_t>());

#ifdef WIN32
CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
    ExtendedInterfaceStub,
    std::tuple<>,
    std::tuple<>
    > ExtendedInterfaceDBusStubAdapterInternal::testEmptyMethodStubDispatcher(&ExtendedInterfaceStub::testEmptyMethod, "", std::tuple<>());
CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
    ExtendedInterfaceStub,
    std::tuple<uint32_t, std::string>,
    std::tuple<>
    > ExtendedInterfaceDBusStubAdapterInternal::testVoidPredefinedTypeMethodStubDispatcher(&ExtendedInterfaceStub::testVoidPredefinedTypeMethod, "", std::tuple<uint32_t, std::string>());
CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
    ExtendedInterfaceStub,
    std::tuple<uint32_t, std::string>,
    std::tuple<uint32_t, std::string>
    > ExtendedInterfaceDBusStubAdapterInternal::testPredefinedTypeMethodStubDispatcher(&ExtendedInterfaceStub::testPredefinedTypeMethod, "us", std::tuple<uint32_t, std::string, uint32_t, std::string>());
CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
    ExtendedInterfaceStub,
    std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>,
    std::tuple<>
    > ExtendedInterfaceDBusStubAdapterInternal::testVoidDerivedTypeMethodStubDispatcher(&ExtendedInterfaceStub::testVoidDerivedTypeMethod, "", std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>());
CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
    ExtendedInterfaceStub,
    std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>,
    std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>
    > ExtendedInterfaceDBusStubAdapterInternal::testDerivedTypeMethodStubDispatcher(&ExtendedInterfaceStub::testDerivedTypeMethod, "ia{ua(sq)}", std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap, ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>());
CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
    ExtendedInterfaceStub,
    std::tuple<std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>>>,
    std::tuple<>
    > ExtendedInterfaceDBusStubAdapterInternal::testArrayOfPolymorphicStructMethodStubDispatcher(&ExtendedInterfaceStub::TestArrayOfPolymorphicStructMethod, "", std::tuple<std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>>>());
CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
    ExtendedInterfaceStub,
    std::tuple<::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic>,
    std::tuple<>
    > ExtendedInterfaceDBusStubAdapterInternal::testMapOfPolymorphicStructMethodStubDispatcher(&ExtendedInterfaceStub::TestMapOfPolymorphicStructMethod, "", std::tuple<::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic>());
CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
    ExtendedInterfaceStub,
    std::tuple<::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember>,
    std::tuple<>
    > ExtendedInterfaceDBusStubAdapterInternal::testStructWithPolymorphicMemberMethodStubDispatcher(&ExtendedInterfaceStub::TestStructWithPolymorphicMemberMethod, "", std::tuple<::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember>());
CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
    ExtendedInterfaceStub,
    std::tuple<::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap>,
    std::tuple<>
    > ExtendedInterfaceDBusStubAdapterInternal::testStructWithEnumKeyMapMemberStubDispatcher(&ExtendedInterfaceStub::TestStructWithEnumKeyMapMember, "", std::tuple<::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap>());
#endif



#ifdef WIN32
CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher<
    ExtendedInterfaceStub,
    ExtendedInterfaceStubAdapter,
    std::tuple<>,
    std::tuple<bool>
    > ExtendedInterfaceDBusStubAdapterInternal::subscribeTestSelectiveBroadcastSelectiveStubDispatcher(&ExtendedInterfaceStubAdapter::subscribeForTestSelectiveBroadcastSelective, "b");

CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher<
    ExtendedInterfaceStub,
    ExtendedInterfaceStubAdapter,
    std::tuple<>,
    std::tuple<>
    > ExtendedInterfaceDBusStubAdapterInternal::unsubscribeTestSelectiveBroadcastSelectiveStubDispatcher(&ExtendedInterfaceStubAdapter::unsubscribeFromTestSelectiveBroadcastSelective, "");
CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher<
    ExtendedInterfaceStub,
    ExtendedInterfaceStubAdapter,
    std::tuple<>,
    std::tuple<bool>
    > ExtendedInterfaceDBusStubAdapterInternal::subscribeTestBroadcastWithOutArgsSelectiveStubDispatcher(&ExtendedInterfaceStubAdapter::subscribeForTestBroadcastWithOutArgsSelective, "b");

CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher<
    ExtendedInterfaceStub,
    ExtendedInterfaceStubAdapter,
    std::tuple<>,
    std::tuple<>
    > ExtendedInterfaceDBusStubAdapterInternal::unsubscribeTestBroadcastWithOutArgsSelectiveStubDispatcher(&ExtendedInterfaceStubAdapter::unsubscribeFromTestBroadcastWithOutArgsSelective, "");
#endif

const ExtendedInterfaceDBusStubAdapterHelper::StubDispatcherTable& ExtendedInterfaceDBusStubAdapterInternal::getStubDispatcherTable() {
    return stubDispatcherTable_;
}

const CommonAPI::DBus::StubAttributeTable& ExtendedInterfaceDBusStubAdapterInternal::getStubAttributeTable() {
    return stubAttributeTable_;
}

ExtendedInterfaceDBusStubAdapterInternal::ExtendedInterfaceDBusStubAdapterInternal(
        const CommonAPI::DBus::DBusAddress &_address,
        const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection,
        const std::shared_ptr<CommonAPI::StubBase> &_stub)
	: CommonAPI::DBus::DBusStubAdapter(_address, _connection,false),
      ExtendedInterfaceDBusStubAdapterHelper(_address, _connection, std::dynamic_pointer_cast<ExtendedInterfaceStub>(_stub), false),
      TestInterfaceDBusStubAdapterInternal(_address, _connection, _stub),
      stubDispatcherTable_({
            { { "TestIntMethodExtended", "u" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testIntMethodExtendedStubDispatcher }
            #ifdef WIN32
            ,
            { { "getTestPredefinedTypeAttributeAttribute", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::getTestPredefinedTypeAttributeAttributeStubDispatcher }
            , { { "setTestPredefinedTypeAttributeAttribute", "u" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::setTestPredefinedTypeAttributeAttributeStubDispatcher },
            { { "getTestDerivedStructAttributeAttribute", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::getTestDerivedStructAttributeAttributeStubDispatcher }
            , { { "setTestDerivedStructAttributeAttribute", "(sqi)" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::setTestDerivedStructAttributeAttributeStubDispatcher },
            { { "getTestDerivedArrayAttributeAttribute", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::getTestDerivedArrayAttributeAttributeStubDispatcher }
            , { { "setTestDerivedArrayAttributeAttribute", "at" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::setTestDerivedArrayAttributeAttributeStubDispatcher }
            ,
            { { "testEmptyMethod", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testEmptyMethodStubDispatcher },
            { { "testVoidPredefinedTypeMethod", "us" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testVoidPredefinedTypeMethodStubDispatcher },
            { { "testPredefinedTypeMethod", "us" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testPredefinedTypeMethodStubDispatcher },
            { { "testVoidDerivedTypeMethod", "ia{ua(sq)}" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testVoidDerivedTypeMethodStubDispatcher },
            { { "testDerivedTypeMethod", "ia{ua(sq)}" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testDerivedTypeMethodStubDispatcher },
            { { "TestArrayOfPolymorphicStructMethod", "a(uv)" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testArrayOfPolymorphicStructMethodStubDispatcher },
            { { "TestMapOfPolymorphicStructMethod", "a{y(uv)}" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testMapOfPolymorphicStructMethodStubDispatcher },
            { { "TestStructWithPolymorphicMemberMethod", "(u(uv))" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testStructWithPolymorphicMemberMethodStubDispatcher },
            { { "TestStructWithEnumKeyMapMember", "(a{is})" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testStructWithEnumKeyMapMemberStubDispatcher }
            ,
            { { "subscribeForTestSelectiveBroadcastSelective", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::subscribeTestSelectiveBroadcastSelectiveStubDispatcher }
            ,
            { { "unsubscribeFromTestSelectiveBroadcastSelective", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::unsubscribeTestSelectiveBroadcastSelectiveStubDispatcher },
            { { "subscribeForTestBroadcastWithOutArgsSelective", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::subscribeTestBroadcastWithOutArgsSelectiveStubDispatcher }
            ,
            { { "unsubscribeFromTestBroadcastWithOutArgsSelective", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::unsubscribeTestBroadcastWithOutArgsSelectiveStubDispatcher }
            #endif
            }),
        stubAttributeTable_() {

    #ifdef WIN32
    stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::getExtendedInterfaceInterfaceVersionStubDispatcher });
    #else
    auto parentDispatcherTable = TestInterfaceDBusStubAdapterInternal::getStubDispatcherTable();
    stubDispatcherTable_.insert(parentDispatcherTable.begin(), parentDispatcherTable.end());

    auto interfaceVersionGetter = stubDispatcherTable_.find({ "getInterfaceVersion", "" });
    if(interfaceVersionGetter != stubDispatcherTable_.end()) {
        interfaceVersionGetter->second = &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::getExtendedInterfaceInterfaceVersionStubDispatcher;
    } else {
        stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::getExtendedInterfaceInterfaceVersionStubDispatcher });
    }

    auto parentAttributeTable = TestInterfaceDBusStubAdapterInternal::getStubAttributeTable();
    stubAttributeTable_.insert(parentAttributeTable.begin(), parentAttributeTable.end());

    #endif
}

const bool ExtendedInterfaceDBusStubAdapterInternal::hasFreedesktopProperties() {
    return false;
}

} // namespace tests
} // namespace commonapi
} // namespace v1_0