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 #ifndef COMMONAPI_TESTS_TEST_INTERFACE_STUB_DEFAULT_H_
5 #define COMMONAPI_TESTS_TEST_INTERFACE_STUB_DEFAULT_H_
7 #include "TestInterfaceStub.h"
12 class TestInterfaceStubDefault : public TestInterfaceStub {
14 TestInterfaceStubDefault();
16 TestInterfaceStubRemoteEvent* initStubAdapter(const std::shared_ptr<TestInterfaceStubAdapter>& stubAdapter);
18 virtual const uint32_t& getTestPredefinedTypeAttributeAttribute();
19 void setTestPredefinedTypeAttributeAttribute(uint32_t value);
21 virtual const DerivedTypeCollection::TestStructExtended& getTestDerivedStructAttributeAttribute();
22 void setTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value);
24 virtual const DerivedTypeCollection::TestArrayUInt64& getTestDerivedArrayAttributeAttribute();
25 void setTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value);
28 virtual void testVoidPredefinedTypeMethod(uint32_t uint32Value, std::string stringValue);
30 virtual void testPredefinedTypeMethod(uint32_t uint32InValue, std::string stringInValue, uint32_t& uint32OutValue, std::string& stringOutValue);
32 virtual void testVoidDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2Value, DerivedTypeCollection::TestMap testMapValue);
34 virtual void testDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2InValue, DerivedTypeCollection::TestMap testMapInValue, DerivedTypeCollection::TestEnumExtended2& testEnumExtended2OutValue, DerivedTypeCollection::TestMap& testMapOutValue);
36 virtual void firePredefinedBroadcast(uint32_t value, std::string& sValue);
39 void onRemoteTestPredefinedTypeAttributeAttributeChanged();
40 bool trySetTestPredefinedTypeAttributeAttribute(uint32_t value);
41 bool validateTestPredefinedTypeAttributeAttributeRequestedValue(const uint32_t& value);
43 void onRemoteTestDerivedStructAttributeAttributeChanged();
44 bool trySetTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value);
45 bool validateTestDerivedStructAttributeAttributeRequestedValue(const DerivedTypeCollection::TestStructExtended& value);
47 void onRemoteTestDerivedArrayAttributeAttributeChanged();
48 bool trySetTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value);
49 bool validateTestDerivedArrayAttributeAttributeRequestedValue(const DerivedTypeCollection::TestArrayUInt64& value);
53 class RemoteEventHandler: public TestInterfaceStubRemoteEvent {
55 RemoteEventHandler(TestInterfaceStubDefault* defaultStub);
57 virtual bool onRemoteSetTestPredefinedTypeAttributeAttribute(uint32_t value);
58 virtual void onRemoteTestPredefinedTypeAttributeAttributeChanged();
60 virtual bool onRemoteSetTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended value);
61 virtual void onRemoteTestDerivedStructAttributeAttributeChanged();
63 virtual bool onRemoteSetTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 value);
64 virtual void onRemoteTestDerivedArrayAttributeAttributeChanged();
68 TestInterfaceStubDefault* defaultStub_;
71 RemoteEventHandler remoteEventHandler_;
72 std::shared_ptr<TestInterfaceStubAdapter> stubAdapter_;
74 uint32_t testPredefinedTypeAttributeAttributeValue_;
75 DerivedTypeCollection::TestStructExtended testDerivedStructAttributeAttributeValue_;
76 DerivedTypeCollection::TestArrayUInt64 testDerivedArrayAttributeAttributeValue_;
80 } // namespace commonapi
82 #endif // COMMONAPI_TESTS_TEST_INTERFACE_STUB_DEFAULT_H_