1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 #include "TestInterfaceStubDefault.h"
9 TestInterfaceStubDefault::TestInterfaceStubDefault():
10 remoteEventHandler_(this) {
13 TestInterfaceStubRemoteEvent* TestInterfaceStubDefault::initStubAdapter(const std::shared_ptr<TestInterfaceStubAdapter>& stubAdapter) {
14 stubAdapter_ = stubAdapter;
15 return &remoteEventHandler_;
18 const uint32_t& TestInterfaceStubDefault::getTestPredefinedTypeAttributeAttribute() {
19 return testPredefinedTypeAttributeAttributeValue_;
22 void TestInterfaceStubDefault::setTestPredefinedTypeAttributeAttribute(uint32_t value) {
23 const bool valueChanged = trySetTestPredefinedTypeAttributeAttribute(std::move(value));
25 stubAdapter_->fireTestPredefinedTypeAttributeAttributeChanged(testPredefinedTypeAttributeAttributeValue_);
28 void TestInterfaceStubDefault::onRemoteTestPredefinedTypeAttributeAttributeChanged() {
29 // No operation in default
32 bool TestInterfaceStubDefault::trySetTestPredefinedTypeAttributeAttribute(uint32_t value) {
33 if (!validateTestPredefinedTypeAttributeAttributeRequestedValue(value))
36 const bool valueChanged = (testPredefinedTypeAttributeAttributeValue_ != value);
37 testPredefinedTypeAttributeAttributeValue_ = std::move(value);
41 bool TestInterfaceStubDefault::validateTestPredefinedTypeAttributeAttributeRequestedValue(const uint32_t& value) {
45 const DerivedTypeCollection::TestStructExtended& TestInterfaceStubDefault::getTestDerivedStructAttributeAttribute() {
46 return testDerivedStructAttributeAttributeValue_;
49 void TestInterfaceStubDefault::setTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value) {
50 const bool valueChanged = trySetTestDerivedStructAttributeAttribute(std::move(value));
52 stubAdapter_->fireTestDerivedStructAttributeAttributeChanged(testDerivedStructAttributeAttributeValue_);
55 void TestInterfaceStubDefault::onRemoteTestDerivedStructAttributeAttributeChanged() {
56 // No operation in default
59 bool TestInterfaceStubDefault::trySetTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value) {
60 if (!validateTestDerivedStructAttributeAttributeRequestedValue(value))
63 const bool valueChanged = (testDerivedStructAttributeAttributeValue_ != value);
64 testDerivedStructAttributeAttributeValue_ = std::move(value);
68 bool TestInterfaceStubDefault::validateTestDerivedStructAttributeAttributeRequestedValue(const DerivedTypeCollection::TestStructExtended& value) {
72 const DerivedTypeCollection::TestArrayUInt64& TestInterfaceStubDefault::getTestDerivedArrayAttributeAttribute() {
73 return testDerivedArrayAttributeAttributeValue_;
76 void TestInterfaceStubDefault::setTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value) {
77 const bool valueChanged = trySetTestDerivedArrayAttributeAttribute(std::move(value));
79 stubAdapter_->fireTestDerivedArrayAttributeAttributeChanged(testDerivedArrayAttributeAttributeValue_);
82 void TestInterfaceStubDefault::onRemoteTestDerivedArrayAttributeAttributeChanged() {
83 // No operation in default
86 bool TestInterfaceStubDefault::trySetTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value) {
87 if (!validateTestDerivedArrayAttributeAttributeRequestedValue(value))
90 const bool valueChanged = (testDerivedArrayAttributeAttributeValue_ != value);
91 testDerivedArrayAttributeAttributeValue_ = std::move(value);
95 bool TestInterfaceStubDefault::validateTestDerivedArrayAttributeAttributeRequestedValue(const DerivedTypeCollection::TestArrayUInt64& value) {
100 void TestInterfaceStubDefault::testVoidPredefinedTypeMethod(uint32_t uint32Value, std::string stringValue) {
101 // No operation in default
104 void TestInterfaceStubDefault::testPredefinedTypeMethod(uint32_t uint32InValue, std::string stringInValue, uint32_t& uint32OutValue, std::string& stringOutValue) {
105 // No operation in default
108 void TestInterfaceStubDefault::testVoidDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2Value, DerivedTypeCollection::TestMap testMapValue) {
109 // No operation in default
112 void TestInterfaceStubDefault::testDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2InValue, DerivedTypeCollection::TestMap testMapInValue, DerivedTypeCollection::TestEnumExtended2& testEnumExtended2OutValue, DerivedTypeCollection::TestMap& testMapOutValue) {
113 // No operation in default
116 void TestInterfaceStubDefault::firePredefinedBroadcast(uint32_t value, std::string& sValue) {
117 stubAdapter_->fireTestPredefinedTypeBroadcastEvent(value, sValue);
121 TestInterfaceStubDefault::RemoteEventHandler::RemoteEventHandler(TestInterfaceStubDefault* defaultStub):
122 defaultStub_(defaultStub) {
125 bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestPredefinedTypeAttributeAttribute(uint32_t value) {
126 return defaultStub_->trySetTestPredefinedTypeAttributeAttribute(std::move(value));
129 void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestPredefinedTypeAttributeAttributeChanged() {
130 defaultStub_->onRemoteTestPredefinedTypeAttributeAttributeChanged();
133 bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value) {
134 return defaultStub_->trySetTestDerivedStructAttributeAttribute(std::move(value));
137 void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestDerivedStructAttributeAttributeChanged() {
138 defaultStub_->onRemoteTestDerivedStructAttributeAttributeChanged();
141 bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value) {
142 return defaultStub_->trySetTestDerivedArrayAttributeAttribute(std::move(value));
145 void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestDerivedArrayAttributeAttributeChanged() {
146 defaultStub_->onRemoteTestDerivedArrayAttributeAttributeChanged();
151 } // namespace commonapi