From 289de6adc0a7c4e3545ef858fa1e6676fbcdc106 Mon Sep 17 00:00:00 2001 From: Johannes Schanda Date: Wed, 9 Oct 2013 16:34:14 +0200 Subject: [PATCH] Resolve some bugs for windows VC++ & regenretate test sources - Chnage inlcudes where needed - Regenerate test sources - move some typedefs - fix a potential error when claiming names for new services --- src/CommonAPI/DBus/DBusFactory.cpp | 31 ++++++---- src/CommonAPI/DBus/DBusFactory.h | 2 +- src/CommonAPI/DBus/DBusRuntime.cpp | 7 +++ src/CommonAPI/DBus/DBusRuntime.h | 7 --- src/CommonAPI/DBus/DBusStubAdapterHelper.h | 8 +-- src/test/DBusConnectionTest.cpp | 1 + src/test/commonapi/tests/DerivedTypeCollection.cpp | 12 +++- src/test/commonapi/tests/DerivedTypeCollection.h | 72 ++++++++++++---------- .../commonapi/tests/PredefinedTypeCollection.h | 18 ++++-- src/test/commonapi/tests/TestInterface.h | 21 +++++-- .../commonapi/tests/TestInterfaceDBusProxy.cpp | 12 +++- src/test/commonapi/tests/TestInterfaceDBusProxy.h | 27 +++++--- .../tests/TestInterfaceDBusStubAdapter.cpp | 44 +++++++------ .../commonapi/tests/TestInterfaceDBusStubAdapter.h | 18 ++++-- src/test/commonapi/tests/TestInterfaceProxy.h | 67 ++++++++++---------- src/test/commonapi/tests/TestInterfaceProxyBase.h | 20 +++--- src/test/commonapi/tests/TestInterfaceStub.h | 20 ++++-- .../commonapi/tests/TestInterfaceStubDefault.cpp | 12 +++- .../commonapi/tests/TestInterfaceStubDefault.h | 18 ++++-- 19 files changed, 255 insertions(+), 162 deletions(-) diff --git a/src/CommonAPI/DBus/DBusFactory.cpp b/src/CommonAPI/DBus/DBusFactory.cpp index c75a393..0aa9558 100644 --- a/src/CommonAPI/DBus/DBusFactory.cpp +++ b/src/CommonAPI/DBus/DBusFactory.cpp @@ -125,15 +125,8 @@ bool DBusFactory::registerAdapter(std::shared_ptr stubBase, DBusAddressTranslator::getInstance().searchForDBusAddress(commonApiAddress, interfaceName, connectionName, objectPath); - if(acquiredConnectionName_ == "") { - bool isServiceNameAcquired = dbusConnection_->requestServiceNameAndBlock(connectionName); - if(!isServiceNameAcquired) { - return false; - } - acquiredConnectionName_ = connectionName; - } else if (acquiredConnectionName_ != connectionName) { - return false; - } + bool status = false; + if(!registeredAdapterFactoryFunctions_) { registeredAdapterFactoryFunctions_ = new std::unordered_map {}; @@ -145,13 +138,27 @@ bool DBusFactory::registerAdapter(std::shared_ptr stubBase, if(!dbusStubAdapter) { return false; } - if(registeredServices_.insert( {std::move(commonApiAddress), dbusStubAdapter} ).second) { + if(registeredServices_.insert( {commonApiAddress, dbusStubAdapter} ).second) { dbusStubAdapter->init(); - return true; + status = true; } } - return false; + if (acquiredConnectionName_ == "") { + bool isServiceNameAcquired = dbusConnection_->requestServiceNameAndBlock(connectionName); + if (!isServiceNameAcquired) { + registeredServices_.find(commonApiAddress)->second->deinit(); + registeredServices_.erase(commonApiAddress); + return false; + } + acquiredConnectionName_ = connectionName; + } else if (acquiredConnectionName_ != connectionName) { + registeredServices_.find(commonApiAddress)->second->deinit(); + registeredServices_.erase(commonApiAddress); + return false; + } + + return status; } bool DBusFactory::unregisterService(const std::string& participantId, const std::string& serviceName, const std::string& domain) { diff --git a/src/CommonAPI/DBus/DBusFactory.h b/src/CommonAPI/DBus/DBusFactory.h index 2b1a813..4951a96 100644 --- a/src/CommonAPI/DBus/DBusFactory.h +++ b/src/CommonAPI/DBus/DBusFactory.h @@ -11,7 +11,7 @@ #include -#include "CommonAPI/DBus/DBusStubAdapter.h" +#include "DBusStubAdapter.h" #include "DBusConnection.h" #include "DBusProxy.h" diff --git a/src/CommonAPI/DBus/DBusRuntime.cpp b/src/CommonAPI/DBus/DBusRuntime.cpp index a6d92db..6be703c 100644 --- a/src/CommonAPI/DBus/DBusRuntime.cpp +++ b/src/CommonAPI/DBus/DBusRuntime.cpp @@ -28,5 +28,12 @@ std::shared_ptr DBusRuntime::createFactory(std::shared_ptr DBusInterfaceMemberPath; + typedef std::unordered_map StubDispatcherTable; protected: - // interfaceMemberName, interfaceMemberSignature - typedef std::pair DBusInterfaceMemberPath; - typedef std::unordered_map StubDispatcherTable; virtual bool onInterfaceDBusMessage(const DBusMessage& dbusMessage) { const char* interfaceMemberName = dbusMessage.getMemberName(); @@ -151,7 +151,7 @@ class DBusMethodStubDispatcher<_StubClass, _In<_InArgs...> >: public DBusStubAda } private: - template + template inline bool handleDBusMessage(const DBusMessage& dbusMessage, const std::shared_ptr<_StubClass>& stub, DBusStubAdapterHelperType& dbusStubAdapterHelper, diff --git a/src/test/DBusConnectionTest.cpp b/src/test/DBusConnectionTest.cpp index 19a02a8..cb74d29 100644 --- a/src/test/DBusConnectionTest.cpp +++ b/src/test/DBusConnectionTest.cpp @@ -152,6 +152,7 @@ void notifyThunk(DBusPendingCall*, void* data) { } TEST_F(DBusConnectionTest, LibdbusConnectionsMayCommitSuicide) { + dbus_threads_init_default(); const ::DBusBusType libdbusType = ::DBusBusType::DBUS_BUS_SESSION; ::DBusError libdbusError; dbus_error_init(&libdbusError); diff --git a/src/test/commonapi/tests/DerivedTypeCollection.cpp b/src/test/commonapi/tests/DerivedTypeCollection.cpp index 14b083e..985ae38 100644 --- a/src/test/commonapi/tests/DerivedTypeCollection.cpp +++ b/src/test/commonapi/tests/DerivedTypeCollection.cpp @@ -1,6 +1,12 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +/* +* This file was generated by the CommonAPI Generators. +* +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +If a copy of the MPL was not distributed with this file, You can obtain one at +http://mozilla.org/MPL/2.0/. + +Test workspace +*/ #include "DerivedTypeCollection.h" namespace commonapi { diff --git a/src/test/commonapi/tests/DerivedTypeCollection.h b/src/test/commonapi/tests/DerivedTypeCollection.h index 26409d6..dbe1afb 100644 --- a/src/test/commonapi/tests/DerivedTypeCollection.h +++ b/src/test/commonapi/tests/DerivedTypeCollection.h @@ -1,8 +1,14 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef COMMONAPI_TESTS_DERIVED_TYPE_COLLECTION_H_ -#define COMMONAPI_TESTS_DERIVED_TYPE_COLLECTION_H_ +/* +* This file was generated by the CommonAPI Generators. +* +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +If a copy of the MPL was not distributed with this file, You can obtain one at +http://mozilla.org/MPL/2.0/. + +Test workspace +*/ +#ifndef COMMONAPI_TESTS_Derived_Type_Collection_H_ +#define COMMONAPI_TESTS_Derived_Type_Collection_H_ #include #include @@ -39,10 +45,10 @@ namespace DerivedTypeCollection { typedef std::unordered_map TestMap; enum class TestEnum: int32_t { - E_UNKNOWN = 0, - E_OK = 1, - E_OUT_OF_RANGE = 2, - E_NOT_USED = 3 + E_UNKNOWN = 0x0, + E_OK = 0x1, + E_OUT_OF_RANGE = 0x2, + E_NOT_USED = 0x3 }; // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 @@ -54,7 +60,7 @@ namespace DerivedTypeCollection { E_OUT_OF_RANGE = TestEnum::E_OUT_OF_RANGE, E_NOT_USED = TestEnum::E_NOT_USED , - E_NEW = 4 + E_NEW = 0x4 }; // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 @@ -68,7 +74,7 @@ namespace DerivedTypeCollection { E_NEW = TestEnumExtended::E_NEW , - E_NEW2 = 5 + E_NEW2 = 0x5 }; // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 @@ -92,7 +98,7 @@ namespace DerivedTypeCollection { typedef std::unordered_map TestEnumMap; enum class TestEnumMissingValue: int32_t { - E1 = 10, + E1 = 0xa, E2, E3 = 2 }; @@ -136,31 +142,31 @@ struct TestEnumExtended2Comparator { }; -inline bool operator==(const TestEnumExtended2& lhs, const TestEnum& rhs) { +inline bool operator==(const TestEnumExtended2& lhs, const DerivedTypeCollection::TestEnum& rhs) { return static_cast(lhs) == static_cast(rhs); } -inline bool operator==(const TestEnum& lhs, const TestEnumExtended2& rhs) { +inline bool operator==(const DerivedTypeCollection::TestEnum& lhs, const TestEnumExtended2& rhs) { return static_cast(lhs) == static_cast(rhs); -} -inline bool operator!=(const TestEnumExtended2& lhs, const TestEnum& rhs) { +} +inline bool operator!=(const TestEnumExtended2& lhs, const DerivedTypeCollection::TestEnum& rhs) { return static_cast(lhs) != static_cast(rhs); } -inline bool operator!=(const TestEnum& lhs, const TestEnumExtended2& rhs) { +inline bool operator!=(const DerivedTypeCollection::TestEnum& lhs, const TestEnumExtended2& rhs) { return static_cast(lhs) != static_cast(rhs); -} +} -inline bool operator==(const TestEnumExtended2& lhs, const TestEnumExtended& rhs) { +inline bool operator==(const TestEnumExtended2& lhs, const DerivedTypeCollection::TestEnumExtended& rhs) { return static_cast(lhs) == static_cast(rhs); } -inline bool operator==(const TestEnumExtended& lhs, const TestEnumExtended2& rhs) { +inline bool operator==(const DerivedTypeCollection::TestEnumExtended& lhs, const TestEnumExtended2& rhs) { return static_cast(lhs) == static_cast(rhs); -} -inline bool operator!=(const TestEnumExtended2& lhs, const TestEnumExtended& rhs) { +} +inline bool operator!=(const TestEnumExtended2& lhs, const DerivedTypeCollection::TestEnumExtended& rhs) { return static_cast(lhs) != static_cast(rhs); } -inline bool operator!=(const TestEnumExtended& lhs, const TestEnumExtended2& rhs) { +inline bool operator!=(const DerivedTypeCollection::TestEnumExtended& lhs, const TestEnumExtended2& rhs) { return static_cast(lhs) != static_cast(rhs); -} +} inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, TestEnumMissingValue& enumValue) { return inputStream.readEnumValue(enumValue); } @@ -190,18 +196,18 @@ struct TestEnumExtendedComparator { }; -inline bool operator==(const TestEnumExtended& lhs, const TestEnum& rhs) { +inline bool operator==(const TestEnumExtended& lhs, const DerivedTypeCollection::TestEnum& rhs) { return static_cast(lhs) == static_cast(rhs); } -inline bool operator==(const TestEnum& lhs, const TestEnumExtended& rhs) { +inline bool operator==(const DerivedTypeCollection::TestEnum& lhs, const TestEnumExtended& rhs) { return static_cast(lhs) == static_cast(rhs); -} -inline bool operator!=(const TestEnumExtended& lhs, const TestEnum& rhs) { +} +inline bool operator!=(const TestEnumExtended& lhs, const DerivedTypeCollection::TestEnum& rhs) { return static_cast(lhs) != static_cast(rhs); } -inline bool operator!=(const TestEnum& lhs, const TestEnumExtended& rhs) { +inline bool operator!=(const DerivedTypeCollection::TestEnum& lhs, const TestEnumExtended& rhs) { return static_cast(lhs) != static_cast(rhs); -} +} bool operator==(const TestStruct& lhs, const TestStruct& rhs); inline bool operator!=(const TestStruct& lhs, const TestStruct& rhs) { return !(lhs == rhs); @@ -305,24 +311,28 @@ namespace CommonAPI { namespace std { + //Hash for TestEnum template<> struct hash { inline size_t operator()(const commonapi::tests::DerivedTypeCollection::TestEnum& testEnum) const { return static_cast(testEnum); } }; + //Hash for TestEnumExtended2 template<> struct hash { inline size_t operator()(const commonapi::tests::DerivedTypeCollection::TestEnumExtended2& testEnumExtended2) const { return static_cast(testEnumExtended2); } }; + //Hash for TestEnumMissingValue template<> struct hash { inline size_t operator()(const commonapi::tests::DerivedTypeCollection::TestEnumMissingValue& testEnumMissingValue) const { return static_cast(testEnumMissingValue); } }; + //Hash for TestEnumExtended template<> struct hash { inline size_t operator()(const commonapi::tests::DerivedTypeCollection::TestEnumExtended& testEnumExtended) const { @@ -331,4 +341,4 @@ namespace std { }; } -#endif // COMMONAPI_TESTS_DERIVED_TYPE_COLLECTION_H_ +#endif // COMMONAPI_TESTS_Derived_Type_Collection_H_ diff --git a/src/test/commonapi/tests/PredefinedTypeCollection.h b/src/test/commonapi/tests/PredefinedTypeCollection.h index f1d3cc2..31e4733 100644 --- a/src/test/commonapi/tests/PredefinedTypeCollection.h +++ b/src/test/commonapi/tests/PredefinedTypeCollection.h @@ -1,8 +1,14 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef COMMONAPI_TESTS_PREDEFINED_TYPE_COLLECTION_H_ -#define COMMONAPI_TESTS_PREDEFINED_TYPE_COLLECTION_H_ +/* +* This file was generated by the CommonAPI Generators. +* +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +If a copy of the MPL was not distributed with this file, You can obtain one at +http://mozilla.org/MPL/2.0/. + +Test workspace +*/ +#ifndef COMMONAPI_TESTS_Predefined_Type_Collection_H_ +#define COMMONAPI_TESTS_Predefined_Type_Collection_H_ #include #include @@ -61,4 +67,4 @@ namespace CommonAPI { namespace std { } -#endif // COMMONAPI_TESTS_PREDEFINED_TYPE_COLLECTION_H_ +#endif // COMMONAPI_TESTS_Predefined_Type_Collection_H_ diff --git a/src/test/commonapi/tests/TestInterface.h b/src/test/commonapi/tests/TestInterface.h index fe0121e..86311e0 100644 --- a/src/test/commonapi/tests/TestInterface.h +++ b/src/test/commonapi/tests/TestInterface.h @@ -1,8 +1,14 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef COMMONAPI_TESTS_TEST_INTERFACE_H_ -#define COMMONAPI_TESTS_TEST_INTERFACE_H_ +/* +* This file was generated by the CommonAPI Generators. +* +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +If a copy of the MPL was not distributed with this file, You can obtain one at +http://mozilla.org/MPL/2.0/. + +Test workspace +*/ +#ifndef COMMONAPI_TESTS_Test_Interface_H_ +#define COMMONAPI_TESTS_Test_Interface_H_ #include @@ -35,6 +41,9 @@ namespace CommonAPI { namespace std { + //hashes for types + + //hashes for error types } -#endif // COMMONAPI_TESTS_TEST_INTERFACE_H_ +#endif // COMMONAPI_TESTS_Test_Interface_H_ diff --git a/src/test/commonapi/tests/TestInterfaceDBusProxy.cpp b/src/test/commonapi/tests/TestInterfaceDBusProxy.cpp index f5460d1..9012719 100644 --- a/src/test/commonapi/tests/TestInterfaceDBusProxy.cpp +++ b/src/test/commonapi/tests/TestInterfaceDBusProxy.cpp @@ -1,6 +1,12 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +/* +* This file was generated by the CommonAPI Generators. +* +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +If a copy of the MPL was not distributed with this file, You can obtain one at +http://mozilla.org/MPL/2.0/. + +Test workspace +*/ #include "TestInterfaceDBusProxy.h" namespace commonapi { diff --git a/src/test/commonapi/tests/TestInterfaceDBusProxy.h b/src/test/commonapi/tests/TestInterfaceDBusProxy.h index 1ec27be..51ee3df 100644 --- a/src/test/commonapi/tests/TestInterfaceDBusProxy.h +++ b/src/test/commonapi/tests/TestInterfaceDBusProxy.h @@ -1,8 +1,14 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef COMMONAPI_TESTS_TEST_INTERFACE_DBUS_PROXY_H_ -#define COMMONAPI_TESTS_TEST_INTERFACE_DBUS_PROXY_H_ +/* +* This file was generated by the CommonAPI Generators. +* +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +If a copy of the MPL was not distributed with this file, You can obtain one at +http://mozilla.org/MPL/2.0/. + +Test workspace +*/ +#ifndef COMMONAPI_TESTS_Test_Interface_DBUS_PROXY_H_ +#define COMMONAPI_TESTS_Test_Interface_DBUS_PROXY_H_ #include #include @@ -24,7 +30,7 @@ class TestInterfaceDBusProxy: virtual public TestInterfaceProxyBase, virtual pub const std::string& objectPath, const std::shared_ptr& dbusProxyconnection); - virtual ~TestInterfaceDBusProxy() {} + virtual ~TestInterfaceDBusProxy() { } virtual TestPredefinedTypeAttributeAttribute& getTestPredefinedTypeAttributeAttribute(); virtual TestDerivedStructAttributeAttribute& getTestDerivedStructAttributeAttribute(); @@ -32,17 +38,22 @@ class TestInterfaceDBusProxy: virtual public TestInterfaceProxyBase, virtual pub virtual TestPredefinedTypeBroadcastEvent& getTestPredefinedTypeBroadcastEvent(); + virtual void testEmptyMethod(CommonAPI::CallStatus& callStatus); virtual std::future testEmptyMethodAsync(TestEmptyMethodAsyncCallback callback); + virtual void testVoidPredefinedTypeMethod(const uint32_t& uint32Value, const std::string& stringValue, CommonAPI::CallStatus& callStatus); virtual std::future testVoidPredefinedTypeMethodAsync(const uint32_t& uint32Value, const std::string& stringValue, TestVoidPredefinedTypeMethodAsyncCallback callback); + virtual void testPredefinedTypeMethod(const uint32_t& uint32InValue, const std::string& stringInValue, CommonAPI::CallStatus& callStatus, uint32_t& uint32OutValue, std::string& stringOutValue); virtual std::future testPredefinedTypeMethodAsync(const uint32_t& uint32InValue, const std::string& stringInValue, TestPredefinedTypeMethodAsyncCallback callback); + virtual void testVoidDerivedTypeMethod(const DerivedTypeCollection::TestEnumExtended2& testEnumExtended2Value, const DerivedTypeCollection::TestMap& testMapValue, CommonAPI::CallStatus& callStatus); virtual std::future testVoidDerivedTypeMethodAsync(const DerivedTypeCollection::TestEnumExtended2& testEnumExtended2Value, const DerivedTypeCollection::TestMap& testMapValue, TestVoidDerivedTypeMethodAsyncCallback callback); + virtual void testDerivedTypeMethod(const DerivedTypeCollection::TestEnumExtended2& testEnumExtended2InValue, const DerivedTypeCollection::TestMap& testMapInValue, CommonAPI::CallStatus& callStatus, DerivedTypeCollection::TestEnumExtended2& testEnumExtended2OutValue, DerivedTypeCollection::TestMap& testMapOutValue); virtual std::future testDerivedTypeMethodAsync(const DerivedTypeCollection::TestEnumExtended2& testEnumExtended2InValue, const DerivedTypeCollection::TestMap& testMapInValue, TestDerivedTypeMethodAsyncCallback callback); - + virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const; private: @@ -56,4 +67,4 @@ class TestInterfaceDBusProxy: virtual public TestInterfaceProxyBase, virtual pub } // namespace tests } // namespace commonapi -#endif // COMMONAPI_TESTS_TEST_INTERFACE_DBUS_PROXY_H_ +#endif // COMMONAPI_TESTS_Test_Interface_DBUS_PROXY_H_ diff --git a/src/test/commonapi/tests/TestInterfaceDBusStubAdapter.cpp b/src/test/commonapi/tests/TestInterfaceDBusStubAdapter.cpp index 9145d2c..97f434c 100644 --- a/src/test/commonapi/tests/TestInterfaceDBusStubAdapter.cpp +++ b/src/test/commonapi/tests/TestInterfaceDBusStubAdapter.cpp @@ -1,6 +1,12 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +/* +* This file was generated by the CommonAPI Generators. +* +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +If a copy of the MPL was not distributed with this file, You can obtain one at +http://mozilla.org/MPL/2.0/. + +Test workspace +*/ #include "TestInterfaceDBusStubAdapter.h" #include @@ -168,22 +174,6 @@ static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< > testDerivedTypeMethodStubDispatcher(&TestInterfaceStub::testDerivedTypeMethod, "ia{ua(sq)}"); -template<> -const TestInterfaceDBusStubAdapterHelper::StubDispatcherTable TestInterfaceDBusStubAdapterHelper::stubDispatcherTable_ = { - { { "getTestPredefinedTypeAttributeAttribute", "" }, &commonapi::tests::getTestPredefinedTypeAttributeAttributeStubDispatcher } - , { { "setTestPredefinedTypeAttributeAttribute", "u" }, &commonapi::tests::setTestPredefinedTypeAttributeAttributeStubDispatcher }, - { { "getTestDerivedStructAttributeAttribute", "" }, &commonapi::tests::getTestDerivedStructAttributeAttributeStubDispatcher } - , { { "setTestDerivedStructAttributeAttribute", "(sqi)" }, &commonapi::tests::setTestDerivedStructAttributeAttributeStubDispatcher }, - { { "getTestDerivedArrayAttributeAttribute", "" }, &commonapi::tests::getTestDerivedArrayAttributeAttributeStubDispatcher } - , { { "setTestDerivedArrayAttributeAttribute", "at" }, &commonapi::tests::setTestDerivedArrayAttributeAttributeStubDispatcher } - , - { { "testEmptyMethod", "" }, &commonapi::tests::testEmptyMethodStubDispatcher }, - { { "testVoidPredefinedTypeMethod", "us" }, &commonapi::tests::testVoidPredefinedTypeMethodStubDispatcher }, - { { "testPredefinedTypeMethod", "us" }, &commonapi::tests::testPredefinedTypeMethodStubDispatcher }, - { { "testVoidDerivedTypeMethod", "ia{ua(sq)}" }, &commonapi::tests::testVoidDerivedTypeMethodStubDispatcher }, - { { "testDerivedTypeMethod", "ia{ua(sq)}" }, &commonapi::tests::testDerivedTypeMethodStubDispatcher } -}; - void TestInterfaceDBusStubAdapter::fireTestPredefinedTypeAttributeAttributeChanged(const uint32_t& value) { CommonAPI::DBus::DBusStubSignalHelper> ::sendSignal( @@ -224,3 +214,19 @@ void TestInterfaceDBusStubAdapter::fireTestPredefinedTypeBroadcastEvent(const ui } // namespace tests } // namespace commonapi + +template<> +const commonapi::tests::TestInterfaceDBusStubAdapterHelper::StubDispatcherTable commonapi::tests::TestInterfaceDBusStubAdapterHelper::stubDispatcherTable_ = { + { { "getTestPredefinedTypeAttributeAttribute", "" }, &commonapi::tests::getTestPredefinedTypeAttributeAttributeStubDispatcher } + , { { "setTestPredefinedTypeAttributeAttribute", "u" }, &commonapi::tests::setTestPredefinedTypeAttributeAttributeStubDispatcher }, + { { "getTestDerivedStructAttributeAttribute", "" }, &commonapi::tests::getTestDerivedStructAttributeAttributeStubDispatcher } + , { { "setTestDerivedStructAttributeAttribute", "(sqi)" }, &commonapi::tests::setTestDerivedStructAttributeAttributeStubDispatcher }, + { { "getTestDerivedArrayAttributeAttribute", "" }, &commonapi::tests::getTestDerivedArrayAttributeAttributeStubDispatcher } + , { { "setTestDerivedArrayAttributeAttribute", "at" }, &commonapi::tests::setTestDerivedArrayAttributeAttributeStubDispatcher } + , + { { "testEmptyMethod", "" }, &commonapi::tests::testEmptyMethodStubDispatcher }, + { { "testVoidPredefinedTypeMethod", "us" }, &commonapi::tests::testVoidPredefinedTypeMethodStubDispatcher }, + { { "testPredefinedTypeMethod", "us" }, &commonapi::tests::testPredefinedTypeMethodStubDispatcher }, + { { "testVoidDerivedTypeMethod", "ia{ua(sq)}" }, &commonapi::tests::testVoidDerivedTypeMethodStubDispatcher }, + { { "testDerivedTypeMethod", "ia{ua(sq)}" }, &commonapi::tests::testDerivedTypeMethodStubDispatcher } +}; diff --git a/src/test/commonapi/tests/TestInterfaceDBusStubAdapter.h b/src/test/commonapi/tests/TestInterfaceDBusStubAdapter.h index 651a22b..d018fac 100644 --- a/src/test/commonapi/tests/TestInterfaceDBusStubAdapter.h +++ b/src/test/commonapi/tests/TestInterfaceDBusStubAdapter.h @@ -1,8 +1,14 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef COMMONAPI_TESTS_TEST_INTERFACE_DBUS_STUB_ADAPTER_H_ -#define COMMONAPI_TESTS_TEST_INTERFACE_DBUS_STUB_ADAPTER_H_ +/* +* This file was generated by the CommonAPI Generators. +* +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +If a copy of the MPL was not distributed with this file, You can obtain one at +http://mozilla.org/MPL/2.0/. + +Test workspace +*/ +#ifndef COMMONAPI_TESTS_Test_Interface_DBUS_STUB_ADAPTER_H_ +#define COMMONAPI_TESTS_Test_Interface_DBUS_STUB_ADAPTER_H_ #include @@ -37,4 +43,4 @@ class TestInterfaceDBusStubAdapter: public TestInterfaceStubAdapter, public Test } // namespace tests } // namespace commonapi -#endif // COMMONAPI_TESTS_TEST_INTERFACE_DBUS_STUB_ADAPTER_H_ +#endif // COMMONAPI_TESTS_Test_Interface_DBUS_STUB_ADAPTER_H_ diff --git a/src/test/commonapi/tests/TestInterfaceProxy.h b/src/test/commonapi/tests/TestInterfaceProxy.h index 88dfde1..9652f33 100644 --- a/src/test/commonapi/tests/TestInterfaceProxy.h +++ b/src/test/commonapi/tests/TestInterfaceProxy.h @@ -1,8 +1,14 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef COMMONAPI_TESTS_TEST_INTERFACE_PROXY_H_ -#define COMMONAPI_TESTS_TEST_INTERFACE_PROXY_H_ +/* +* This file was generated by the CommonAPI Generators. +* +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +If a copy of the MPL was not distributed with this file, You can obtain one at +http://mozilla.org/MPL/2.0/. + +Test workspace +*/ +#ifndef COMMONAPI_TESTS_Test_Interface_PROXY_H_ +#define COMMONAPI_TESTS_Test_Interface_PROXY_H_ #include "TestInterfaceProxyBase.h" #include @@ -18,14 +24,26 @@ class TestInterfaceProxy: virtual public TestInterface, virtual public TestInter ~TestInterfaceProxy(); /// Returns the wrapper class that provides access to the attribute TestPredefinedTypeAttribute. - virtual TestPredefinedTypeAttributeAttribute& getTestPredefinedTypeAttributeAttribute(); + virtual TestPredefinedTypeAttributeAttribute& getTestPredefinedTypeAttributeAttribute() { + return delegate_->getTestPredefinedTypeAttributeAttribute(); + } + /// Returns the wrapper class that provides access to the attribute TestDerivedStructAttribute. - virtual TestDerivedStructAttributeAttribute& getTestDerivedStructAttributeAttribute(); + virtual TestDerivedStructAttributeAttribute& getTestDerivedStructAttributeAttribute() { + return delegate_->getTestDerivedStructAttributeAttribute(); + } + /// Returns the wrapper class that provides access to the attribute TestDerivedArrayAttribute. - virtual TestDerivedArrayAttributeAttribute& getTestDerivedArrayAttributeAttribute(); + virtual TestDerivedArrayAttributeAttribute& getTestDerivedArrayAttributeAttribute() { + return delegate_->getTestDerivedArrayAttributeAttribute(); + } + /// Returns the wrapper class that provides access to the broadcast TestPredefinedTypeBroadcast. - virtual TestPredefinedTypeBroadcastEvent& getTestPredefinedTypeBroadcastEvent(); + virtual TestPredefinedTypeBroadcastEvent& getTestPredefinedTypeBroadcastEvent() { + return delegate_->getTestPredefinedTypeBroadcastEvent(); + } + /** @@ -230,8 +248,11 @@ namespace TestInterfaceExtensions { // template TestInterfaceProxy<_AttributeExtensions...>::TestInterfaceProxy(std::shared_ptr delegate): - delegate_(std::dynamic_pointer_cast(delegate)), - _AttributeExtensions(*(std::dynamic_pointer_cast(delegate)))... { + delegate_(std::dynamic_pointer_cast(delegate)) +#ifndef _WIN32 + , _AttributeExtensions(*(std::dynamic_pointer_cast(delegate)))... +#endif +{ } template @@ -239,28 +260,6 @@ TestInterfaceProxy<_AttributeExtensions...>::~TestInterfaceProxy() { } template -typename TestInterfaceProxy<_AttributeExtensions...>::TestPredefinedTypeAttributeAttribute& TestInterfaceProxy<_AttributeExtensions...>::getTestPredefinedTypeAttributeAttribute() { - return delegate_->getTestPredefinedTypeAttributeAttribute(); -} - -template -typename TestInterfaceProxy<_AttributeExtensions...>::TestDerivedStructAttributeAttribute& TestInterfaceProxy<_AttributeExtensions...>::getTestDerivedStructAttributeAttribute() { - return delegate_->getTestDerivedStructAttributeAttribute(); -} - -template -typename TestInterfaceProxy<_AttributeExtensions...>::TestDerivedArrayAttributeAttribute& TestInterfaceProxy<_AttributeExtensions...>::getTestDerivedArrayAttributeAttribute() { - return delegate_->getTestDerivedArrayAttributeAttribute(); -} - - -template -typename TestInterfaceProxy<_AttributeExtensions...>::TestPredefinedTypeBroadcastEvent& TestInterfaceProxy<_AttributeExtensions...>::getTestPredefinedTypeBroadcastEvent() { - return delegate_->getTestPredefinedTypeBroadcastEvent(); -} - - -template void TestInterfaceProxy<_AttributeExtensions...>::testEmptyMethod(CommonAPI::CallStatus& callStatus) { delegate_->testEmptyMethod(callStatus); } @@ -362,4 +361,4 @@ struct DefaultAttributeProxyFactoryHelper @@ -16,6 +22,7 @@ #include #include #include +#include namespace commonapi { namespace tests { @@ -55,8 +62,7 @@ class TestInterfaceProxyBase: virtual public CommonAPI::Proxy { virtual std::future testDerivedTypeMethodAsync(const DerivedTypeCollection::TestEnumExtended2& testEnumExtended2InValue, const DerivedTypeCollection::TestMap& testMapInValue, TestDerivedTypeMethodAsyncCallback callback) = 0; }; - } // namespace tests } // namespace commonapi -#endif // COMMONAPI_TESTS_TEST_INTERFACE_PROXY_BASE_H_ +#endif // COMMONAPI_TESTS_Test_Interface_PROXY_BASE_H_ diff --git a/src/test/commonapi/tests/TestInterfaceStub.h b/src/test/commonapi/tests/TestInterfaceStub.h index 6d078ed..52aa842 100644 --- a/src/test/commonapi/tests/TestInterfaceStub.h +++ b/src/test/commonapi/tests/TestInterfaceStub.h @@ -1,8 +1,14 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef COMMONAPI_TESTS_TEST_INTERFACE_STUB_H_ -#define COMMONAPI_TESTS_TEST_INTERFACE_STUB_H_ +/* +* This file was generated by the CommonAPI Generators. +* +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +If a copy of the MPL was not distributed with this file, You can obtain one at +http://mozilla.org/MPL/2.0/. + +Test workspace +*/ +#ifndef COMMONAPI_TESTS_Test_Interface_STUB_H_ +#define COMMONAPI_TESTS_Test_Interface_STUB_H_ #include #include @@ -13,6 +19,8 @@ #include "TestInterface.h" #include +#include + namespace commonapi { namespace tests { @@ -108,4 +116,4 @@ class TestInterfaceStub : public CommonAPI::Stub namespace commonapi { diff --git a/src/test/commonapi/tests/TestInterfaceStubDefault.h b/src/test/commonapi/tests/TestInterfaceStubDefault.h index 3f0aeff..e8b3228 100644 --- a/src/test/commonapi/tests/TestInterfaceStubDefault.h +++ b/src/test/commonapi/tests/TestInterfaceStubDefault.h @@ -1,8 +1,14 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef COMMONAPI_TESTS_TEST_INTERFACE_STUB_DEFAULT_H_ -#define COMMONAPI_TESTS_TEST_INTERFACE_STUB_DEFAULT_H_ +/* +* This file was generated by the CommonAPI Generators. +* +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +If a copy of the MPL was not distributed with this file, You can obtain one at +http://mozilla.org/MPL/2.0/. + +Test workspace +*/ +#ifndef COMMONAPI_TESTS_Test_Interface_STUB_DEFAULT_H_ +#define COMMONAPI_TESTS_Test_Interface_STUB_DEFAULT_H_ #include @@ -92,4 +98,4 @@ class TestInterfaceStubDefault : public TestInterfaceStub { } // namespace tests } // namespace commonapi -#endif // COMMONAPI_TESTS_TEST_INTERFACE_STUB_DEFAULT_H_ +#endif // COMMONAPI_TESTS_Test_Interface_STUB_DEFAULT_H_ -- 2.7.4