diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/DBusCommunicationTest.cpp | 24 | ||||
-rw-r--r-- | src/test/DBusPolymorphicTest.cpp | 25 | ||||
-rw-r--r-- | src/test/commonapi/tests/DerivedTypeCollection.cpp | 3 | ||||
-rw-r--r-- | src/test/commonapi/tests/DerivedTypeCollection.h | 3 | ||||
-rw-r--r-- | src/test/commonapi/tests/PredefinedTypeCollection.h | 2 | ||||
-rw-r--r-- | src/test/commonapi/tests/TestInterface.h | 3 | ||||
-rw-r--r-- | src/test/commonapi/tests/TestInterfaceDBusProxy.cpp | 21 | ||||
-rw-r--r-- | src/test/commonapi/tests/TestInterfaceDBusProxy.h | 4 | ||||
-rw-r--r-- | src/test/commonapi/tests/TestInterfaceDBusStubAdapter.cpp | 19 | ||||
-rw-r--r-- | src/test/commonapi/tests/TestInterfaceDBusStubAdapter.h | 2 | ||||
-rw-r--r-- | src/test/commonapi/tests/TestInterfaceProxy.h | 31 | ||||
-rw-r--r-- | src/test/commonapi/tests/TestInterfaceProxyBase.h | 5 | ||||
-rw-r--r-- | src/test/commonapi/tests/TestInterfaceStub.h | 10 | ||||
-rw-r--r-- | src/test/commonapi/tests/TestInterfaceStubDefault.cpp | 10 | ||||
-rw-r--r-- | src/test/commonapi/tests/TestInterfaceStubDefault.h | 5 | ||||
-rw-r--r-- | src/test/test-derived-types.fidl | 6 | ||||
-rw-r--r-- | src/test/test-interface-proxy.fidl | 12 |
17 files changed, 63 insertions, 122 deletions
diff --git a/src/test/DBusCommunicationTest.cpp b/src/test/DBusCommunicationTest.cpp index 4f4bb06..d27d82c 100644 --- a/src/test/DBusCommunicationTest.cpp +++ b/src/test/DBusCommunicationTest.cpp @@ -215,6 +215,30 @@ TEST_F(DBusCommunicationTest, RemoteMethodCallHeavyLoad) { servicePublisher_->unregisterService(serviceAddress4_); } +TEST_F(DBusCommunicationTest, ProxyCanFetchVersionAttributeFromStub) { + auto defaultTestProxy = proxyFactory_->buildProxy<commonapi::tests::TestInterfaceProxy>(serviceAddress4_); + ASSERT_TRUE((bool)defaultTestProxy); + + auto stub = std::make_shared<commonapi::tests::TestInterfaceStubDefault>(); + + bool serviceRegistered = servicePublisher_->registerService(stub, serviceAddress4_, stubFactory_); + + ASSERT_TRUE(serviceRegistered); + + for (unsigned int i = 0; !defaultTestProxy->isAvailable() && i < 100; ++i) { + usleep(10000); + } + ASSERT_TRUE(defaultTestProxy->isAvailable()); + + CommonAPI::InterfaceVersionAttribute& versionAttribute = defaultTestProxy->getInterfaceVersionAttribute(); + + CommonAPI::Version version; + CommonAPI::CallStatus status; + versionAttribute.getValue(status, version); + ASSERT_EQ(CommonAPI::CallStatus::SUCCESS, status); + ASSERT_TRUE(version.Major > 0 || version.Minor > 0); +} + //XXX This test case requires CommonAPI::DBus::DBusConnection::suspendDispatching and ...::resumeDispatching to be public! diff --git a/src/test/DBusPolymorphicTest.cpp b/src/test/DBusPolymorphicTest.cpp index bec2ebf..7b2df63 100644 --- a/src/test/DBusPolymorphicTest.cpp +++ b/src/test/DBusPolymorphicTest.cpp @@ -74,31 +74,6 @@ public: } } - void TestMapWithPolymorphicStructKeyMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, - commonapi::tests::DerivedTypeCollection::MapPolymorphicToInt inMap) { - numberOfContainedElements_ = inMap.size(); - - auto mapIterator = inMap.begin(); - - if (mapIterator != inMap.end()) { - std::shared_ptr<commonapi::tests::DerivedTypeCollection::TestExtendedPolymorphicStruct> extended = - std::dynamic_pointer_cast< - commonapi::tests::DerivedTypeCollection::TestExtendedPolymorphicStruct>( - mapIterator->first); - firstElementIsExtended_ = (extended != NULL); - mapIterator++; - } - - if (mapIterator != inMap.end()) { - std::shared_ptr<commonapi::tests::DerivedTypeCollection::TestExtendedPolymorphicStruct> extended = - std::dynamic_pointer_cast< - commonapi::tests::DerivedTypeCollection::TestExtendedPolymorphicStruct>( - mapIterator->first); - firstElementIsExtended_ = (extended != NULL); - } - - } - void TestStructWithPolymorphicMemberMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember inStruct) { if (inStruct.polymorphicMember != NULL) { diff --git a/src/test/commonapi/tests/DerivedTypeCollection.cpp b/src/test/commonapi/tests/DerivedTypeCollection.cpp index 16a1b4e..c8da568 100644 --- a/src/test/commonapi/tests/DerivedTypeCollection.cpp +++ b/src/test/commonapi/tests/DerivedTypeCollection.cpp @@ -1,6 +1,6 @@ /* * This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -170,7 +170,6 @@ void TestExtendedPolymorphicStruct::writeToOutputStream(CommonAPI::OutputStream& } - StructWithPolymorphicMember::StructWithPolymorphicMember(const uint32_t& numberValueValue, const std::shared_ptr<TestPolymorphicStruct>& polymorphicMemberValue): numberValue(numberValueValue), polymorphicMember(polymorphicMemberValue) diff --git a/src/test/commonapi/tests/DerivedTypeCollection.h b/src/test/commonapi/tests/DerivedTypeCollection.h index 5cdcfd0..a3aba4f 100644 --- a/src/test/commonapi/tests/DerivedTypeCollection.h +++ b/src/test/commonapi/tests/DerivedTypeCollection.h @@ -1,6 +1,6 @@ /* * This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -188,7 +188,6 @@ namespace DerivedTypeCollection { } }; typedef std::unordered_map<uint8_t, std::shared_ptr<TestPolymorphicStruct>> MapIntToPolymorphic; - typedef std::unordered_map<std::shared_ptr<TestPolymorphicStruct>, uint8_t> MapPolymorphicToInt; struct StructWithPolymorphicMember: CommonAPI::SerializableStruct { uint32_t numberValue; std::shared_ptr<TestPolymorphicStruct> polymorphicMember; diff --git a/src/test/commonapi/tests/PredefinedTypeCollection.h b/src/test/commonapi/tests/PredefinedTypeCollection.h index 2935703..4e991f2 100644 --- a/src/test/commonapi/tests/PredefinedTypeCollection.h +++ b/src/test/commonapi/tests/PredefinedTypeCollection.h @@ -1,6 +1,6 @@ /* * This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. diff --git a/src/test/commonapi/tests/TestInterface.h b/src/test/commonapi/tests/TestInterface.h index 1c8151e..289ec84 100644 --- a/src/test/commonapi/tests/TestInterface.h +++ b/src/test/commonapi/tests/TestInterface.h @@ -1,6 +1,6 @@ /* * This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -12,6 +12,7 @@ + #if !defined (COMMONAPI_INTERNAL_COMPILATION) #define COMMONAPI_INTERNAL_COMPILATION #endif diff --git a/src/test/commonapi/tests/TestInterfaceDBusProxy.cpp b/src/test/commonapi/tests/TestInterfaceDBusProxy.cpp index ef42634..aa28d09 100644 --- a/src/test/commonapi/tests/TestInterfaceDBusProxy.cpp +++ b/src/test/commonapi/tests/TestInterfaceDBusProxy.cpp @@ -1,6 +1,6 @@ /* * This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -195,25 +195,6 @@ std::future<CommonAPI::CallStatus> TestInterfaceDBusProxy::TestMapOfPolymorphicS inMap, std::move(callback)); } -void TestInterfaceDBusProxy::TestMapWithPolymorphicStructKeyMethod(const DerivedTypeCollection::MapPolymorphicToInt& inMap, CommonAPI::CallStatus& callStatus) { - CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<DerivedTypeCollection::MapPolymorphicToInt>, - CommonAPI::DBus::DBusSerializableArguments<> >::callMethodWithReply( - *this, - "TestMapWithPolymorphicStructKeyMethod", - "a{(uv)y}", - inMap, - callStatus - ); -} -std::future<CommonAPI::CallStatus> TestInterfaceDBusProxy::TestMapWithPolymorphicStructKeyMethodAsync(const DerivedTypeCollection::MapPolymorphicToInt& inMap, TestMapWithPolymorphicStructKeyMethodAsyncCallback callback) { - return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<DerivedTypeCollection::MapPolymorphicToInt>, - CommonAPI::DBus::DBusSerializableArguments<> >::callMethodAsync( - *this, - "TestMapWithPolymorphicStructKeyMethod", - "a{(uv)y}", - inMap, - std::move(callback)); -} void TestInterfaceDBusProxy::TestStructWithPolymorphicMemberMethod(const DerivedTypeCollection::StructWithPolymorphicMember& inStruct, CommonAPI::CallStatus& callStatus) { CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<DerivedTypeCollection::StructWithPolymorphicMember>, CommonAPI::DBus::DBusSerializableArguments<> >::callMethodWithReply( diff --git a/src/test/commonapi/tests/TestInterfaceDBusProxy.h b/src/test/commonapi/tests/TestInterfaceDBusProxy.h index 9ac236a..bef16fc 100644 --- a/src/test/commonapi/tests/TestInterfaceDBusProxy.h +++ b/src/test/commonapi/tests/TestInterfaceDBusProxy.h @@ -1,6 +1,6 @@ /* * This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -64,8 +64,6 @@ class TestInterfaceDBusProxy: virtual public TestInterfaceProxyBase, virtual pub virtual std::future<CommonAPI::CallStatus> TestArrayOfPolymorphicStructMethodAsync(const std::vector<std::shared_ptr<DerivedTypeCollection::TestPolymorphicStruct>>& inArray, TestArrayOfPolymorphicStructMethodAsyncCallback callback); virtual void TestMapOfPolymorphicStructMethod(const DerivedTypeCollection::MapIntToPolymorphic& inMap, CommonAPI::CallStatus& callStatus); virtual std::future<CommonAPI::CallStatus> TestMapOfPolymorphicStructMethodAsync(const DerivedTypeCollection::MapIntToPolymorphic& inMap, TestMapOfPolymorphicStructMethodAsyncCallback callback); - virtual void TestMapWithPolymorphicStructKeyMethod(const DerivedTypeCollection::MapPolymorphicToInt& inMap, CommonAPI::CallStatus& callStatus); - virtual std::future<CommonAPI::CallStatus> TestMapWithPolymorphicStructKeyMethodAsync(const DerivedTypeCollection::MapPolymorphicToInt& inMap, TestMapWithPolymorphicStructKeyMethodAsyncCallback callback); virtual void TestStructWithPolymorphicMemberMethod(const DerivedTypeCollection::StructWithPolymorphicMember& inStruct, CommonAPI::CallStatus& callStatus); virtual std::future<CommonAPI::CallStatus> TestStructWithPolymorphicMemberMethodAsync(const DerivedTypeCollection::StructWithPolymorphicMember& inStruct, TestStructWithPolymorphicMemberMethodAsyncCallback callback); virtual void TestStructWithEnumKeyMapMember(const DerivedTypeCollection::StructWithEnumKeyMap& inStruct, CommonAPI::CallStatus& callStatus); diff --git a/src/test/commonapi/tests/TestInterfaceDBusStubAdapter.cpp b/src/test/commonapi/tests/TestInterfaceDBusStubAdapter.cpp index 40cb19e..de5e112 100644 --- a/src/test/commonapi/tests/TestInterfaceDBusStubAdapter.cpp +++ b/src/test/commonapi/tests/TestInterfaceDBusStubAdapter.cpp @@ -1,6 +1,6 @@ /* * This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -55,6 +55,9 @@ void TestInterfaceDBusStubAdapter::deactivateManagedInstances() { const char* TestInterfaceDBusStubAdapter::getMethodsDBusIntrospectionXmlData() const { static const char* introspectionData = + "<method name=\"getInterfaceVersion\">\n" + "<arg name=\"value\" type=\"uu\" direction=\"out\" />" + "</method>\n" "<method name=\"getTestPredefinedTypeAttributeAttribute\">\n" "<arg name=\"value\" type=\"u\" direction=\"out\" />" "</method>\n" @@ -123,9 +126,6 @@ const char* TestInterfaceDBusStubAdapter::getMethodsDBusIntrospectionXmlData() c "<method name=\"TestMapOfPolymorphicStructMethod\">\n" "<arg name=\"inMap\" type=\"a{y(uv)}\" direction=\"in\" />\n" "</method>\n" - "<method name=\"TestMapWithPolymorphicStructKeyMethod\">\n" - "<arg name=\"inMap\" type=\"a{(uv)y}\" direction=\"in\" />\n" - "</method>\n" "<method name=\"TestStructWithPolymorphicMemberMethod\">\n" "<arg name=\"inStruct\" type=\"(u(uv))\" direction=\"in\" />\n" "</method>\n" @@ -137,6 +137,10 @@ const char* TestInterfaceDBusStubAdapter::getMethodsDBusIntrospectionXmlData() c return introspectionData; } + static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestInterfaceStub, + CommonAPI::Version + > getInterfaceVersionStubDispatcher(&TestInterfaceStub::getInterfaceVersion, "uu"); static CommonAPI::DBus::DBusGetAttributeStubDispatcher< TestInterfaceStub, @@ -218,11 +222,6 @@ static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< > testMapOfPolymorphicStructMethodStubDispatcher(&TestInterfaceStub::TestMapOfPolymorphicStructMethod, ""); static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< TestInterfaceStub, - std::tuple<DerivedTypeCollection::MapPolymorphicToInt>, - std::tuple<> - > testMapWithPolymorphicStructKeyMethodStubDispatcher(&TestInterfaceStub::TestMapWithPolymorphicStructKeyMethod, ""); -static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< - TestInterfaceStub, std::tuple<DerivedTypeCollection::StructWithPolymorphicMember>, std::tuple<> > testStructWithPolymorphicMemberMethodStubDispatcher(&TestInterfaceStub::TestStructWithPolymorphicMemberMethod, ""); @@ -407,6 +406,7 @@ std::shared_ptr<CommonAPI::ClientIdList> const TestInterfaceDBusStubAdapter::get const TestInterfaceDBusStubAdapter::StubDispatcherTable& TestInterfaceDBusStubAdapter::getStubDispatcherTable() { static const TestInterfaceDBusStubAdapter::StubDispatcherTable stubDispatcherTable = { + { { "getInterfaceVersion", "" }, &commonapi::tests::getInterfaceVersionStubDispatcher }, { { "getTestPredefinedTypeAttributeAttribute", "" }, &commonapi::tests::getTestPredefinedTypeAttributeAttributeStubDispatcher } , { { "setTestPredefinedTypeAttributeAttribute", "u" }, &commonapi::tests::setTestPredefinedTypeAttributeAttributeStubDispatcher }, { { "getTestDerivedStructAttributeAttribute", "" }, &commonapi::tests::getTestDerivedStructAttributeAttributeStubDispatcher } @@ -421,7 +421,6 @@ const TestInterfaceDBusStubAdapter::StubDispatcherTable& TestInterfaceDBusStubAd { { "testDerivedTypeMethod", "ia{ua(sq)}" }, &commonapi::tests::testDerivedTypeMethodStubDispatcher }, { { "TestArrayOfPolymorphicStructMethod", "a(uv)" }, &commonapi::tests::testArrayOfPolymorphicStructMethodStubDispatcher }, { { "TestMapOfPolymorphicStructMethod", "a{y(uv)}" }, &commonapi::tests::testMapOfPolymorphicStructMethodStubDispatcher }, - { { "TestMapWithPolymorphicStructKeyMethod", "a{(uv)y}" }, &commonapi::tests::testMapWithPolymorphicStructKeyMethodStubDispatcher }, { { "TestStructWithPolymorphicMemberMethod", "(u(uv))" }, &commonapi::tests::testStructWithPolymorphicMemberMethodStubDispatcher }, { { "TestStructWithEnumKeyMapMember", "(a{is})" }, &commonapi::tests::testStructWithEnumKeyMapMemberStubDispatcher } , diff --git a/src/test/commonapi/tests/TestInterfaceDBusStubAdapter.h b/src/test/commonapi/tests/TestInterfaceDBusStubAdapter.h index b5b1868..6033c61 100644 --- a/src/test/commonapi/tests/TestInterfaceDBusStubAdapter.h +++ b/src/test/commonapi/tests/TestInterfaceDBusStubAdapter.h @@ -1,6 +1,6 @@ /* * This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. diff --git a/src/test/commonapi/tests/TestInterfaceProxy.h b/src/test/commonapi/tests/TestInterfaceProxy.h index e940343..af6ae36 100644 --- a/src/test/commonapi/tests/TestInterfaceProxy.h +++ b/src/test/commonapi/tests/TestInterfaceProxy.h @@ -1,6 +1,6 @@ /* * This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -210,26 +210,6 @@ class TestInterfaceProxy: virtual public TestInterface, virtual public TestInter */ virtual std::future<CommonAPI::CallStatus> TestMapOfPolymorphicStructMethodAsync(const DerivedTypeCollection::MapIntToPolymorphic& inMap, TestMapOfPolymorphicStructMethodAsyncCallback callback); /** - * Calls TestMapWithPolymorphicStructKeyMethod with synchronous semantics. - * - * All const parameters are input parameters to this method. - * The CallStatus will be filled when the method returns and indicate either - * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus - * will be set. - */ - virtual void TestMapWithPolymorphicStructKeyMethod(const DerivedTypeCollection::MapPolymorphicToInt& inMap, CommonAPI::CallStatus& callStatus); - /** - * Calls TestMapWithPolymorphicStructKeyMethod with asynchronous semantics. - * - * The provided callback will be called when the reply to this call arrives or - * an error occurs during the call. The CallStatus will indicate either "SUCCESS" - * or which type of error has occurred. In case of any error, ONLY the CallStatus - * will have a defined value. - * The std::future returned by this method will be fulfilled at arrival of the reply. - * It will provide the same value for CallStatus as will be handed to the callback. - */ - virtual std::future<CommonAPI::CallStatus> TestMapWithPolymorphicStructKeyMethodAsync(const DerivedTypeCollection::MapPolymorphicToInt& inMap, TestMapWithPolymorphicStructKeyMethodAsyncCallback callback); - /** * Calls TestStructWithPolymorphicMemberMethod with synchronous semantics. * * All const parameters are input parameters to this method. @@ -454,15 +434,6 @@ std::future<CommonAPI::CallStatus> TestInterfaceProxy<_AttributeExtensions...>:: return delegate_->TestMapOfPolymorphicStructMethodAsync(inMap, callback); } template <typename ... _AttributeExtensions> -void TestInterfaceProxy<_AttributeExtensions...>::TestMapWithPolymorphicStructKeyMethod(const DerivedTypeCollection::MapPolymorphicToInt& inMap, CommonAPI::CallStatus& callStatus) { - delegate_->TestMapWithPolymorphicStructKeyMethod(inMap, callStatus); -} - -template <typename ... _AttributeExtensions> -std::future<CommonAPI::CallStatus> TestInterfaceProxy<_AttributeExtensions...>::TestMapWithPolymorphicStructKeyMethodAsync(const DerivedTypeCollection::MapPolymorphicToInt& inMap, TestMapWithPolymorphicStructKeyMethodAsyncCallback callback) { - return delegate_->TestMapWithPolymorphicStructKeyMethodAsync(inMap, callback); -} -template <typename ... _AttributeExtensions> void TestInterfaceProxy<_AttributeExtensions...>::TestStructWithPolymorphicMemberMethod(const DerivedTypeCollection::StructWithPolymorphicMember& inStruct, CommonAPI::CallStatus& callStatus) { delegate_->TestStructWithPolymorphicMemberMethod(inStruct, callStatus); } diff --git a/src/test/commonapi/tests/TestInterfaceProxyBase.h b/src/test/commonapi/tests/TestInterfaceProxyBase.h index ff2dd5d..ccd1846 100644 --- a/src/test/commonapi/tests/TestInterfaceProxyBase.h +++ b/src/test/commonapi/tests/TestInterfaceProxyBase.h @@ -1,6 +1,6 @@ /* * This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -55,7 +55,6 @@ class TestInterfaceProxyBase: virtual public CommonAPI::Proxy { typedef std::function<void(const CommonAPI::CallStatus&, const DerivedTypeCollection::TestEnumExtended2&, const DerivedTypeCollection::TestMap&)> TestDerivedTypeMethodAsyncCallback; typedef std::function<void(const CommonAPI::CallStatus&)> TestArrayOfPolymorphicStructMethodAsyncCallback; typedef std::function<void(const CommonAPI::CallStatus&)> TestMapOfPolymorphicStructMethodAsyncCallback; - typedef std::function<void(const CommonAPI::CallStatus&)> TestMapWithPolymorphicStructKeyMethodAsyncCallback; typedef std::function<void(const CommonAPI::CallStatus&)> TestStructWithPolymorphicMemberMethodAsyncCallback; typedef std::function<void(const CommonAPI::CallStatus&)> TestStructWithEnumKeyMapMemberAsyncCallback; @@ -81,8 +80,6 @@ class TestInterfaceProxyBase: virtual public CommonAPI::Proxy { virtual std::future<CommonAPI::CallStatus> TestArrayOfPolymorphicStructMethodAsync(const std::vector<std::shared_ptr<DerivedTypeCollection::TestPolymorphicStruct>>& inArray, TestArrayOfPolymorphicStructMethodAsyncCallback callback) = 0; virtual void TestMapOfPolymorphicStructMethod(const DerivedTypeCollection::MapIntToPolymorphic& inMap, CommonAPI::CallStatus& callStatus) = 0; virtual std::future<CommonAPI::CallStatus> TestMapOfPolymorphicStructMethodAsync(const DerivedTypeCollection::MapIntToPolymorphic& inMap, TestMapOfPolymorphicStructMethodAsyncCallback callback) = 0; - virtual void TestMapWithPolymorphicStructKeyMethod(const DerivedTypeCollection::MapPolymorphicToInt& inMap, CommonAPI::CallStatus& callStatus) = 0; - virtual std::future<CommonAPI::CallStatus> TestMapWithPolymorphicStructKeyMethodAsync(const DerivedTypeCollection::MapPolymorphicToInt& inMap, TestMapWithPolymorphicStructKeyMethodAsyncCallback callback) = 0; virtual void TestStructWithPolymorphicMemberMethod(const DerivedTypeCollection::StructWithPolymorphicMember& inStruct, CommonAPI::CallStatus& callStatus) = 0; virtual std::future<CommonAPI::CallStatus> TestStructWithPolymorphicMemberMethodAsync(const DerivedTypeCollection::StructWithPolymorphicMember& inStruct, TestStructWithPolymorphicMemberMethodAsyncCallback callback) = 0; virtual void TestStructWithEnumKeyMapMember(const DerivedTypeCollection::StructWithEnumKeyMap& inStruct, CommonAPI::CallStatus& callStatus) = 0; diff --git a/src/test/commonapi/tests/TestInterfaceStub.h b/src/test/commonapi/tests/TestInterfaceStub.h index 4cc48e7..3809bdc 100644 --- a/src/test/commonapi/tests/TestInterfaceStub.h +++ b/src/test/commonapi/tests/TestInterfaceStub.h @@ -1,6 +1,6 @@ /* * This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -130,8 +130,12 @@ class TestInterfaceStubRemoteEvent { */ class TestInterfaceStub : public CommonAPI::Stub<TestInterfaceStubAdapter , TestInterfaceStubRemoteEvent> { public: + TestInterfaceStub(): interfaceVersion_(TestInterface::getInterfaceVersion()) { } virtual ~TestInterfaceStub() { } + const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) { + return interfaceVersion_; + } /// Provides getter access to the attribute TestPredefinedTypeAttribute virtual const uint32_t& getTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId) = 0; /// Provides getter access to the attribute TestDerivedStructAttribute @@ -153,8 +157,6 @@ class TestInterfaceStub : public CommonAPI::Stub<TestInterfaceStubAdapter , Test virtual void TestArrayOfPolymorphicStructMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, std::vector<std::shared_ptr<DerivedTypeCollection::TestPolymorphicStruct>> inArray) = 0; /// This is the method that will be called on remote calls on the method TestMapOfPolymorphicStructMethod. virtual void TestMapOfPolymorphicStructMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, DerivedTypeCollection::MapIntToPolymorphic inMap) = 0; - /// This is the method that will be called on remote calls on the method TestMapWithPolymorphicStructKeyMethod. - virtual void TestMapWithPolymorphicStructKeyMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, DerivedTypeCollection::MapPolymorphicToInt inMap) = 0; /// This is the method that will be called on remote calls on the method TestStructWithPolymorphicMemberMethod. virtual void TestStructWithPolymorphicMemberMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, DerivedTypeCollection::StructWithPolymorphicMember inStruct) = 0; /// This is the method that will be called on remote calls on the method TestStructWithEnumKeyMapMember. @@ -186,6 +188,8 @@ class TestInterfaceStub : public CommonAPI::Stub<TestInterfaceStubAdapter , Test /// Hook method for reacting accepting or denying new subscriptions virtual bool onTestBroadcastWithOutArgsSelectiveSubscriptionRequested(const std::shared_ptr<CommonAPI::ClientId> clientId) = 0; + private: + const CommonAPI::Version interfaceVersion_; }; } // namespace tests diff --git a/src/test/commonapi/tests/TestInterfaceStubDefault.cpp b/src/test/commonapi/tests/TestInterfaceStubDefault.cpp index 5003bd0..4a614fc 100644 --- a/src/test/commonapi/tests/TestInterfaceStubDefault.cpp +++ b/src/test/commonapi/tests/TestInterfaceStubDefault.cpp @@ -1,6 +1,6 @@ /* * This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -222,14 +222,6 @@ void TestInterfaceStubDefault::TestMapOfPolymorphicStructMethod(DerivedTypeColle // No operation in default } -void TestInterfaceStubDefault::TestMapWithPolymorphicStructKeyMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, DerivedTypeCollection::MapPolymorphicToInt inMap) { - // Call old style methods in default - TestMapWithPolymorphicStructKeyMethod(inMap); -} -void TestInterfaceStubDefault::TestMapWithPolymorphicStructKeyMethod(DerivedTypeCollection::MapPolymorphicToInt inMap) { - // No operation in default -} - void TestInterfaceStubDefault::TestStructWithPolymorphicMemberMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, DerivedTypeCollection::StructWithPolymorphicMember inStruct) { // Call old style methods in default TestStructWithPolymorphicMemberMethod(inStruct); diff --git a/src/test/commonapi/tests/TestInterfaceStubDefault.h b/src/test/commonapi/tests/TestInterfaceStubDefault.h index ff320ea..01b7bd4 100644 --- a/src/test/commonapi/tests/TestInterfaceStubDefault.h +++ b/src/test/commonapi/tests/TestInterfaceStubDefault.h @@ -1,6 +1,6 @@ /* * This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -66,9 +66,6 @@ class TestInterfaceStubDefault : public TestInterfaceStub { virtual void TestMapOfPolymorphicStructMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, DerivedTypeCollection::MapIntToPolymorphic inMap); virtual void TestMapOfPolymorphicStructMethod(DerivedTypeCollection::MapIntToPolymorphic inMap); - virtual void TestMapWithPolymorphicStructKeyMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, DerivedTypeCollection::MapPolymorphicToInt inMap); - virtual void TestMapWithPolymorphicStructKeyMethod(DerivedTypeCollection::MapPolymorphicToInt inMap); - virtual void TestStructWithPolymorphicMemberMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, DerivedTypeCollection::StructWithPolymorphicMember inStruct); virtual void TestStructWithPolymorphicMemberMethod(DerivedTypeCollection::StructWithPolymorphicMember inStruct); diff --git a/src/test/test-derived-types.fidl b/src/test/test-derived-types.fidl index 07d3873..1c0784f 100644 --- a/src/test/test-derived-types.fidl +++ b/src/test/test-derived-types.fidl @@ -69,12 +69,16 @@ typeCollection DerivedTypeCollection { } map MapIntToPolymorphic { UInt8 to DerivedTypeCollection.TestPolymorphicStruct } - map MapPolymorphicToInt { DerivedTypeCollection.TestPolymorphicStruct to UInt8 } struct StructWithPolymorphicMember { UInt32 numberValue DerivedTypeCollection.TestPolymorphicStruct polymorphicMember } + + struct StructWithEnumKeyMap { + TestEnumMap testMap + } + } diff --git a/src/test/test-interface-proxy.fidl b/src/test/test-interface-proxy.fidl index 4e57734..e2bd0e0 100644 --- a/src/test/test-interface-proxy.fidl +++ b/src/test/test-interface-proxy.fidl @@ -62,18 +62,18 @@ interface TestInterface { DerivedTypeCollection.MapIntToPolymorphic inMap } } - - method TestMapWithPolymorphicStructKeyMethod { - in { - DerivedTypeCollection.MapPolymorphicToInt inMap - } - } method TestStructWithPolymorphicMemberMethod { in { DerivedTypeCollection.StructWithPolymorphicMember inStruct } } + + method TestStructWithEnumKeyMapMember { + in { + DerivedTypeCollection.StructWithEnumKeyMap inStruct + } + } broadcast TestPredefinedTypeBroadcast { |