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_H_
5 #define COMMONAPI_TESTS_TEST_INTERFACE_STUB_H_
7 #include <unordered_map>
9 #include "DerivedTypeCollection.h"
10 #include <CommonAPI/InputStream.h>
12 #include <CommonAPI/OutputStream.h>
13 #include "TestInterface.h"
14 #include <CommonAPI/Stub.h>
19 class TestInterfaceStubAdapter: virtual public CommonAPI::StubAdapter, public TestInterface {
21 virtual void fireTestPredefinedTypeAttributeAttributeChanged(const uint32_t& TestPredefinedTypeAttribute) = 0;
22 virtual void fireTestDerivedStructAttributeAttributeChanged(const DerivedTypeCollection::TestStructExtended& TestDerivedStructAttribute) = 0;
23 virtual void fireTestDerivedArrayAttributeAttributeChanged(const DerivedTypeCollection::TestArrayUInt64& TestDerivedArrayAttribute) = 0;
25 virtual void fireTestPredefinedTypeBroadcastEvent(const uint32_t& uint32Value, const std::string& stringValue) = 0;
29 class TestInterfaceStubRemoteEvent {
31 virtual ~TestInterfaceStubRemoteEvent() { }
33 virtual bool onRemoteSetTestPredefinedTypeAttributeAttribute(uint32_t TestPredefinedTypeAttribute) = 0;
34 virtual void onRemoteTestPredefinedTypeAttributeAttributeChanged() = 0;
36 virtual bool onRemoteSetTestDerivedStructAttributeAttribute(DerivedTypeCollection::TestStructExtended TestDerivedStructAttribute) = 0;
37 virtual void onRemoteTestDerivedStructAttributeAttributeChanged() = 0;
39 virtual bool onRemoteSetTestDerivedArrayAttributeAttribute(DerivedTypeCollection::TestArrayUInt64 TestDerivedArrayAttribute) = 0;
40 virtual void onRemoteTestDerivedArrayAttributeAttributeChanged() = 0;
45 class TestInterfaceStub : public CommonAPI::Stub<TestInterfaceStubAdapter , TestInterfaceStubRemoteEvent> {
47 virtual const uint32_t& getTestPredefinedTypeAttributeAttribute() = 0;
48 virtual const DerivedTypeCollection::TestStructExtended& getTestDerivedStructAttributeAttribute() = 0;
49 virtual const DerivedTypeCollection::TestArrayUInt64& getTestDerivedArrayAttributeAttribute() = 0;
51 virtual void testVoidPredefinedTypeMethod(uint32_t uint32Value, std::string stringValue) = 0;
53 virtual void testPredefinedTypeMethod(uint32_t uint32InValue, std::string stringInValue, uint32_t& uint32OutValue, std::string& stringOutValue) = 0;
55 virtual void testVoidDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2Value, DerivedTypeCollection::TestMap testMapValue) = 0;
57 virtual void testDerivedTypeMethod(DerivedTypeCollection::TestEnumExtended2 testEnumExtended2InValue, DerivedTypeCollection::TestMap testMapInValue, DerivedTypeCollection::TestEnumExtended2& testEnumExtended2OutValue, DerivedTypeCollection::TestMap& testMapOutValue) = 0;
62 } // namespace commonapi
64 #endif // COMMONAPI_TESTS_TEST_INTERFACE_STUB_H_