summaryrefslogtreecommitdiff
path: root/src/test/commonapi/tests/TestInterfaceStubDefault.cpp
blob: e68bf40180b52c5036ffe90bfddd1281e6935580 (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
/*
* This file was generated by the CommonAPI Generators.
*
* 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 <commonapi/tests/TestInterfaceStubDefault.h>

namespace commonapi {
namespace tests {

TestInterfaceStubDefault::TestInterfaceStubDefault():
        remoteEventHandler_(this) {
}

TestInterfaceStubRemoteEvent* TestInterfaceStubDefault::initStubAdapter(const std::shared_ptr<TestInterfaceStubAdapter>& stubAdapter) {
    stubAdapter_ = stubAdapter;
    return &remoteEventHandler_;
}

const uint32_t& TestInterfaceStubDefault::getTestPredefinedTypeAttributeAttribute() {
    return testPredefinedTypeAttributeAttributeValue_;
}

const uint32_t& TestInterfaceStubDefault::getTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId) {
    return getTestPredefinedTypeAttributeAttribute();
}

void TestInterfaceStubDefault::setTestPredefinedTypeAttributeAttribute(uint32_t value) {
    const bool valueChanged = trySetTestPredefinedTypeAttributeAttribute(std::move(value));
    if (valueChanged)
        stubAdapter_->fireTestPredefinedTypeAttributeAttributeChanged(testPredefinedTypeAttributeAttributeValue_);
}

void TestInterfaceStubDefault::setTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId, uint32_t value) {
       setTestPredefinedTypeAttributeAttribute(value);
}

void TestInterfaceStubDefault::onRemoteTestPredefinedTypeAttributeAttributeChanged() {
    // No operation in default
}

bool TestInterfaceStubDefault::trySetTestPredefinedTypeAttributeAttribute(uint32_t value) {
    if (!validateTestPredefinedTypeAttributeAttributeRequestedValue(value))
        return false;

    const bool valueChanged = (testPredefinedTypeAttributeAttributeValue_ != value);
    testPredefinedTypeAttributeAttributeValue_ = std::move(value);
    return valueChanged;
}

bool TestInterfaceStubDefault::validateTestPredefinedTypeAttributeAttributeRequestedValue(const uint32_t& value) {
    return true;
}

bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestPredefinedTypeAttributeAttribute(uint32_t value) {
    return defaultStub_->trySetTestPredefinedTypeAttributeAttribute(std::move(value));
}

bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId, uint32_t value) {
    return onRemoteSetTestPredefinedTypeAttributeAttribute(value);
}

void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestPredefinedTypeAttributeAttributeChanged() {
    defaultStub_->onRemoteTestPredefinedTypeAttributeAttributeChanged();
}

const DerivedTypeCollection::TestStructExtended& TestInterfaceStubDefault::getTestDerivedStructAttributeAttribute() {
    return testDerivedStructAttributeAttributeValue_;
}

const DerivedTypeCollection::TestStructExtended& TestInterfaceStubDefault::getTestDerivedStructAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId) {
    return getTestDerivedStructAttributeAttribute();
}

void TestInterfaceStubDefault::setTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value) {
    const bool valueChanged = trySetTestDerivedStructAttributeAttribute(std::move(value));
    if (valueChanged)
        stubAdapter_->fireTestDerivedStructAttributeAttributeChanged(testDerivedStructAttributeAttributeValue_);
}

void TestInterfaceStubDefault::setTestDerivedStructAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId, DerivedTypeCollection::TestStructExtended value) {
       setTestDerivedStructAttributeAttribute(value);
}

void TestInterfaceStubDefault::onRemoteTestDerivedStructAttributeAttributeChanged() {
    // No operation in default
}

bool TestInterfaceStubDefault::trySetTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value) {
    if (!validateTestDerivedStructAttributeAttributeRequestedValue(value))
        return false;

    const bool valueChanged = (testDerivedStructAttributeAttributeValue_ != value);
    testDerivedStructAttributeAttributeValue_ = std::move(value);
    return valueChanged;
}

bool TestInterfaceStubDefault::validateTestDerivedStructAttributeAttributeRequestedValue(const DerivedTypeCollection::TestStructExtended& value) {
    return true;
}

bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value) {
    return defaultStub_->trySetTestDerivedStructAttributeAttribute(std::move(value));
}

bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedStructAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId, DerivedTypeCollection::TestStructExtended value) {
    return onRemoteSetTestDerivedStructAttributeAttribute(value);
}

void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestDerivedStructAttributeAttributeChanged() {
    defaultStub_->onRemoteTestDerivedStructAttributeAttributeChanged();
}

const DerivedTypeCollection::TestArrayUInt64& TestInterfaceStubDefault::getTestDerivedArrayAttributeAttribute() {
    return testDerivedArrayAttributeAttributeValue_;
}

const DerivedTypeCollection::TestArrayUInt64& TestInterfaceStubDefault::getTestDerivedArrayAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId) {
    return getTestDerivedArrayAttributeAttribute();
}

void TestInterfaceStubDefault::setTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value) {
    const bool valueChanged = trySetTestDerivedArrayAttributeAttribute(std::move(value));
    if (valueChanged)
        stubAdapter_->fireTestDerivedArrayAttributeAttributeChanged(testDerivedArrayAttributeAttributeValue_);
}

void TestInterfaceStubDefault::setTestDerivedArrayAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId, DerivedTypeCollection::TestArrayUInt64 value) {
       setTestDerivedArrayAttributeAttribute(value);
}

void TestInterfaceStubDefault::onRemoteTestDerivedArrayAttributeAttributeChanged() {
    // No operation in default
}

bool TestInterfaceStubDefault::trySetTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value) {
    if (!validateTestDerivedArrayAttributeAttributeRequestedValue(value))
        return false;

    const bool valueChanged = (testDerivedArrayAttributeAttributeValue_ != value);
    testDerivedArrayAttributeAttributeValue_ = std::move(value);
    return valueChanged;
}

bool TestInterfaceStubDefault::validateTestDerivedArrayAttributeAttributeRequestedValue(const DerivedTypeCollection::TestArrayUInt64& value) {
    return true;
}

bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value) {
    return defaultStub_->trySetTestDerivedArrayAttributeAttribute(std::move(value));
}

bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedArrayAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId, DerivedTypeCollection::TestArrayUInt64 value) {
    return onRemoteSetTestDerivedArrayAttributeAttribute(value);
}

void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestDerivedArrayAttributeAttributeChanged() {
    defaultStub_->onRemoteTestDerivedArrayAttributeAttributeChanged();
}


void TestInterfaceStubDefault::testEmptyMethod(const std::shared_ptr<CommonAPI::ClientId> clientId) {
    // No operation in default
}

void TestInterfaceStubDefault::testVoidPredefinedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, uint32_t uint32Value, std::string stringValue) {
    // No operation in default
}

void TestInterfaceStubDefault::testPredefinedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, uint32_t uint32InValue, std::string stringInValue, uint32_t& uint32OutValue, std::string& stringOutValue) {
    // No operation in default
}

void TestInterfaceStubDefault::testVoidDerivedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, DerivedTypeCollection::TestEnumExtended2 testEnumExtended2Value, DerivedTypeCollection::TestMap testMapValue) {
    // No operation in default
}

void TestInterfaceStubDefault::testDerivedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, DerivedTypeCollection::TestEnumExtended2 testEnumExtended2InValue, DerivedTypeCollection::TestMap testMapInValue, DerivedTypeCollection::TestEnumExtended2& testEnumExtended2OutValue, DerivedTypeCollection::TestMap& testMapOutValue) {
    // No operation in default
}


void TestInterfaceStubDefault::fireTestPredefinedTypeBroadcastEvent(const uint32_t& uint32Value, const std::string& stringValue) {
    stubAdapter_->fireTestPredefinedTypeBroadcastEvent(uint32Value, stringValue);
}
void TestInterfaceStubDefault::fireTestSelectiveBroadcastSelective(const CommonAPI::ClientIdList* receivers) {
    stubAdapter_->sendTestSelectiveBroadcastSelective(receivers);
}
void TestInterfaceStubDefault::onTestSelectiveBroadcastSelectiveSubscriptionChanged(const std::shared_ptr<CommonAPI::ClientId> clientId, const CommonAPI::SelectiveBroadcastSubscriptionEvent event) {
    // No operation in default
}
bool TestInterfaceStubDefault::onTestSelectiveBroadcastSelectiveSubscriptionRequested(const std::shared_ptr<CommonAPI::ClientId> clientId) {
    // Accept in default
    return true;
}
CommonAPI::ClientIdList* const TestInterfaceStubDefault::getSubscribersForTestSelectiveBroadcastSelective() {
    return(stubAdapter_->getSubscribersForTestSelectiveBroadcastSelective());
}

void TestInterfaceStubDefault::fireTestBroadcastWithOutArgsSelective(const uint32_t& uint32Value, const std::string& stringValue, const CommonAPI::ClientIdList* receivers) {
    stubAdapter_->sendTestBroadcastWithOutArgsSelective(uint32Value, stringValue, receivers);
}
void TestInterfaceStubDefault::onTestBroadcastWithOutArgsSelectiveSubscriptionChanged(const std::shared_ptr<CommonAPI::ClientId> clientId, const CommonAPI::SelectiveBroadcastSubscriptionEvent event) {
    // No operation in default
}
bool TestInterfaceStubDefault::onTestBroadcastWithOutArgsSelectiveSubscriptionRequested(const std::shared_ptr<CommonAPI::ClientId> clientId) {
    // Accept in default
    return true;
}
CommonAPI::ClientIdList* const TestInterfaceStubDefault::getSubscribersForTestBroadcastWithOutArgsSelective() {
    return(stubAdapter_->getSubscribersForTestBroadcastWithOutArgsSelective());
}


TestInterfaceStubDefault::RemoteEventHandler::RemoteEventHandler(TestInterfaceStubDefault* defaultStub):
        defaultStub_(defaultStub) {
}

} // namespace tests
} // namespace commonapi