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 void TestInterfaceStubDefault::deinitStubAdapter() {
22 const uint32_t& TestInterfaceStubDefault::getTestPredefinedTypeAttributeAttribute() {
23 return testPredefinedTypeAttributeAttributeValue_;
26 void TestInterfaceStubDefault::setTestPredefinedTypeAttributeAttribute(uint32_t value) {
27 const bool valueChanged = trySetTestPredefinedTypeAttributeAttribute(std::move(value));
29 stubAdapter_->fireTestPredefinedTypeAttributeAttributeChanged(testPredefinedTypeAttributeAttributeValue_);
32 void TestInterfaceStubDefault::onRemoteTestPredefinedTypeAttributeAttributeChanged() {
33 // No operation in default
36 bool TestInterfaceStubDefault::trySetTestPredefinedTypeAttributeAttribute(uint32_t value) {
37 if (!validateTestPredefinedTypeAttributeAttributeRequestedValue(value))
40 const bool valueChanged = (testPredefinedTypeAttributeAttributeValue_ != value);
41 testPredefinedTypeAttributeAttributeValue_ = std::move(value);
45 bool TestInterfaceStubDefault::validateTestPredefinedTypeAttributeAttributeRequestedValue(const uint32_t& value) {
49 const DerivedTypeCollection::TestStructExtended& TestInterfaceStubDefault::getTestDerivedStructAttributeAttribute() {
50 return testDerivedStructAttributeAttributeValue_;
53 void TestInterfaceStubDefault::setTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value) {
54 const bool valueChanged = trySetTestDerivedStructAttributeAttribute(std::move(value));
56 stubAdapter_->fireTestDerivedStructAttributeAttributeChanged(testDerivedStructAttributeAttributeValue_);
59 void TestInterfaceStubDefault::onRemoteTestDerivedStructAttributeAttributeChanged() {
60 // No operation in default
63 bool TestInterfaceStubDefault::trySetTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value) {
64 if (!validateTestDerivedStructAttributeAttributeRequestedValue(value))
67 const bool valueChanged = (testDerivedStructAttributeAttributeValue_ != value);
68 testDerivedStructAttributeAttributeValue_ = std::move(value);
72 bool TestInterfaceStubDefault::validateTestDerivedStructAttributeAttributeRequestedValue(const DerivedTypeCollection::TestStructExtended& value) {
76 const DerivedTypeCollection::TestArrayUInt64& TestInterfaceStubDefault::getTestDerivedArrayAttributeAttribute() {
77 return testDerivedArrayAttributeAttributeValue_;
80 void TestInterfaceStubDefault::setTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value) {
81 const bool valueChanged = trySetTestDerivedArrayAttributeAttribute(std::move(value));
83 stubAdapter_->fireTestDerivedArrayAttributeAttributeChanged(testDerivedArrayAttributeAttributeValue_);
86 void TestInterfaceStubDefault::onRemoteTestDerivedArrayAttributeAttributeChanged() {
87 // No operation in default
90 bool TestInterfaceStubDefault::trySetTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value) {
91 if (!validateTestDerivedArrayAttributeAttributeRequestedValue(value))
94 const bool valueChanged = (testDerivedArrayAttributeAttributeValue_ != value);
95 testDerivedArrayAttributeAttributeValue_ = std::move(value);
99 bool TestInterfaceStubDefault::validateTestDerivedArrayAttributeAttributeRequestedValue(const DerivedTypeCollection::TestArrayUInt64& value) {
104 void TestInterfaceStubDefault::testVoidPredefinedTypeMethod(uint32_t uint32Value, std::string stringValue) {
105 // No operation in default
108 void TestInterfaceStubDefault::testPredefinedTypeMethod(uint32_t uint32InValue, std::string stringInValue, uint32_t& uint32OutValue, std::string& stringOutValue) {
109 // No operation in default
112 void TestInterfaceStubDefault::testVoidDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2Value, DerivedTypeCollection::TestMap testMapValue) {
113 // No operation in default
116 void TestInterfaceStubDefault::testDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2InValue, DerivedTypeCollection::TestMap testMapInValue, DerivedTypeCollection::TestEnumExtended2& testEnumExtended2OutValue, DerivedTypeCollection::TestMap& testMapOutValue) {
117 // No operation in default
121 void TestInterfaceStubDefault::fireTestPredefinedTypeBroadcastEvent(const uint32_t& uint32Value, const std::string& stringValue) {
122 stubAdapter_->fireTestPredefinedTypeBroadcastEvent(uint32Value, stringValue);
125 TestInterfaceStubDefault::RemoteEventHandler::RemoteEventHandler(TestInterfaceStubDefault* defaultStub):
126 defaultStub_(defaultStub) {
129 bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestPredefinedTypeAttributeAttribute(uint32_t value) {
130 return defaultStub_->trySetTestPredefinedTypeAttributeAttribute(std::move(value));
133 void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestPredefinedTypeAttributeAttributeChanged() {
134 defaultStub_->onRemoteTestPredefinedTypeAttributeAttributeChanged();
137 bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value) {
138 return defaultStub_->trySetTestDerivedStructAttributeAttribute(std::move(value));
141 void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestDerivedStructAttributeAttributeChanged() {
142 defaultStub_->onRemoteTestDerivedStructAttributeAttributeChanged();
145 bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value) {
146 return defaultStub_->trySetTestDerivedArrayAttributeAttribute(std::move(value));
149 void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestDerivedArrayAttributeAttributeChanged() {
150 defaultStub_->onRemoteTestDerivedArrayAttributeAttributeChanged();
155 } // namespace commonapi