diff options
Diffstat (limited to 'src/test/src-gen/dbus/v1_0/commonapi/tests')
32 files changed, 4076 insertions, 0 deletions
diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/ExtendedInterfaceDBusProxy.cpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/ExtendedInterfaceDBusProxy.cpp new file mode 100644 index 0000000..ea7cc5f --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/ExtendedInterfaceDBusProxy.cpp @@ -0,0 +1,69 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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/. +*/ +#include <v1_0/commonapi/tests/ExtendedInterfaceDBusProxy.hpp> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +std::shared_ptr<CommonAPI::DBus::DBusProxy> createExtendedInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection) { + return std::make_shared<ExtendedInterfaceDBusProxy>(_address, _connection); +} + +INITIALIZER(registerExtendedInterfaceDBusProxy) { + CommonAPI::DBus::Factory::get()->registerProxyCreateMethod( + ExtendedInterface::getInterface(), + &createExtendedInterfaceDBusProxy); +} + +ExtendedInterfaceDBusProxy::ExtendedInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection) + : CommonAPI::DBus::DBusProxy(_address, _connection), + TestInterfaceDBusProxy(_address, _connection) +{ +} + + + + void ExtendedInterfaceDBusProxy::TestIntMethodExtended(const uint32_t &_inInt, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodWithReply( + *this, + "TestIntMethodExtended", + "u", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _inInt, + _status + ); + } + std::future<CommonAPI::CallStatus> ExtendedInterfaceDBusProxy::TestIntMethodExtendedAsync(const uint32_t &_inInt, TestIntMethodExtendedAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodAsync( + *this, + "TestIntMethodExtended", + "u", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _inInt, + std::move(_callback), + std::tuple<>()); + } + + + void ExtendedInterfaceDBusProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const { + ownVersionMajor = 1; + ownVersionMinor = 0; + } + + } // namespace tests + } // namespace commonapi + } // namespace v1_0 diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/ExtendedInterfaceDBusProxy.hpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/ExtendedInterfaceDBusProxy.hpp new file mode 100644 index 0000000..7d95904 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/ExtendedInterfaceDBusProxy.hpp @@ -0,0 +1,61 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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_Extended_Interface_DBUS_PROXY_HPP_ +#define COMMONAPI_TESTS_Extended_Interface_DBUS_PROXY_HPP_ + +#include <v1_0/commonapi/tests/ExtendedInterfaceProxyBase.hpp> +#include <v1_0/commonapi/tests/TestInterfaceDBusProxy.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusAddress.hpp> +#include <CommonAPI/DBus/DBusFactory.hpp> +#include <CommonAPI/DBus/DBusProxy.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +#include <string> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +class ExtendedInterfaceDBusProxy + : virtual public ExtendedInterfaceProxyBase, + virtual public TestInterfaceDBusProxy { +public: + ExtendedInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection); + + virtual ~ExtendedInterfaceDBusProxy() { } + + + + virtual void TestIntMethodExtended(const uint32_t &_inInt, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info); + virtual std::future<CommonAPI::CallStatus> TestIntMethodExtendedAsync(const uint32_t &_inInt, TestIntMethodExtendedAsyncCallback _callback, const CommonAPI::CallInfo *_info); + + + virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const; + +private: + + + +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Extended_Interface_DBUS_PROXY_HPP_ + diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/ExtendedInterfaceDBusStubAdapter.cpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/ExtendedInterfaceDBusStubAdapter.cpp new file mode 100644 index 0000000..3e3fdac --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/ExtendedInterfaceDBusStubAdapter.cpp @@ -0,0 +1,256 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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/. +*/ +#include <v1_0/commonapi/tests/ExtendedInterface.hpp> +#include <v1_0/commonapi/tests/ExtendedInterfaceDBusStubAdapter.hpp> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createExtendedInterfaceDBusStubAdapter( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) { + return std::make_shared<ExtendedInterfaceDBusStubAdapter>(_address, _connection, _stub); +} + +INITIALIZER(registerExtendedInterfaceDBusStubAdapter) { + CommonAPI::DBus::Factory::get()->registerStubAdapterCreateMethod( + ExtendedInterface::getInterface(), &createExtendedInterfaceDBusStubAdapter); +} + +ExtendedInterfaceDBusStubAdapterInternal::~ExtendedInterfaceDBusStubAdapterInternal() { + deactivateManagedInstances(); + ExtendedInterfaceDBusStubAdapterHelper::deinit(); +} + +void ExtendedInterfaceDBusStubAdapterInternal::deactivateManagedInstances() { + +} + +const char* ExtendedInterfaceDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const { + static const std::string introspectionData = + std::string(TestInterfaceDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData()) + + "<method name=\"TestIntMethodExtended\">\n" + "<arg name=\"_inInt\" type=\"u\" direction=\"in\" />\n" + "</method>\n" + + ; + return introspectionData.c_str(); +} + +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ExtendedInterfaceStub, + CommonAPI::Version + > ExtendedInterfaceDBusStubAdapterInternal::getExtendedInterfaceInterfaceVersionStubDispatcher(&ExtendedInterfaceStub::getInterfaceVersion, "uu"); + + +#ifdef WIN32 +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ExtendedInterfaceStub, + uint32_t + > ExtendedInterfaceDBusStubAdapterInternal::getTestPredefinedTypeAttributeAttributeStubDispatcher(&ExtendedInterfaceStub::getTestPredefinedTypeAttributeAttribute, "u"); +CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ExtendedInterfaceStub, + uint32_t + > ExtendedInterfaceDBusStubAdapterInternal::setTestPredefinedTypeAttributeAttributeStubDispatcher( + &ExtendedInterfaceStub::getTestPredefinedTypeAttributeAttribute, + &ExtendedInterfaceStubRemoteEvent::onRemoteSetTestPredefinedTypeAttributeAttribute, + &ExtendedInterfaceStubRemoteEvent::onRemoteTestPredefinedTypeAttributeAttributeChanged + ,&ExtendedInterfaceStubAdapter::fireTestPredefinedTypeAttributeAttributeChanged + ,"u" + ); +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ExtendedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > ExtendedInterfaceDBusStubAdapterInternal::getTestDerivedStructAttributeAttributeStubDispatcher(&ExtendedInterfaceStub::getTestDerivedStructAttributeAttribute, "(sqi)"); +CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ExtendedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > ExtendedInterfaceDBusStubAdapterInternal::setTestDerivedStructAttributeAttributeStubDispatcher( + &ExtendedInterfaceStub::getTestDerivedStructAttributeAttribute, + &ExtendedInterfaceStubRemoteEvent::onRemoteSetTestDerivedStructAttributeAttribute, + &ExtendedInterfaceStubRemoteEvent::onRemoteTestDerivedStructAttributeAttributeChanged + ,&ExtendedInterfaceStubAdapter::fireTestDerivedStructAttributeAttributeChanged + ,"(sqi)" + ); +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ExtendedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > ExtendedInterfaceDBusStubAdapterInternal::getTestDerivedArrayAttributeAttributeStubDispatcher(&ExtendedInterfaceStub::getTestDerivedArrayAttributeAttribute, "at"); +CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ExtendedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > ExtendedInterfaceDBusStubAdapterInternal::setTestDerivedArrayAttributeAttributeStubDispatcher( + &ExtendedInterfaceStub::getTestDerivedArrayAttributeAttribute, + &ExtendedInterfaceStubRemoteEvent::onRemoteSetTestDerivedArrayAttributeAttribute, + &ExtendedInterfaceStubRemoteEvent::onRemoteTestDerivedArrayAttributeAttributeChanged + ,&ExtendedInterfaceStubAdapter::fireTestDerivedArrayAttributeAttributeChanged + ,"at" + ); +#endif + +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<uint32_t>, + std::tuple<> + > ExtendedInterfaceDBusStubAdapterInternal::testIntMethodExtendedStubDispatcher(&ExtendedInterfaceStub::TestIntMethodExtended, "", std::tuple<uint32_t>()); + +#ifdef WIN32 +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<>, + std::tuple<> + > ExtendedInterfaceDBusStubAdapterInternal::testEmptyMethodStubDispatcher(&ExtendedInterfaceStub::testEmptyMethod, "", std::tuple<>()); +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<uint32_t, std::string>, + std::tuple<> + > ExtendedInterfaceDBusStubAdapterInternal::testVoidPredefinedTypeMethodStubDispatcher(&ExtendedInterfaceStub::testVoidPredefinedTypeMethod, "", std::tuple<uint32_t, std::string>()); +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<uint32_t, std::string>, + std::tuple<uint32_t, std::string> + > ExtendedInterfaceDBusStubAdapterInternal::testPredefinedTypeMethodStubDispatcher(&ExtendedInterfaceStub::testPredefinedTypeMethod, "us", std::tuple<uint32_t, std::string, uint32_t, std::string>()); +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>, + std::tuple<> + > ExtendedInterfaceDBusStubAdapterInternal::testVoidDerivedTypeMethodStubDispatcher(&ExtendedInterfaceStub::testVoidDerivedTypeMethod, "", std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>()); +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>, + std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap> + > ExtendedInterfaceDBusStubAdapterInternal::testDerivedTypeMethodStubDispatcher(&ExtendedInterfaceStub::testDerivedTypeMethod, "ia{ua(sq)}", std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap, ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>()); +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>>>, + std::tuple<> + > ExtendedInterfaceDBusStubAdapterInternal::testArrayOfPolymorphicStructMethodStubDispatcher(&ExtendedInterfaceStub::TestArrayOfPolymorphicStructMethod, "", std::tuple<std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>>>()); +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic>, + std::tuple<> + > ExtendedInterfaceDBusStubAdapterInternal::testMapOfPolymorphicStructMethodStubDispatcher(&ExtendedInterfaceStub::TestMapOfPolymorphicStructMethod, "", std::tuple<::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic>()); +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember>, + std::tuple<> + > ExtendedInterfaceDBusStubAdapterInternal::testStructWithPolymorphicMemberMethodStubDispatcher(&ExtendedInterfaceStub::TestStructWithPolymorphicMemberMethod, "", std::tuple<::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember>()); +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap>, + std::tuple<> + > ExtendedInterfaceDBusStubAdapterInternal::testStructWithEnumKeyMapMemberStubDispatcher(&ExtendedInterfaceStub::TestStructWithEnumKeyMapMember, "", std::tuple<::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap>()); +#endif + + + +#ifdef WIN32 +CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher< + ExtendedInterfaceStub, + ExtendedInterfaceStubAdapter, + std::tuple<>, + std::tuple<bool> + > ExtendedInterfaceDBusStubAdapterInternal::subscribeTestSelectiveBroadcastSelectiveStubDispatcher(&ExtendedInterfaceStubAdapter::subscribeForTestSelectiveBroadcastSelective, "b"); + +CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher< + ExtendedInterfaceStub, + ExtendedInterfaceStubAdapter, + std::tuple<>, + std::tuple<> + > ExtendedInterfaceDBusStubAdapterInternal::unsubscribeTestSelectiveBroadcastSelectiveStubDispatcher(&ExtendedInterfaceStubAdapter::unsubscribeFromTestSelectiveBroadcastSelective, ""); +CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher< + ExtendedInterfaceStub, + ExtendedInterfaceStubAdapter, + std::tuple<>, + std::tuple<bool> + > ExtendedInterfaceDBusStubAdapterInternal::subscribeTestBroadcastWithOutArgsSelectiveStubDispatcher(&ExtendedInterfaceStubAdapter::subscribeForTestBroadcastWithOutArgsSelective, "b"); + +CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher< + ExtendedInterfaceStub, + ExtendedInterfaceStubAdapter, + std::tuple<>, + std::tuple<> + > ExtendedInterfaceDBusStubAdapterInternal::unsubscribeTestBroadcastWithOutArgsSelectiveStubDispatcher(&ExtendedInterfaceStubAdapter::unsubscribeFromTestBroadcastWithOutArgsSelective, ""); +#endif + +const ExtendedInterfaceDBusStubAdapterHelper::StubDispatcherTable& ExtendedInterfaceDBusStubAdapterInternal::getStubDispatcherTable() { + return stubDispatcherTable_; +} + +const CommonAPI::DBus::StubAttributeTable& ExtendedInterfaceDBusStubAdapterInternal::getStubAttributeTable() { + return stubAttributeTable_; +} + +ExtendedInterfaceDBusStubAdapterInternal::ExtendedInterfaceDBusStubAdapterInternal( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) + : CommonAPI::DBus::DBusStubAdapter(_address, _connection,false), + ExtendedInterfaceDBusStubAdapterHelper(_address, _connection, std::dynamic_pointer_cast<ExtendedInterfaceStub>(_stub), false), + TestInterfaceDBusStubAdapterInternal(_address, _connection, _stub), + stubDispatcherTable_({ + { { "TestIntMethodExtended", "u" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testIntMethodExtendedStubDispatcher } + #ifdef WIN32 + , + { { "getTestPredefinedTypeAttributeAttribute", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::getTestPredefinedTypeAttributeAttributeStubDispatcher } + , { { "setTestPredefinedTypeAttributeAttribute", "u" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::setTestPredefinedTypeAttributeAttributeStubDispatcher }, + { { "getTestDerivedStructAttributeAttribute", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::getTestDerivedStructAttributeAttributeStubDispatcher } + , { { "setTestDerivedStructAttributeAttribute", "(sqi)" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::setTestDerivedStructAttributeAttributeStubDispatcher }, + { { "getTestDerivedArrayAttributeAttribute", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::getTestDerivedArrayAttributeAttributeStubDispatcher } + , { { "setTestDerivedArrayAttributeAttribute", "at" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::setTestDerivedArrayAttributeAttributeStubDispatcher } + , + { { "testEmptyMethod", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testEmptyMethodStubDispatcher }, + { { "testVoidPredefinedTypeMethod", "us" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testVoidPredefinedTypeMethodStubDispatcher }, + { { "testPredefinedTypeMethod", "us" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testPredefinedTypeMethodStubDispatcher }, + { { "testVoidDerivedTypeMethod", "ia{ua(sq)}" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testVoidDerivedTypeMethodStubDispatcher }, + { { "testDerivedTypeMethod", "ia{ua(sq)}" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testDerivedTypeMethodStubDispatcher }, + { { "TestArrayOfPolymorphicStructMethod", "a(uv)" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testArrayOfPolymorphicStructMethodStubDispatcher }, + { { "TestMapOfPolymorphicStructMethod", "a{y(uv)}" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testMapOfPolymorphicStructMethodStubDispatcher }, + { { "TestStructWithPolymorphicMemberMethod", "(u(uv))" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testStructWithPolymorphicMemberMethodStubDispatcher }, + { { "TestStructWithEnumKeyMapMember", "(a{is})" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::testStructWithEnumKeyMapMemberStubDispatcher } + , + { { "subscribeForTestSelectiveBroadcastSelective", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::subscribeTestSelectiveBroadcastSelectiveStubDispatcher } + , + { { "unsubscribeFromTestSelectiveBroadcastSelective", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::unsubscribeTestSelectiveBroadcastSelectiveStubDispatcher }, + { { "subscribeForTestBroadcastWithOutArgsSelective", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::subscribeTestBroadcastWithOutArgsSelectiveStubDispatcher } + , + { { "unsubscribeFromTestBroadcastWithOutArgsSelective", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::unsubscribeTestBroadcastWithOutArgsSelectiveStubDispatcher } + #endif + }), + stubAttributeTable_() { + + #ifdef WIN32 + stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::getExtendedInterfaceInterfaceVersionStubDispatcher }); + #else + auto parentDispatcherTable = TestInterfaceDBusStubAdapterInternal::getStubDispatcherTable(); + stubDispatcherTable_.insert(parentDispatcherTable.begin(), parentDispatcherTable.end()); + + auto interfaceVersionGetter = stubDispatcherTable_.find({ "getInterfaceVersion", "" }); + if(interfaceVersionGetter != stubDispatcherTable_.end()) { + interfaceVersionGetter->second = &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::getExtendedInterfaceInterfaceVersionStubDispatcher; + } else { + stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &commonapi::tests::ExtendedInterfaceDBusStubAdapterInternal::getExtendedInterfaceInterfaceVersionStubDispatcher }); + } + + auto parentAttributeTable = TestInterfaceDBusStubAdapterInternal::getStubAttributeTable(); + stubAttributeTable_.insert(parentAttributeTable.begin(), parentAttributeTable.end()); + + #endif +} + +const bool ExtendedInterfaceDBusStubAdapterInternal::hasFreedesktopProperties() { + return false; +} + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/ExtendedInterfaceDBusStubAdapter.hpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/ExtendedInterfaceDBusStubAdapter.hpp new file mode 100644 index 0000000..ff1545c --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/ExtendedInterfaceDBusStubAdapter.hpp @@ -0,0 +1,223 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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_Extended_Interface_DBUS_STUB_ADAPTER_HPP_ +#define COMMONAPI_TESTS_Extended_Interface_DBUS_STUB_ADAPTER_HPP_ + +#include <v1_0/commonapi/tests/ExtendedInterfaceStub.hpp> +#include <v1_0/commonapi/tests/TestInterfaceDBusStubAdapter.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusFactory.hpp> +#include <CommonAPI/DBus/DBusStubAdapterHelper.hpp> +#include <CommonAPI/DBus/DBusStubAdapter.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { + +typedef CommonAPI::DBus::DBusStubAdapterHelper<ExtendedInterfaceStub> ExtendedInterfaceDBusStubAdapterHelper; + +class ExtendedInterfaceDBusStubAdapterInternal + : public virtual ExtendedInterfaceStubAdapter, + public ExtendedInterfaceDBusStubAdapterHelper, + public TestInterfaceDBusStubAdapterInternal +{ +public: + ExtendedInterfaceDBusStubAdapterInternal( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub); + + ~ExtendedInterfaceDBusStubAdapterInternal(); + + virtual const bool hasFreedesktopProperties(); + + + + + const ExtendedInterfaceDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable(); + const CommonAPI::DBus::StubAttributeTable& getStubAttributeTable(); + + void deactivateManagedInstances(); + + virtual const CommonAPI::Address &getAddress() const { + return DBusStubAdapter::getAddress(); + } + + virtual void init(std::shared_ptr<DBusStubAdapter> instance) { + return ExtendedInterfaceDBusStubAdapterHelper::init(instance); + } + + virtual void deinit() { + return ExtendedInterfaceDBusStubAdapterHelper::deinit(); + } + + virtual bool onInterfaceDBusMessage(const CommonAPI::DBus::DBusMessage& dbusMessage) { + return ExtendedInterfaceDBusStubAdapterHelper::onInterfaceDBusMessage(dbusMessage); + } + + virtual bool onInterfaceDBusFreedesktopPropertiesMessage(const CommonAPI::DBus::DBusMessage& dbusMessage) { + return ExtendedInterfaceDBusStubAdapterHelper::onInterfaceDBusFreedesktopPropertiesMessage(dbusMessage); + } + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ExtendedInterfaceStub, + CommonAPI::Version + > getExtendedInterfaceInterfaceVersionStubDispatcher; + + +#ifdef WIN32 +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ExtendedInterfaceStub, + uint32_t + > getTestPredefinedTypeAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ExtendedInterfaceStub, + uint32_t + > setTestPredefinedTypeAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ExtendedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > getTestDerivedStructAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ExtendedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > setTestDerivedStructAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ExtendedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > getTestDerivedArrayAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ExtendedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > setTestDerivedArrayAttributeAttributeStubDispatcher; +#endif + +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<uint32_t>, + std::tuple<> + > testIntMethodExtendedStubDispatcher; + +#ifdef WIN32 +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<>, + std::tuple<> + > testEmptyMethodStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<uint32_t, std::string>, + std::tuple<> + > testVoidPredefinedTypeMethodStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<uint32_t, std::string>, + std::tuple<uint32_t, std::string> + > testPredefinedTypeMethodStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>, + std::tuple<> + > testVoidDerivedTypeMethodStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>, + std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap> + > testDerivedTypeMethodStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>>>, + std::tuple<> + > testArrayOfPolymorphicStructMethodStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic>, + std::tuple<> + > testMapOfPolymorphicStructMethodStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember>, + std::tuple<> + > testStructWithPolymorphicMemberMethodStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ExtendedInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap>, + std::tuple<> + > testStructWithEnumKeyMapMemberStubDispatcher; +#endif + + +#ifdef WIN32 +static CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher< + ExtendedInterfaceStub, + ExtendedInterfaceStubAdapter, + std::tuple<>, + std::tuple<bool> + > subscribeTestSelectiveBroadcastSelectiveStubDispatcher; + +static CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher< + ExtendedInterfaceStub, + ExtendedInterfaceStubAdapter, + std::tuple<>, + std::tuple<> + > unsubscribeTestSelectiveBroadcastSelectiveStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher< + ExtendedInterfaceStub, + ExtendedInterfaceStubAdapter, + std::tuple<>, + std::tuple<bool> + > subscribeTestBroadcastWithOutArgsSelectiveStubDispatcher; + +static CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher< + ExtendedInterfaceStub, + ExtendedInterfaceStubAdapter, + std::tuple<>, + std::tuple<> + > unsubscribeTestBroadcastWithOutArgsSelectiveStubDispatcher; +#endif + + protected: + virtual const char* getMethodsDBusIntrospectionXmlData() const; + + private: + ExtendedInterfaceDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_; + CommonAPI::DBus::StubAttributeTable stubAttributeTable_; +}; + +class ExtendedInterfaceDBusStubAdapter + : public ExtendedInterfaceDBusStubAdapterInternal, + public std::enable_shared_from_this<ExtendedInterfaceDBusStubAdapter> { +public: + ExtendedInterfaceDBusStubAdapter( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) + : CommonAPI::DBus::DBusStubAdapter( + _address, + _connection, + false), + ExtendedInterfaceDBusStubAdapterInternal( + _address, + _connection, + _stub) { + } +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Extended_Interface_DBUS_STUB_ADAPTER_HPP_ diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusProxy.cpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusProxy.cpp new file mode 100644 index 0000000..ada72a5 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusProxy.cpp @@ -0,0 +1,51 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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/. +*/ +#include <v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusProxy.hpp> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +std::shared_ptr<CommonAPI::DBus::DBusProxy> createTestFreedesktopDerivedInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection) { + return std::make_shared<TestFreedesktopDerivedInterfaceDBusProxy>(_address, _connection); +} + +INITIALIZER(registerTestFreedesktopDerivedInterfaceDBusProxy) { + CommonAPI::DBus::Factory::get()->registerProxyCreateMethod( + TestFreedesktopDerivedInterface::getInterface(), + &createTestFreedesktopDerivedInterfaceDBusProxy); +} + +TestFreedesktopDerivedInterfaceDBusProxy::TestFreedesktopDerivedInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection) + : CommonAPI::DBus::DBusProxy(_address, _connection), + TestFreedesktopInterfaceDBusProxy(_address, _connection) +, testAttributedFromDerivedInterface_(*this, "onTestAttributedFromDerivedInterfaceAttributeChanged", "setTestAttributedFromDerivedInterfaceAttribute", "u", "getTestAttributedFromDerivedInterfaceAttribute") +{ +} + + TestFreedesktopDerivedInterfaceDBusProxy::TestAttributedFromDerivedInterfaceAttribute& TestFreedesktopDerivedInterfaceDBusProxy::getTestAttributedFromDerivedInterfaceAttribute() { + return testAttributedFromDerivedInterface_; + } + + + + + void TestFreedesktopDerivedInterfaceDBusProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const { + ownVersionMajor = 1; + ownVersionMinor = 0; + } + + } // namespace tests + } // namespace commonapi + } // namespace v1_0 diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusProxy.hpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusProxy.hpp new file mode 100644 index 0000000..34f0472 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusProxy.hpp @@ -0,0 +1,62 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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_Freedesktop_Derived_Interface_DBUS_PROXY_HPP_ +#define COMMONAPI_TESTS_Test_Freedesktop_Derived_Interface_DBUS_PROXY_HPP_ + +#include <v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceProxyBase.hpp> +#include <v1_0/commonapi/tests/TestFreedesktopInterfaceDBusProxy.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusAddress.hpp> +#include <CommonAPI/DBus/DBusFactory.hpp> +#include <CommonAPI/DBus/DBusProxy.hpp> +#include <CommonAPI/DBus/DBusAttribute.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +#include <string> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +class TestFreedesktopDerivedInterfaceDBusProxy + : virtual public TestFreedesktopDerivedInterfaceProxyBase, + virtual public TestFreedesktopInterfaceDBusProxy { +public: + TestFreedesktopDerivedInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection); + + virtual ~TestFreedesktopDerivedInterfaceDBusProxy() { } + + virtual TestAttributedFromDerivedInterfaceAttribute& getTestAttributedFromDerivedInterfaceAttribute(); + + + + + virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const; + +private: + + CommonAPI::DBus::DBusObservableAttribute<CommonAPI::DBus::DBusAttribute<TestAttributedFromDerivedInterfaceAttribute>> testAttributedFromDerivedInterface_; + + +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Test_Freedesktop_Derived_Interface_DBUS_PROXY_HPP_ + diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusStubAdapter.cpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusStubAdapter.cpp new file mode 100644 index 0000000..e301425 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusStubAdapter.cpp @@ -0,0 +1,199 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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/. +*/ +#include <v1_0/commonapi/tests/TestFreedesktopDerivedInterface.hpp> +#include <v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusStubAdapter.hpp> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createTestFreedesktopDerivedInterfaceDBusStubAdapter( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) { + return std::make_shared<TestFreedesktopDerivedInterfaceDBusStubAdapter>(_address, _connection, _stub); +} + +INITIALIZER(registerTestFreedesktopDerivedInterfaceDBusStubAdapter) { + CommonAPI::DBus::Factory::get()->registerStubAdapterCreateMethod( + TestFreedesktopDerivedInterface::getInterface(), &createTestFreedesktopDerivedInterfaceDBusStubAdapter); +} + +TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::~TestFreedesktopDerivedInterfaceDBusStubAdapterInternal() { + deactivateManagedInstances(); + TestFreedesktopDerivedInterfaceDBusStubAdapterHelper::deinit(); +} + +void TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::deactivateManagedInstances() { + +} + +const char* TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const { + static const std::string introspectionData = + std::string(TestFreedesktopInterfaceDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData()) + + "<method name=\"getTestAttributedFromDerivedInterfaceAttribute\">\n" + "<arg name=\"value\" type=\"u\" direction=\"out\" />" + "</method>\n" + "<method name=\"setTestAttributedFromDerivedInterfaceAttribute\">\n" + "<arg name=\"requestedValue\" type=\"u\" direction=\"in\" />\n" + "<arg name=\"setValue\" type=\"u\" direction=\"out\" />\n" + "</method>\n" + "<signal name=\"onTestAttributedFromDerivedInterfaceAttributeChanged\">\n" + "<arg name=\"changedValue\" type=\"u\" />\n" + "</signal>\n" + + ; + return introspectionData.c_str(); +} + +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + CommonAPI::Version + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestFreedesktopDerivedInterfaceInterfaceVersionStubDispatcher(&TestFreedesktopDerivedInterfaceStub::getInterfaceVersion, "uu"); + +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestAttributedFromDerivedInterfaceAttributeStubDispatcher(&TestFreedesktopDerivedInterfaceStub::getTestAttributedFromDerivedInterfaceAttribute, "u"); +CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::setTestAttributedFromDerivedInterfaceAttributeStubDispatcher( + &TestFreedesktopDerivedInterfaceStub::getTestAttributedFromDerivedInterfaceAttribute, + &TestFreedesktopDerivedInterfaceStubRemoteEvent::onRemoteSetTestAttributedFromDerivedInterfaceAttribute, + &TestFreedesktopDerivedInterfaceStubRemoteEvent::onRemoteTestAttributedFromDerivedInterfaceAttributeChanged + ,&TestFreedesktopDerivedInterfaceStubAdapter::fireTestAttributedFromDerivedInterfaceAttributeChanged + ,"u" + ); + +#ifdef WIN32 +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestPredefinedTypeAttributeAttributeStubDispatcher(&TestFreedesktopDerivedInterfaceStub::getTestPredefinedTypeAttributeAttribute, "u"); +CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::setTestPredefinedTypeAttributeAttributeStubDispatcher( + &TestFreedesktopDerivedInterfaceStub::getTestPredefinedTypeAttributeAttribute, + &TestFreedesktopDerivedInterfaceStubRemoteEvent::onRemoteSetTestPredefinedTypeAttributeAttribute, + &TestFreedesktopDerivedInterfaceStubRemoteEvent::onRemoteTestPredefinedTypeAttributeAttributeChanged + ,&TestFreedesktopDerivedInterfaceStubAdapter::fireTestPredefinedTypeAttributeAttributeChanged + ,"u" + ); +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestReadonlyAttributeAttributeStubDispatcher(&TestFreedesktopDerivedInterfaceStub::getTestReadonlyAttributeAttribute, "u"); +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestDerivedStructAttributeAttributeStubDispatcher(&TestFreedesktopDerivedInterfaceStub::getTestDerivedStructAttributeAttribute, "(sqi)"); +CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::setTestDerivedStructAttributeAttributeStubDispatcher( + &TestFreedesktopDerivedInterfaceStub::getTestDerivedStructAttributeAttribute, + &TestFreedesktopDerivedInterfaceStubRemoteEvent::onRemoteSetTestDerivedStructAttributeAttribute, + &TestFreedesktopDerivedInterfaceStubRemoteEvent::onRemoteTestDerivedStructAttributeAttributeChanged + ,&TestFreedesktopDerivedInterfaceStubAdapter::fireTestDerivedStructAttributeAttributeChanged + ,"(sqi)" + ); +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestDerivedArrayAttributeAttributeStubDispatcher(&TestFreedesktopDerivedInterfaceStub::getTestDerivedArrayAttributeAttribute, "at"); +CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::setTestDerivedArrayAttributeAttributeStubDispatcher( + &TestFreedesktopDerivedInterfaceStub::getTestDerivedArrayAttributeAttribute, + &TestFreedesktopDerivedInterfaceStubRemoteEvent::onRemoteSetTestDerivedArrayAttributeAttribute, + &TestFreedesktopDerivedInterfaceStubRemoteEvent::onRemoteTestDerivedArrayAttributeAttributeChanged + ,&TestFreedesktopDerivedInterfaceStubAdapter::fireTestDerivedArrayAttributeAttributeChanged + ,"at" + ); +#endif + + +#ifdef WIN32 +#endif + +void TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::fireTestAttributedFromDerivedInterfaceAttributeChanged(const uint32_t& value) { + CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t>> + ::sendSignal( + *this, + "onTestAttributedFromDerivedInterfaceAttributeChanged", + "u", + value + ); +} + + +#ifdef WIN32 +#endif + +const TestFreedesktopDerivedInterfaceDBusStubAdapterHelper::StubDispatcherTable& TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getStubDispatcherTable() { + return stubDispatcherTable_; +} + +const CommonAPI::DBus::StubAttributeTable& TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getStubAttributeTable() { + return stubAttributeTable_; +} + +TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) + : CommonAPI::DBus::DBusStubAdapter(_address, _connection,false), + TestFreedesktopDerivedInterfaceDBusStubAdapterHelper(_address, _connection, std::dynamic_pointer_cast<TestFreedesktopDerivedInterfaceStub>(_stub), false), + TestFreedesktopInterfaceDBusStubAdapterInternal(_address, _connection, _stub), + stubDispatcherTable_({ + { { "getTestAttributedFromDerivedInterfaceAttribute", "" }, &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestAttributedFromDerivedInterfaceAttributeStubDispatcher } + , { { "setTestAttributedFromDerivedInterfaceAttribute", "u" }, &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::setTestAttributedFromDerivedInterfaceAttributeStubDispatcher } + #ifdef WIN32 + , + { { "getTestPredefinedTypeAttributeAttribute", "" }, &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestPredefinedTypeAttributeAttributeStubDispatcher } + , { { "setTestPredefinedTypeAttributeAttribute", "u" }, &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::setTestPredefinedTypeAttributeAttributeStubDispatcher }, + { { "getTestReadonlyAttributeAttribute", "" }, &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestReadonlyAttributeAttributeStubDispatcher }, + { { "getTestDerivedStructAttributeAttribute", "" }, &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestDerivedStructAttributeAttributeStubDispatcher } + , { { "setTestDerivedStructAttributeAttribute", "(sqi)" }, &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::setTestDerivedStructAttributeAttributeStubDispatcher }, + { { "getTestDerivedArrayAttributeAttribute", "" }, &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestDerivedArrayAttributeAttributeStubDispatcher } + , { { "setTestDerivedArrayAttributeAttribute", "at" }, &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::setTestDerivedArrayAttributeAttributeStubDispatcher } + #endif + }), + stubAttributeTable_() { + + #ifdef WIN32 + stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestFreedesktopDerivedInterfaceInterfaceVersionStubDispatcher }); + #else + auto parentDispatcherTable = TestFreedesktopInterfaceDBusStubAdapterInternal::getStubDispatcherTable(); + stubDispatcherTable_.insert(parentDispatcherTable.begin(), parentDispatcherTable.end()); + + auto interfaceVersionGetter = stubDispatcherTable_.find({ "getInterfaceVersion", "" }); + if(interfaceVersionGetter != stubDispatcherTable_.end()) { + interfaceVersionGetter->second = &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestFreedesktopDerivedInterfaceInterfaceVersionStubDispatcher; + } else { + stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestFreedesktopDerivedInterfaceInterfaceVersionStubDispatcher }); + } + + auto parentAttributeTable = TestFreedesktopInterfaceDBusStubAdapterInternal::getStubAttributeTable(); + stubAttributeTable_.insert(parentAttributeTable.begin(), parentAttributeTable.end()); + + #endif +} + +const bool TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::hasFreedesktopProperties() { + return false; +} + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusStubAdapter.hpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusStubAdapter.hpp new file mode 100644 index 0000000..05fd337 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusStubAdapter.hpp @@ -0,0 +1,160 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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_Freedesktop_Derived_Interface_DBUS_STUB_ADAPTER_HPP_ +#define COMMONAPI_TESTS_Test_Freedesktop_Derived_Interface_DBUS_STUB_ADAPTER_HPP_ + +#include <v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceStub.hpp> +#include <v1_0/commonapi/tests/TestFreedesktopInterfaceDBusStubAdapter.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusFactory.hpp> +#include <CommonAPI/DBus/DBusStubAdapterHelper.hpp> +#include <CommonAPI/DBus/DBusStubAdapter.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { + +typedef CommonAPI::DBus::DBusStubAdapterHelper<TestFreedesktopDerivedInterfaceStub> TestFreedesktopDerivedInterfaceDBusStubAdapterHelper; + +class TestFreedesktopDerivedInterfaceDBusStubAdapterInternal + : public virtual TestFreedesktopDerivedInterfaceStubAdapter, + public TestFreedesktopDerivedInterfaceDBusStubAdapterHelper, + public TestFreedesktopInterfaceDBusStubAdapterInternal +{ +public: + TestFreedesktopDerivedInterfaceDBusStubAdapterInternal( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub); + + ~TestFreedesktopDerivedInterfaceDBusStubAdapterInternal(); + + virtual const bool hasFreedesktopProperties(); + + void fireTestAttributedFromDerivedInterfaceAttributeChanged(const uint32_t& value); + + + + const TestFreedesktopDerivedInterfaceDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable(); + const CommonAPI::DBus::StubAttributeTable& getStubAttributeTable(); + + void deactivateManagedInstances(); + + virtual const CommonAPI::Address &getAddress() const { + return DBusStubAdapter::getAddress(); + } + + virtual void init(std::shared_ptr<DBusStubAdapter> instance) { + return TestFreedesktopDerivedInterfaceDBusStubAdapterHelper::init(instance); + } + + virtual void deinit() { + return TestFreedesktopDerivedInterfaceDBusStubAdapterHelper::deinit(); + } + + virtual bool onInterfaceDBusMessage(const CommonAPI::DBus::DBusMessage& dbusMessage) { + return TestFreedesktopDerivedInterfaceDBusStubAdapterHelper::onInterfaceDBusMessage(dbusMessage); + } + + virtual bool onInterfaceDBusFreedesktopPropertiesMessage(const CommonAPI::DBus::DBusMessage& dbusMessage) { + return TestFreedesktopDerivedInterfaceDBusStubAdapterHelper::onInterfaceDBusFreedesktopPropertiesMessage(dbusMessage); + } + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + CommonAPI::Version + > getTestFreedesktopDerivedInterfaceInterfaceVersionStubDispatcher; + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > getTestAttributedFromDerivedInterfaceAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > setTestAttributedFromDerivedInterfaceAttributeStubDispatcher; + +#ifdef WIN32 +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > getTestPredefinedTypeAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > setTestPredefinedTypeAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > getTestReadonlyAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > getTestDerivedStructAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > setTestDerivedStructAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > getTestDerivedArrayAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > setTestDerivedArrayAttributeAttributeStubDispatcher; +#endif + + +#ifdef WIN32 +#endif + + +#ifdef WIN32 +#endif + + protected: + virtual const char* getMethodsDBusIntrospectionXmlData() const; + + private: + TestFreedesktopDerivedInterfaceDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_; + CommonAPI::DBus::StubAttributeTable stubAttributeTable_; +}; + +class TestFreedesktopDerivedInterfaceDBusStubAdapter + : public TestFreedesktopDerivedInterfaceDBusStubAdapterInternal, + public std::enable_shared_from_this<TestFreedesktopDerivedInterfaceDBusStubAdapter> { +public: + TestFreedesktopDerivedInterfaceDBusStubAdapter( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) + : CommonAPI::DBus::DBusStubAdapter( + _address, + _connection, + false), + TestFreedesktopDerivedInterfaceDBusStubAdapterInternal( + _address, + _connection, + _stub) { + } +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Test_Freedesktop_Derived_Interface_DBUS_STUB_ADAPTER_HPP_ diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusProxy.cpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusProxy.cpp new file mode 100644 index 0000000..2fe18ce --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusProxy.cpp @@ -0,0 +1,62 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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/. +*/ +#include <v1_0/commonapi/tests/TestFreedesktopInterfaceDBusProxy.hpp> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +std::shared_ptr<CommonAPI::DBus::DBusProxy> createTestFreedesktopInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection) { + return std::make_shared<TestFreedesktopInterfaceDBusProxy>(_address, _connection); +} + +INITIALIZER(registerTestFreedesktopInterfaceDBusProxy) { + CommonAPI::DBus::Factory::get()->registerProxyCreateMethod( + TestFreedesktopInterface::getInterface(), + &createTestFreedesktopInterfaceDBusProxy); +} + +TestFreedesktopInterfaceDBusProxy::TestFreedesktopInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection) + : CommonAPI::DBus::DBusProxy(_address, _connection) +, testPredefinedTypeAttribute_(*this, "onTestPredefinedTypeAttributeAttributeChanged", "setTestPredefinedTypeAttributeAttribute", "u", "getTestPredefinedTypeAttributeAttribute"), + testReadonlyAttribute_(*this, "onTestReadonlyAttributeAttributeChanged", "u", "getTestReadonlyAttributeAttribute"), + testDerivedStructAttribute_(*this, "onTestDerivedStructAttributeAttributeChanged", "setTestDerivedStructAttributeAttribute", "(sqi)", "getTestDerivedStructAttributeAttribute"), + testDerivedArrayAttribute_(*this, "onTestDerivedArrayAttributeAttributeChanged", "setTestDerivedArrayAttributeAttribute", "at", "getTestDerivedArrayAttributeAttribute") +{ +} + + TestFreedesktopInterfaceDBusProxy::TestPredefinedTypeAttributeAttribute& TestFreedesktopInterfaceDBusProxy::getTestPredefinedTypeAttributeAttribute() { + return testPredefinedTypeAttribute_; + } + TestFreedesktopInterfaceDBusProxy::TestReadonlyAttributeAttribute& TestFreedesktopInterfaceDBusProxy::getTestReadonlyAttributeAttribute() { + return testReadonlyAttribute_; + } + TestFreedesktopInterfaceDBusProxy::TestDerivedStructAttributeAttribute& TestFreedesktopInterfaceDBusProxy::getTestDerivedStructAttributeAttribute() { + return testDerivedStructAttribute_; + } + TestFreedesktopInterfaceDBusProxy::TestDerivedArrayAttributeAttribute& TestFreedesktopInterfaceDBusProxy::getTestDerivedArrayAttributeAttribute() { + return testDerivedArrayAttribute_; + } + + + + + void TestFreedesktopInterfaceDBusProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const { + ownVersionMajor = 1; + ownVersionMinor = 0; + } + + } // namespace tests + } // namespace commonapi + } // namespace v1_0 diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusProxy.hpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusProxy.hpp new file mode 100644 index 0000000..d041c8f --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusProxy.hpp @@ -0,0 +1,67 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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_Freedesktop_Interface_DBUS_PROXY_HPP_ +#define COMMONAPI_TESTS_Test_Freedesktop_Interface_DBUS_PROXY_HPP_ + +#include <v1_0/commonapi/tests/TestFreedesktopInterfaceProxyBase.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusAddress.hpp> +#include <CommonAPI/DBus/DBusFactory.hpp> +#include <CommonAPI/DBus/DBusProxy.hpp> +#include <CommonAPI/DBus/DBusAttribute.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +#include <string> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +class TestFreedesktopInterfaceDBusProxy + : virtual public TestFreedesktopInterfaceProxyBase, + virtual public CommonAPI::DBus::DBusProxy { +public: + TestFreedesktopInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection); + + virtual ~TestFreedesktopInterfaceDBusProxy() { } + + virtual TestPredefinedTypeAttributeAttribute& getTestPredefinedTypeAttributeAttribute(); + virtual TestReadonlyAttributeAttribute& getTestReadonlyAttributeAttribute(); + virtual TestDerivedStructAttributeAttribute& getTestDerivedStructAttributeAttribute(); + virtual TestDerivedArrayAttributeAttribute& getTestDerivedArrayAttributeAttribute(); + + + + + virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const; + +private: + + CommonAPI::DBus::DBusObservableAttribute<CommonAPI::DBus::DBusAttribute<TestPredefinedTypeAttributeAttribute>> testPredefinedTypeAttribute_; + CommonAPI::DBus::DBusObservableAttribute<CommonAPI::DBus::DBusReadonlyAttribute<TestReadonlyAttributeAttribute>> testReadonlyAttribute_; + CommonAPI::DBus::DBusObservableAttribute<CommonAPI::DBus::DBusAttribute<TestDerivedStructAttributeAttribute>> testDerivedStructAttribute_; + CommonAPI::DBus::DBusObservableAttribute<CommonAPI::DBus::DBusAttribute<TestDerivedArrayAttributeAttribute>> testDerivedArrayAttribute_; + + +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Test_Freedesktop_Interface_DBUS_PROXY_HPP_ + diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusStubAdapter.cpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusStubAdapter.cpp new file mode 100644 index 0000000..2f1258c --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusStubAdapter.cpp @@ -0,0 +1,212 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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/. +*/ +#include <v1_0/commonapi/tests/TestFreedesktopInterface.hpp> +#include <v1_0/commonapi/tests/TestFreedesktopInterfaceDBusStubAdapter.hpp> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createTestFreedesktopInterfaceDBusStubAdapter( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) { + return std::make_shared<TestFreedesktopInterfaceDBusStubAdapter>(_address, _connection, _stub); +} + +INITIALIZER(registerTestFreedesktopInterfaceDBusStubAdapter) { + CommonAPI::DBus::Factory::get()->registerStubAdapterCreateMethod( + TestFreedesktopInterface::getInterface(), &createTestFreedesktopInterfaceDBusStubAdapter); +} + +TestFreedesktopInterfaceDBusStubAdapterInternal::~TestFreedesktopInterfaceDBusStubAdapterInternal() { + deactivateManagedInstances(); + TestFreedesktopInterfaceDBusStubAdapterHelper::deinit(); +} + +void TestFreedesktopInterfaceDBusStubAdapterInternal::deactivateManagedInstances() { + +} + +const char* TestFreedesktopInterfaceDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const { + static const std::string 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" + "<method name=\"setTestPredefinedTypeAttributeAttribute\">\n" + "<arg name=\"requestedValue\" type=\"u\" direction=\"in\" />\n" + "<arg name=\"setValue\" type=\"u\" direction=\"out\" />\n" + "</method>\n" + "<signal name=\"onTestPredefinedTypeAttributeAttributeChanged\">\n" + "<arg name=\"changedValue\" type=\"u\" />\n" + "</signal>\n" + "<method name=\"getTestReadonlyAttributeAttribute\">\n" + "<arg name=\"value\" type=\"u\" direction=\"out\" />" + "</method>\n" + "<signal name=\"onTestReadonlyAttributeAttributeChanged\">\n" + "<arg name=\"changedValue\" type=\"u\" />\n" + "</signal>\n" + "<method name=\"getTestDerivedStructAttributeAttribute\">\n" + "<arg name=\"value\" type=\"(sqi)\" direction=\"out\" />" + "</method>\n" + "<method name=\"setTestDerivedStructAttributeAttribute\">\n" + "<arg name=\"requestedValue\" type=\"(sqi)\" direction=\"in\" />\n" + "<arg name=\"setValue\" type=\"(sqi)\" direction=\"out\" />\n" + "</method>\n" + "<signal name=\"onTestDerivedStructAttributeAttributeChanged\">\n" + "<arg name=\"changedValue\" type=\"(sqi)\" />\n" + "</signal>\n" + "<method name=\"getTestDerivedArrayAttributeAttribute\">\n" + "<arg name=\"value\" type=\"at\" direction=\"out\" />" + "</method>\n" + "<method name=\"setTestDerivedArrayAttributeAttribute\">\n" + "<arg name=\"requestedValue\" type=\"at\" direction=\"in\" />\n" + "<arg name=\"setValue\" type=\"at\" direction=\"out\" />\n" + "</method>\n" + "<signal name=\"onTestDerivedArrayAttributeAttributeChanged\">\n" + "<arg name=\"changedValue\" type=\"at\" />\n" + "</signal>\n" + + ; + return introspectionData.c_str(); +} + +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + CommonAPI::Version + > TestFreedesktopInterfaceDBusStubAdapterInternal::getTestFreedesktopInterfaceInterfaceVersionStubDispatcher(&TestFreedesktopInterfaceStub::getInterfaceVersion, "uu"); + +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + uint32_t + > TestFreedesktopInterfaceDBusStubAdapterInternal::getTestPredefinedTypeAttributeAttributeStubDispatcher(&TestFreedesktopInterfaceStub::getTestPredefinedTypeAttributeAttribute, "u"); +CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + uint32_t + > TestFreedesktopInterfaceDBusStubAdapterInternal::setTestPredefinedTypeAttributeAttributeStubDispatcher( + &TestFreedesktopInterfaceStub::getTestPredefinedTypeAttributeAttribute, + &TestFreedesktopInterfaceStubRemoteEvent::onRemoteSetTestPredefinedTypeAttributeAttribute, + &TestFreedesktopInterfaceStubRemoteEvent::onRemoteTestPredefinedTypeAttributeAttributeChanged + ,&TestFreedesktopInterfaceStubAdapter::fireTestPredefinedTypeAttributeAttributeChanged + ,"u" + ); +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + uint32_t + > TestFreedesktopInterfaceDBusStubAdapterInternal::getTestReadonlyAttributeAttributeStubDispatcher(&TestFreedesktopInterfaceStub::getTestReadonlyAttributeAttribute, "u"); +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > TestFreedesktopInterfaceDBusStubAdapterInternal::getTestDerivedStructAttributeAttributeStubDispatcher(&TestFreedesktopInterfaceStub::getTestDerivedStructAttributeAttribute, "(sqi)"); +CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > TestFreedesktopInterfaceDBusStubAdapterInternal::setTestDerivedStructAttributeAttributeStubDispatcher( + &TestFreedesktopInterfaceStub::getTestDerivedStructAttributeAttribute, + &TestFreedesktopInterfaceStubRemoteEvent::onRemoteSetTestDerivedStructAttributeAttribute, + &TestFreedesktopInterfaceStubRemoteEvent::onRemoteTestDerivedStructAttributeAttributeChanged + ,&TestFreedesktopInterfaceStubAdapter::fireTestDerivedStructAttributeAttributeChanged + ,"(sqi)" + ); +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > TestFreedesktopInterfaceDBusStubAdapterInternal::getTestDerivedArrayAttributeAttributeStubDispatcher(&TestFreedesktopInterfaceStub::getTestDerivedArrayAttributeAttribute, "at"); +CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > TestFreedesktopInterfaceDBusStubAdapterInternal::setTestDerivedArrayAttributeAttributeStubDispatcher( + &TestFreedesktopInterfaceStub::getTestDerivedArrayAttributeAttribute, + &TestFreedesktopInterfaceStubRemoteEvent::onRemoteSetTestDerivedArrayAttributeAttribute, + &TestFreedesktopInterfaceStubRemoteEvent::onRemoteTestDerivedArrayAttributeAttributeChanged + ,&TestFreedesktopInterfaceStubAdapter::fireTestDerivedArrayAttributeAttributeChanged + ,"at" + ); + + + + +void TestFreedesktopInterfaceDBusStubAdapterInternal::fireTestPredefinedTypeAttributeAttributeChanged(const uint32_t& value) { + CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t>> + ::sendSignal( + *this, + "onTestPredefinedTypeAttributeAttributeChanged", + "u", + value + ); +} +void TestFreedesktopInterfaceDBusStubAdapterInternal::fireTestReadonlyAttributeAttributeChanged(const uint32_t& value) { + CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t>> + ::sendSignal( + *this, + "onTestReadonlyAttributeAttributeChanged", + "u", + value + ); +} +void TestFreedesktopInterfaceDBusStubAdapterInternal::fireTestDerivedStructAttributeAttributeChanged(const ::commonapi::tests::DerivedTypeCollection::TestStructExtended& value) { + CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::TestStructExtended>> + ::sendSignal( + *this, + "onTestDerivedStructAttributeAttributeChanged", + "(sqi)", + value + ); +} +void TestFreedesktopInterfaceDBusStubAdapterInternal::fireTestDerivedArrayAttributeAttributeChanged(const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64& value) { + CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::TestArrayUInt64>> + ::sendSignal( + *this, + "onTestDerivedArrayAttributeAttributeChanged", + "at", + value + ); +} + + + +const TestFreedesktopInterfaceDBusStubAdapterHelper::StubDispatcherTable& TestFreedesktopInterfaceDBusStubAdapterInternal::getStubDispatcherTable() { + return stubDispatcherTable_; +} + +const CommonAPI::DBus::StubAttributeTable& TestFreedesktopInterfaceDBusStubAdapterInternal::getStubAttributeTable() { + return stubAttributeTable_; +} + +TestFreedesktopInterfaceDBusStubAdapterInternal::TestFreedesktopInterfaceDBusStubAdapterInternal( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) + : CommonAPI::DBus::DBusStubAdapter(_address, _connection,false), + TestFreedesktopInterfaceDBusStubAdapterHelper(_address, _connection, std::dynamic_pointer_cast<TestFreedesktopInterfaceStub>(_stub), false), + stubDispatcherTable_({ + { { "getTestPredefinedTypeAttributeAttribute", "" }, &commonapi::tests::TestFreedesktopInterfaceDBusStubAdapterInternal::getTestPredefinedTypeAttributeAttributeStubDispatcher } + , { { "setTestPredefinedTypeAttributeAttribute", "u" }, &commonapi::tests::TestFreedesktopInterfaceDBusStubAdapterInternal::setTestPredefinedTypeAttributeAttributeStubDispatcher }, + { { "getTestReadonlyAttributeAttribute", "" }, &commonapi::tests::TestFreedesktopInterfaceDBusStubAdapterInternal::getTestReadonlyAttributeAttributeStubDispatcher }, + { { "getTestDerivedStructAttributeAttribute", "" }, &commonapi::tests::TestFreedesktopInterfaceDBusStubAdapterInternal::getTestDerivedStructAttributeAttributeStubDispatcher } + , { { "setTestDerivedStructAttributeAttribute", "(sqi)" }, &commonapi::tests::TestFreedesktopInterfaceDBusStubAdapterInternal::setTestDerivedStructAttributeAttributeStubDispatcher }, + { { "getTestDerivedArrayAttributeAttribute", "" }, &commonapi::tests::TestFreedesktopInterfaceDBusStubAdapterInternal::getTestDerivedArrayAttributeAttributeStubDispatcher } + , { { "setTestDerivedArrayAttributeAttribute", "at" }, &commonapi::tests::TestFreedesktopInterfaceDBusStubAdapterInternal::setTestDerivedArrayAttributeAttributeStubDispatcher } + }), + stubAttributeTable_() { + + stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &commonapi::tests::TestFreedesktopInterfaceDBusStubAdapterInternal::getTestFreedesktopInterfaceInterfaceVersionStubDispatcher }); +} + +const bool TestFreedesktopInterfaceDBusStubAdapterInternal::hasFreedesktopProperties() { + return false; +} + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusStubAdapter.hpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusStubAdapter.hpp new file mode 100644 index 0000000..5c165b3 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusStubAdapter.hpp @@ -0,0 +1,128 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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_Freedesktop_Interface_DBUS_STUB_ADAPTER_HPP_ +#define COMMONAPI_TESTS_Test_Freedesktop_Interface_DBUS_STUB_ADAPTER_HPP_ + +#include <v1_0/commonapi/tests/TestFreedesktopInterfaceStub.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusFactory.hpp> +#include <CommonAPI/DBus/DBusStubAdapterHelper.hpp> +#include <CommonAPI/DBus/DBusStubAdapter.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { + +typedef CommonAPI::DBus::DBusStubAdapterHelper<TestFreedesktopInterfaceStub> TestFreedesktopInterfaceDBusStubAdapterHelper; + +class TestFreedesktopInterfaceDBusStubAdapterInternal + : public virtual TestFreedesktopInterfaceStubAdapter, + public TestFreedesktopInterfaceDBusStubAdapterHelper +{ +public: + TestFreedesktopInterfaceDBusStubAdapterInternal( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub); + + ~TestFreedesktopInterfaceDBusStubAdapterInternal(); + + virtual const bool hasFreedesktopProperties(); + + void fireTestPredefinedTypeAttributeAttributeChanged(const uint32_t& value); + void fireTestReadonlyAttributeAttributeChanged(const uint32_t& value); + void fireTestDerivedStructAttributeAttributeChanged(const ::commonapi::tests::DerivedTypeCollection::TestStructExtended& value); + void fireTestDerivedArrayAttributeAttributeChanged(const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64& value); + + + + const TestFreedesktopInterfaceDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable(); + const CommonAPI::DBus::StubAttributeTable& getStubAttributeTable(); + + void deactivateManagedInstances(); + + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + CommonAPI::Version + > getTestFreedesktopInterfaceInterfaceVersionStubDispatcher; + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + uint32_t + > getTestPredefinedTypeAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + uint32_t + > setTestPredefinedTypeAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + uint32_t + > getTestReadonlyAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > getTestDerivedStructAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > setTestDerivedStructAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > getTestDerivedArrayAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > setTestDerivedArrayAttributeAttributeStubDispatcher; + + + + + + + protected: + virtual const char* getMethodsDBusIntrospectionXmlData() const; + + private: + TestFreedesktopInterfaceDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_; + CommonAPI::DBus::StubAttributeTable stubAttributeTable_; +}; + +class TestFreedesktopInterfaceDBusStubAdapter + : public TestFreedesktopInterfaceDBusStubAdapterInternal, + public std::enable_shared_from_this<TestFreedesktopInterfaceDBusStubAdapter> { +public: + TestFreedesktopInterfaceDBusStubAdapter( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) + : CommonAPI::DBus::DBusStubAdapter( + _address, + _connection, + false), + TestFreedesktopInterfaceDBusStubAdapterInternal( + _address, + _connection, + _stub) { + } +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Test_Freedesktop_Interface_DBUS_STUB_ADAPTER_HPP_ diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/TestInterfaceDBusProxy.cpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestInterfaceDBusProxy.cpp new file mode 100644 index 0000000..b202588 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestInterfaceDBusProxy.cpp @@ -0,0 +1,266 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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/. +*/ +#include <v1_0/commonapi/tests/TestInterfaceDBusProxy.hpp> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +std::shared_ptr<CommonAPI::DBus::DBusProxy> createTestInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection) { + return std::make_shared<TestInterfaceDBusProxy>(_address, _connection); +} + +INITIALIZER(registerTestInterfaceDBusProxy) { + CommonAPI::DBus::Factory::get()->registerProxyCreateMethod( + TestInterface::getInterface(), + &createTestInterfaceDBusProxy); +} + +TestInterfaceDBusProxy::TestInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection) + : CommonAPI::DBus::DBusProxy(_address, _connection) +, testPredefinedTypeAttribute_(*this, "onTestPredefinedTypeAttributeAttributeChanged", "setTestPredefinedTypeAttributeAttribute", "u", "getTestPredefinedTypeAttributeAttribute"), + testDerivedStructAttribute_(*this, "onTestDerivedStructAttributeAttributeChanged", "setTestDerivedStructAttributeAttribute", "(sqi)", "getTestDerivedStructAttributeAttribute"), + testDerivedArrayAttribute_(*this, "onTestDerivedArrayAttributeAttributeChanged", "setTestDerivedArrayAttributeAttribute", "at", "getTestDerivedArrayAttributeAttribute") +, testPredefinedTypeBroadcast_(*this, "TestPredefinedTypeBroadcast", "us", std::tuple<uint32_t, std::string>()), + testSelectiveBroadcastSelective_(*this, "TestSelectiveBroadcast", "", std::tuple<>()), + testBroadcastWithOutArgsSelective_(*this, "TestBroadcastWithOutArgs", "us", std::tuple<uint32_t, std::string>()) +{ +} + + TestInterfaceDBusProxy::TestPredefinedTypeAttributeAttribute& TestInterfaceDBusProxy::getTestPredefinedTypeAttributeAttribute() { + return testPredefinedTypeAttribute_; + } + TestInterfaceDBusProxy::TestDerivedStructAttributeAttribute& TestInterfaceDBusProxy::getTestDerivedStructAttributeAttribute() { + return testDerivedStructAttribute_; + } + TestInterfaceDBusProxy::TestDerivedArrayAttributeAttribute& TestInterfaceDBusProxy::getTestDerivedArrayAttributeAttribute() { + return testDerivedArrayAttribute_; + } + + TestInterfaceDBusProxy::TestPredefinedTypeBroadcastEvent& TestInterfaceDBusProxy::getTestPredefinedTypeBroadcastEvent() { + return testPredefinedTypeBroadcast_; + } + TestInterfaceDBusProxy::TestSelectiveBroadcastSelectiveEvent& TestInterfaceDBusProxy::getTestSelectiveBroadcastSelectiveEvent() { + return testSelectiveBroadcastSelective_; + } + TestInterfaceDBusProxy::TestBroadcastWithOutArgsSelectiveEvent& TestInterfaceDBusProxy::getTestBroadcastWithOutArgsSelectiveEvent() { + return testBroadcastWithOutArgsSelective_; + } + + void TestInterfaceDBusProxy::testEmptyMethod(CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodWithReply( + *this, + "testEmptyMethod", + "", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _status + ); + } + std::future<CommonAPI::CallStatus> TestInterfaceDBusProxy::testEmptyMethodAsync(TestEmptyMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodAsync( + *this, + "testEmptyMethod", + "", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + std::move(_callback), + std::tuple<>()); + } + void TestInterfaceDBusProxy::testVoidPredefinedTypeMethod(const uint32_t &_uint32Value, const std::string &_stringValue, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t, std::string>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodWithReply( + *this, + "testVoidPredefinedTypeMethod", + "us", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _uint32Value, _stringValue, + _status + ); + } + std::future<CommonAPI::CallStatus> TestInterfaceDBusProxy::testVoidPredefinedTypeMethodAsync(const uint32_t &_uint32Value, const std::string &_stringValue, TestVoidPredefinedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t, std::string>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodAsync( + *this, + "testVoidPredefinedTypeMethod", + "us", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _uint32Value, _stringValue, + std::move(_callback), + std::tuple<>()); + } + void TestInterfaceDBusProxy::testPredefinedTypeMethod(const uint32_t &_uint32InValue, const std::string &_stringInValue, CommonAPI::CallStatus &_status, uint32_t &_uint32OutValue, std::string &_stringOutValue, const CommonAPI::CallInfo *_info) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t, std::string>, + CommonAPI::DBus::DBusSerializableArguments<uint32_t, std::string> >::callMethodWithReply( + *this, + "testPredefinedTypeMethod", + "us", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _uint32InValue, _stringInValue, + _status + , _uint32OutValue, _stringOutValue); + } + std::future<CommonAPI::CallStatus> TestInterfaceDBusProxy::testPredefinedTypeMethodAsync(const uint32_t &_uint32InValue, const std::string &_stringInValue, TestPredefinedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t, std::string>, + CommonAPI::DBus::DBusSerializableArguments<uint32_t, std::string> >::callMethodAsync( + *this, + "testPredefinedTypeMethod", + "us", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _uint32InValue, _stringInValue, + std::move(_callback), + std::tuple<uint32_t, std::string>()); + } + void TestInterfaceDBusProxy::testVoidDerivedTypeMethod(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2Value, const ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapValue, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodWithReply( + *this, + "testVoidDerivedTypeMethod", + "ia{ua(sq)}", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _testEnumExtended2Value, _testMapValue, + _status + ); + } + std::future<CommonAPI::CallStatus> TestInterfaceDBusProxy::testVoidDerivedTypeMethodAsync(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2Value, const ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapValue, TestVoidDerivedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodAsync( + *this, + "testVoidDerivedTypeMethod", + "ia{ua(sq)}", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _testEnumExtended2Value, _testMapValue, + std::move(_callback), + std::tuple<>()); + } + void TestInterfaceDBusProxy::testDerivedTypeMethod(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2InValue, const ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapInValue, CommonAPI::CallStatus &_status, ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2OutValue, ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapOutValue, const CommonAPI::CallInfo *_info) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>, + CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap> >::callMethodWithReply( + *this, + "testDerivedTypeMethod", + "ia{ua(sq)}", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _testEnumExtended2InValue, _testMapInValue, + _status + , _testEnumExtended2OutValue, _testMapOutValue); + } + std::future<CommonAPI::CallStatus> TestInterfaceDBusProxy::testDerivedTypeMethodAsync(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2InValue, const ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapInValue, TestDerivedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>, + CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap> >::callMethodAsync( + *this, + "testDerivedTypeMethod", + "ia{ua(sq)}", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _testEnumExtended2InValue, _testMapInValue, + std::move(_callback), + std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>()); + } + void TestInterfaceDBusProxy::TestArrayOfPolymorphicStructMethod(const std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>> &_inArray, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>>>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodWithReply( + *this, + "TestArrayOfPolymorphicStructMethod", + "a(uv)", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _inArray, + _status + ); + } + std::future<CommonAPI::CallStatus> TestInterfaceDBusProxy::TestArrayOfPolymorphicStructMethodAsync(const std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>> &_inArray, TestArrayOfPolymorphicStructMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>>>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodAsync( + *this, + "TestArrayOfPolymorphicStructMethod", + "a(uv)", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _inArray, + std::move(_callback), + std::tuple<>()); + } + void TestInterfaceDBusProxy::TestMapOfPolymorphicStructMethod(const ::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic &_inMap, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodWithReply( + *this, + "TestMapOfPolymorphicStructMethod", + "a{y(uv)}", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _inMap, + _status + ); + } + std::future<CommonAPI::CallStatus> TestInterfaceDBusProxy::TestMapOfPolymorphicStructMethodAsync(const ::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic &_inMap, TestMapOfPolymorphicStructMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodAsync( + *this, + "TestMapOfPolymorphicStructMethod", + "a{y(uv)}", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _inMap, + std::move(_callback), + std::tuple<>()); + } + void TestInterfaceDBusProxy::TestStructWithPolymorphicMemberMethod(const ::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember &_inStruct, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodWithReply( + *this, + "TestStructWithPolymorphicMemberMethod", + "(u(uv))", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _inStruct, + _status + ); + } + std::future<CommonAPI::CallStatus> TestInterfaceDBusProxy::TestStructWithPolymorphicMemberMethodAsync(const ::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember &_inStruct, TestStructWithPolymorphicMemberMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodAsync( + *this, + "TestStructWithPolymorphicMemberMethod", + "(u(uv))", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _inStruct, + std::move(_callback), + std::tuple<>()); + } + void TestInterfaceDBusProxy::TestStructWithEnumKeyMapMember(const ::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap &_inStruct, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodWithReply( + *this, + "TestStructWithEnumKeyMapMember", + "(a{is})", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _inStruct, + _status + ); + } + std::future<CommonAPI::CallStatus> TestInterfaceDBusProxy::TestStructWithEnumKeyMapMemberAsync(const ::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap &_inStruct, TestStructWithEnumKeyMapMemberAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodAsync( + *this, + "TestStructWithEnumKeyMapMember", + "(a{is})", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _inStruct, + std::move(_callback), + std::tuple<>()); + } + + + void TestInterfaceDBusProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const { + ownVersionMajor = 1; + ownVersionMinor = 0; + } + + } // namespace tests + } // namespace commonapi + } // namespace v1_0 diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/TestInterfaceDBusProxy.hpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestInterfaceDBusProxy.hpp new file mode 100644 index 0000000..8ed6873 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestInterfaceDBusProxy.hpp @@ -0,0 +1,92 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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_HPP_ +#define COMMONAPI_TESTS_Test_Interface_DBUS_PROXY_HPP_ + +#include <v1_0/commonapi/tests/TestInterfaceProxyBase.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusAddress.hpp> +#include <CommonAPI/DBus/DBusFactory.hpp> +#include <CommonAPI/DBus/DBusProxy.hpp> +#include <CommonAPI/DBus/DBusAttribute.hpp> +#include <CommonAPI/DBus/DBusEvent.hpp> +#include <CommonAPI/Types.hpp> +#include <CommonAPI/DBus/DBusSelectiveEvent.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +#include <string> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +class TestInterfaceDBusProxy + : virtual public TestInterfaceProxyBase, + virtual public CommonAPI::DBus::DBusProxy { +public: + TestInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection); + + virtual ~TestInterfaceDBusProxy() { } + + virtual TestPredefinedTypeAttributeAttribute& getTestPredefinedTypeAttributeAttribute(); + virtual TestDerivedStructAttributeAttribute& getTestDerivedStructAttributeAttribute(); + virtual TestDerivedArrayAttributeAttribute& getTestDerivedArrayAttributeAttribute(); + + virtual TestPredefinedTypeBroadcastEvent& getTestPredefinedTypeBroadcastEvent(); + virtual TestSelectiveBroadcastSelectiveEvent& getTestSelectiveBroadcastSelectiveEvent(); + virtual TestBroadcastWithOutArgsSelectiveEvent& getTestBroadcastWithOutArgsSelectiveEvent(); + + virtual void testEmptyMethod(CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info); + virtual std::future<CommonAPI::CallStatus> testEmptyMethodAsync(TestEmptyMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info); + virtual void testVoidPredefinedTypeMethod(const uint32_t &_uint32Value, const std::string &_stringValue, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info); + virtual std::future<CommonAPI::CallStatus> testVoidPredefinedTypeMethodAsync(const uint32_t &_uint32Value, const std::string &_stringValue, TestVoidPredefinedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info); + virtual void testPredefinedTypeMethod(const uint32_t &_uint32InValue, const std::string &_stringInValue, CommonAPI::CallStatus &_status, uint32_t &_uint32OutValue, std::string &_stringOutValue, const CommonAPI::CallInfo *_info); + virtual std::future<CommonAPI::CallStatus> testPredefinedTypeMethodAsync(const uint32_t &_uint32InValue, const std::string &_stringInValue, TestPredefinedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info); + virtual void testVoidDerivedTypeMethod(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2Value, const ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapValue, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info); + virtual std::future<CommonAPI::CallStatus> testVoidDerivedTypeMethodAsync(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2Value, const ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapValue, TestVoidDerivedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info); + virtual void testDerivedTypeMethod(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2InValue, const ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapInValue, CommonAPI::CallStatus &_status, ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2OutValue, ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapOutValue, const CommonAPI::CallInfo *_info); + virtual std::future<CommonAPI::CallStatus> testDerivedTypeMethodAsync(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2InValue, const ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapInValue, TestDerivedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info); + virtual void TestArrayOfPolymorphicStructMethod(const std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>> &_inArray, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info); + virtual std::future<CommonAPI::CallStatus> TestArrayOfPolymorphicStructMethodAsync(const std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>> &_inArray, TestArrayOfPolymorphicStructMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info); + virtual void TestMapOfPolymorphicStructMethod(const ::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic &_inMap, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info); + virtual std::future<CommonAPI::CallStatus> TestMapOfPolymorphicStructMethodAsync(const ::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic &_inMap, TestMapOfPolymorphicStructMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info); + virtual void TestStructWithPolymorphicMemberMethod(const ::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember &_inStruct, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info); + virtual std::future<CommonAPI::CallStatus> TestStructWithPolymorphicMemberMethodAsync(const ::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember &_inStruct, TestStructWithPolymorphicMemberMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info); + virtual void TestStructWithEnumKeyMapMember(const ::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap &_inStruct, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info); + virtual std::future<CommonAPI::CallStatus> TestStructWithEnumKeyMapMemberAsync(const ::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap &_inStruct, TestStructWithEnumKeyMapMemberAsyncCallback _callback, const CommonAPI::CallInfo *_info); + + + virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const; + +private: + + CommonAPI::DBus::DBusObservableAttribute<CommonAPI::DBus::DBusAttribute<TestPredefinedTypeAttributeAttribute>> testPredefinedTypeAttribute_; + CommonAPI::DBus::DBusObservableAttribute<CommonAPI::DBus::DBusAttribute<TestDerivedStructAttributeAttribute>> testDerivedStructAttribute_; + CommonAPI::DBus::DBusObservableAttribute<CommonAPI::DBus::DBusAttribute<TestDerivedArrayAttributeAttribute>> testDerivedArrayAttribute_; + + CommonAPI::DBus::DBusEvent<TestPredefinedTypeBroadcastEvent, uint32_t, std::string> testPredefinedTypeBroadcast_; + CommonAPI::DBus::DBusSelectiveEvent<TestSelectiveBroadcastSelectiveEvent> testSelectiveBroadcastSelective_; + CommonAPI::DBus::DBusSelectiveEvent<TestBroadcastWithOutArgsSelectiveEvent, uint32_t, std::string> testBroadcastWithOutArgsSelective_; + +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Test_Interface_DBUS_PROXY_HPP_ + diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/TestInterfaceDBusStubAdapter.cpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestInterfaceDBusStubAdapter.cpp new file mode 100644 index 0000000..c237cd6 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestInterfaceDBusStubAdapter.cpp @@ -0,0 +1,436 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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/. +*/ +#include <v1_0/commonapi/tests/TestInterface.hpp> +#include <v1_0/commonapi/tests/TestInterfaceDBusStubAdapter.hpp> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createTestInterfaceDBusStubAdapter( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) { + return std::make_shared<TestInterfaceDBusStubAdapter>(_address, _connection, _stub); +} + +INITIALIZER(registerTestInterfaceDBusStubAdapter) { + CommonAPI::DBus::Factory::get()->registerStubAdapterCreateMethod( + TestInterface::getInterface(), &createTestInterfaceDBusStubAdapter); +} + +TestInterfaceDBusStubAdapterInternal::~TestInterfaceDBusStubAdapterInternal() { + deactivateManagedInstances(); + TestInterfaceDBusStubAdapterHelper::deinit(); +} + +void TestInterfaceDBusStubAdapterInternal::deactivateManagedInstances() { + +} + +const char* TestInterfaceDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const { + static const std::string 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" + "<method name=\"setTestPredefinedTypeAttributeAttribute\">\n" + "<arg name=\"requestedValue\" type=\"u\" direction=\"in\" />\n" + "<arg name=\"setValue\" type=\"u\" direction=\"out\" />\n" + "</method>\n" + "<signal name=\"onTestPredefinedTypeAttributeAttributeChanged\">\n" + "<arg name=\"changedValue\" type=\"u\" />\n" + "</signal>\n" + "<method name=\"getTestDerivedStructAttributeAttribute\">\n" + "<arg name=\"value\" type=\"(sqi)\" direction=\"out\" />" + "</method>\n" + "<method name=\"setTestDerivedStructAttributeAttribute\">\n" + "<arg name=\"requestedValue\" type=\"(sqi)\" direction=\"in\" />\n" + "<arg name=\"setValue\" type=\"(sqi)\" direction=\"out\" />\n" + "</method>\n" + "<signal name=\"onTestDerivedStructAttributeAttributeChanged\">\n" + "<arg name=\"changedValue\" type=\"(sqi)\" />\n" + "</signal>\n" + "<method name=\"getTestDerivedArrayAttributeAttribute\">\n" + "<arg name=\"value\" type=\"at\" direction=\"out\" />" + "</method>\n" + "<method name=\"setTestDerivedArrayAttributeAttribute\">\n" + "<arg name=\"requestedValue\" type=\"at\" direction=\"in\" />\n" + "<arg name=\"setValue\" type=\"at\" direction=\"out\" />\n" + "</method>\n" + "<signal name=\"onTestDerivedArrayAttributeAttributeChanged\">\n" + "<arg name=\"changedValue\" type=\"at\" />\n" + "</signal>\n" + "<signal name=\"TestPredefinedTypeBroadcast\">\n" + "<arg name=\"uint32Value\" type=\"u\" />\n" + "<arg name=\"stringValue\" type=\"s\" />\n" + "</signal>\n" + "<signal name=\"TestSelectiveBroadcast\">\n" + "</signal>\n" + "<signal name=\"TestBroadcastWithOutArgs\">\n" + "<arg name=\"uint32Value\" type=\"u\" />\n" + "<arg name=\"stringValue\" type=\"s\" />\n" + "</signal>\n" + "<method name=\"testEmptyMethod\">\n" + "</method>\n" + "<method name=\"testVoidPredefinedTypeMethod\">\n" + "<arg name=\"_uint32Value\" type=\"u\" direction=\"in\" />\n" + "<arg name=\"_stringValue\" type=\"s\" direction=\"in\" />\n" + "</method>\n" + "<method name=\"testPredefinedTypeMethod\">\n" + "<arg name=\"_uint32InValue\" type=\"u\" direction=\"in\" />\n" + "<arg name=\"_stringInValue\" type=\"s\" direction=\"in\" />\n" + "<arg name=\"_uint32OutValue\" type=\"u\" direction=\"out\" />\n" + "<arg name=\"_stringOutValue\" type=\"s\" direction=\"out\" />\n" + "</method>\n" + "<method name=\"testVoidDerivedTypeMethod\">\n" + "<arg name=\"_testEnumExtended2Value\" type=\"i\" direction=\"in\" />\n" + "<arg name=\"_testMapValue\" type=\"a{ua(sq)}\" direction=\"in\" />\n" + "</method>\n" + "<method name=\"testDerivedTypeMethod\">\n" + "<arg name=\"_testEnumExtended2InValue\" type=\"i\" direction=\"in\" />\n" + "<arg name=\"_testMapInValue\" type=\"a{ua(sq)}\" direction=\"in\" />\n" + "<arg name=\"_testEnumExtended2OutValue\" type=\"i\" direction=\"out\" />\n" + "<arg name=\"_testMapOutValue\" type=\"a{ua(sq)}\" direction=\"out\" />\n" + "</method>\n" + "<method name=\"TestArrayOfPolymorphicStructMethod\">\n" + "<arg name=\"_inArray\" type=\"a(uv)\" direction=\"in\" />\n" + "</method>\n" + "<method name=\"TestMapOfPolymorphicStructMethod\">\n" + "<arg name=\"_inMap\" type=\"a{y(uv)}\" direction=\"in\" />\n" + "</method>\n" + "<method name=\"TestStructWithPolymorphicMemberMethod\">\n" + "<arg name=\"_inStruct\" type=\"(u(uv))\" direction=\"in\" />\n" + "</method>\n" + "<method name=\"TestStructWithEnumKeyMapMember\">\n" + "<arg name=\"_inStruct\" type=\"(a{is})\" direction=\"in\" />\n" + "</method>\n" + + ; + return introspectionData.c_str(); +} + +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestInterfaceStub, + CommonAPI::Version + > TestInterfaceDBusStubAdapterInternal::getTestInterfaceInterfaceVersionStubDispatcher(&TestInterfaceStub::getInterfaceVersion, "uu"); + +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestInterfaceStub, + uint32_t + > TestInterfaceDBusStubAdapterInternal::getTestPredefinedTypeAttributeAttributeStubDispatcher(&TestInterfaceStub::getTestPredefinedTypeAttributeAttribute, "u"); +CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestInterfaceStub, + uint32_t + > TestInterfaceDBusStubAdapterInternal::setTestPredefinedTypeAttributeAttributeStubDispatcher( + &TestInterfaceStub::getTestPredefinedTypeAttributeAttribute, + &TestInterfaceStubRemoteEvent::onRemoteSetTestPredefinedTypeAttributeAttribute, + &TestInterfaceStubRemoteEvent::onRemoteTestPredefinedTypeAttributeAttributeChanged + ,&TestInterfaceStubAdapter::fireTestPredefinedTypeAttributeAttributeChanged + ,"u" + ); +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > TestInterfaceDBusStubAdapterInternal::getTestDerivedStructAttributeAttributeStubDispatcher(&TestInterfaceStub::getTestDerivedStructAttributeAttribute, "(sqi)"); +CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > TestInterfaceDBusStubAdapterInternal::setTestDerivedStructAttributeAttributeStubDispatcher( + &TestInterfaceStub::getTestDerivedStructAttributeAttribute, + &TestInterfaceStubRemoteEvent::onRemoteSetTestDerivedStructAttributeAttribute, + &TestInterfaceStubRemoteEvent::onRemoteTestDerivedStructAttributeAttributeChanged + ,&TestInterfaceStubAdapter::fireTestDerivedStructAttributeAttributeChanged + ,"(sqi)" + ); +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > TestInterfaceDBusStubAdapterInternal::getTestDerivedArrayAttributeAttributeStubDispatcher(&TestInterfaceStub::getTestDerivedArrayAttributeAttribute, "at"); +CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > TestInterfaceDBusStubAdapterInternal::setTestDerivedArrayAttributeAttributeStubDispatcher( + &TestInterfaceStub::getTestDerivedArrayAttributeAttribute, + &TestInterfaceStubRemoteEvent::onRemoteSetTestDerivedArrayAttributeAttribute, + &TestInterfaceStubRemoteEvent::onRemoteTestDerivedArrayAttributeAttributeChanged + ,&TestInterfaceStubAdapter::fireTestDerivedArrayAttributeAttributeChanged + ,"at" + ); + + +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<>, + std::tuple<> + > TestInterfaceDBusStubAdapterInternal::testEmptyMethodStubDispatcher(&TestInterfaceStub::testEmptyMethod, "", std::tuple<>()); +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<uint32_t, std::string>, + std::tuple<> + > TestInterfaceDBusStubAdapterInternal::testVoidPredefinedTypeMethodStubDispatcher(&TestInterfaceStub::testVoidPredefinedTypeMethod, "", std::tuple<uint32_t, std::string>()); +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<uint32_t, std::string>, + std::tuple<uint32_t, std::string> + > TestInterfaceDBusStubAdapterInternal::testPredefinedTypeMethodStubDispatcher(&TestInterfaceStub::testPredefinedTypeMethod, "us", std::tuple<uint32_t, std::string, uint32_t, std::string>()); +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>, + std::tuple<> + > TestInterfaceDBusStubAdapterInternal::testVoidDerivedTypeMethodStubDispatcher(&TestInterfaceStub::testVoidDerivedTypeMethod, "", std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>()); +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>, + std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap> + > TestInterfaceDBusStubAdapterInternal::testDerivedTypeMethodStubDispatcher(&TestInterfaceStub::testDerivedTypeMethod, "ia{ua(sq)}", std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap, ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>()); +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>>>, + std::tuple<> + > TestInterfaceDBusStubAdapterInternal::testArrayOfPolymorphicStructMethodStubDispatcher(&TestInterfaceStub::TestArrayOfPolymorphicStructMethod, "", std::tuple<std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>>>()); +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic>, + std::tuple<> + > TestInterfaceDBusStubAdapterInternal::testMapOfPolymorphicStructMethodStubDispatcher(&TestInterfaceStub::TestMapOfPolymorphicStructMethod, "", std::tuple<::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic>()); +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember>, + std::tuple<> + > TestInterfaceDBusStubAdapterInternal::testStructWithPolymorphicMemberMethodStubDispatcher(&TestInterfaceStub::TestStructWithPolymorphicMemberMethod, "", std::tuple<::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember>()); +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap>, + std::tuple<> + > TestInterfaceDBusStubAdapterInternal::testStructWithEnumKeyMapMemberStubDispatcher(&TestInterfaceStub::TestStructWithEnumKeyMapMember, "", std::tuple<::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap>()); + + +void TestInterfaceDBusStubAdapterInternal::fireTestPredefinedTypeAttributeAttributeChanged(const uint32_t& value) { + CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t>> + ::sendSignal( + *this, + "onTestPredefinedTypeAttributeAttributeChanged", + "u", + value + ); +} +void TestInterfaceDBusStubAdapterInternal::fireTestDerivedStructAttributeAttributeChanged(const ::commonapi::tests::DerivedTypeCollection::TestStructExtended& value) { + CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::TestStructExtended>> + ::sendSignal( + *this, + "onTestDerivedStructAttributeAttributeChanged", + "(sqi)", + value + ); +} +void TestInterfaceDBusStubAdapterInternal::fireTestDerivedArrayAttributeAttributeChanged(const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64& value) { + CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::TestArrayUInt64>> + ::sendSignal( + *this, + "onTestDerivedArrayAttributeAttributeChanged", + "at", + value + ); +} + +void TestInterfaceDBusStubAdapterInternal::fireTestPredefinedTypeBroadcastEvent(const uint32_t& uint32Value, const std::string& stringValue) { + CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t, std::string>> + ::sendSignal( + *this, + "TestPredefinedTypeBroadcast", + "us", + uint32Value, stringValue + ); +} +CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher< + TestInterfaceStub, + TestInterfaceStubAdapter, + std::tuple<>, + std::tuple<bool> + > TestInterfaceDBusStubAdapterInternal::subscribeTestSelectiveBroadcastSelectiveStubDispatcher(&TestInterfaceStubAdapter::subscribeForTestSelectiveBroadcastSelective, "b"); + +CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher< + TestInterfaceStub, + TestInterfaceStubAdapter, + std::tuple<>, + std::tuple<> + > TestInterfaceDBusStubAdapterInternal::unsubscribeTestSelectiveBroadcastSelectiveStubDispatcher(&TestInterfaceStubAdapter::unsubscribeFromTestSelectiveBroadcastSelective, ""); + +void TestInterfaceDBusStubAdapterInternal::fireTestSelectiveBroadcastSelective(const std::shared_ptr<CommonAPI::ClientId> _client) { + std::shared_ptr<CommonAPI::DBus::DBusClientId> dbusClient = std::dynamic_pointer_cast<CommonAPI::DBus::DBusClientId, CommonAPI::ClientId>(_client); + + if(dbusClient) + { + CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<>> + ::sendSignal( + dbusClient->getDBusId(), + *this, + "TestSelectiveBroadcast", + "" + ); + } +} + +void TestInterfaceDBusStubAdapterInternal::sendTestSelectiveBroadcastSelective(const std::shared_ptr<CommonAPI::ClientIdList> _receivers) { + std::shared_ptr<CommonAPI::ClientIdList> actualReceiverList = _receivers; + + if (!_receivers) + actualReceiverList = subscribersForTestSelectiveBroadcastSelective_; + + for (auto clientIdIterator = actualReceiverList->cbegin(); clientIdIterator != actualReceiverList->cend(); clientIdIterator++) { + if (!_receivers || subscribersForTestSelectiveBroadcastSelective_->find(*clientIdIterator) != subscribersForTestSelectiveBroadcastSelective_->end()) { + fireTestSelectiveBroadcastSelective(*clientIdIterator); + } + } +} + +void TestInterfaceDBusStubAdapterInternal::subscribeForTestSelectiveBroadcastSelective(const std::shared_ptr<CommonAPI::ClientId> clientId, bool& success) { + bool ok = stub_->onTestSelectiveBroadcastSelectiveSubscriptionRequested(clientId); + if (ok) { + subscribersForTestSelectiveBroadcastSelective_->insert(clientId); + stub_->onTestSelectiveBroadcastSelectiveSubscriptionChanged(clientId, CommonAPI::SelectiveBroadcastSubscriptionEvent::SUBSCRIBED); + success = true; + } else { + success = false; + } +} + + +void TestInterfaceDBusStubAdapterInternal::unsubscribeFromTestSelectiveBroadcastSelective(const std::shared_ptr<CommonAPI::ClientId> clientId) { + subscribersForTestSelectiveBroadcastSelective_->erase(clientId); + stub_->onTestSelectiveBroadcastSelectiveSubscriptionChanged(clientId, CommonAPI::SelectiveBroadcastSubscriptionEvent::UNSUBSCRIBED); +} + +std::shared_ptr<CommonAPI::ClientIdList> const TestInterfaceDBusStubAdapterInternal::getSubscribersForTestSelectiveBroadcastSelective() { + return subscribersForTestSelectiveBroadcastSelective_; +} + +CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher< + TestInterfaceStub, + TestInterfaceStubAdapter, + std::tuple<>, + std::tuple<bool> + > TestInterfaceDBusStubAdapterInternal::subscribeTestBroadcastWithOutArgsSelectiveStubDispatcher(&TestInterfaceStubAdapter::subscribeForTestBroadcastWithOutArgsSelective, "b"); + +CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher< + TestInterfaceStub, + TestInterfaceStubAdapter, + std::tuple<>, + std::tuple<> + > TestInterfaceDBusStubAdapterInternal::unsubscribeTestBroadcastWithOutArgsSelectiveStubDispatcher(&TestInterfaceStubAdapter::unsubscribeFromTestBroadcastWithOutArgsSelective, ""); + +void TestInterfaceDBusStubAdapterInternal::fireTestBroadcastWithOutArgsSelective(const std::shared_ptr<CommonAPI::ClientId> _client, const uint32_t &_uint32Value, const std::string &_stringValue) { + std::shared_ptr<CommonAPI::DBus::DBusClientId> dbusClient = std::dynamic_pointer_cast<CommonAPI::DBus::DBusClientId, CommonAPI::ClientId>(_client); + + if(dbusClient) + { + CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t, std::string>> + ::sendSignal( + dbusClient->getDBusId(), + *this, + "TestBroadcastWithOutArgs", + "us", + _uint32Value, _stringValue + ); + } +} + +void TestInterfaceDBusStubAdapterInternal::sendTestBroadcastWithOutArgsSelective(const uint32_t &_uint32Value, const std::string &_stringValue, const std::shared_ptr<CommonAPI::ClientIdList> _receivers) { + std::shared_ptr<CommonAPI::ClientIdList> actualReceiverList = _receivers; + + if (!_receivers) + actualReceiverList = subscribersForTestBroadcastWithOutArgsSelective_; + + for (auto clientIdIterator = actualReceiverList->cbegin(); clientIdIterator != actualReceiverList->cend(); clientIdIterator++) { + if (!_receivers || subscribersForTestBroadcastWithOutArgsSelective_->find(*clientIdIterator) != subscribersForTestBroadcastWithOutArgsSelective_->end()) { + fireTestBroadcastWithOutArgsSelective(*clientIdIterator, _uint32Value, _stringValue); + } + } +} + +void TestInterfaceDBusStubAdapterInternal::subscribeForTestBroadcastWithOutArgsSelective(const std::shared_ptr<CommonAPI::ClientId> clientId, bool& success) { + bool ok = stub_->onTestBroadcastWithOutArgsSelectiveSubscriptionRequested(clientId); + if (ok) { + subscribersForTestBroadcastWithOutArgsSelective_->insert(clientId); + stub_->onTestBroadcastWithOutArgsSelectiveSubscriptionChanged(clientId, CommonAPI::SelectiveBroadcastSubscriptionEvent::SUBSCRIBED); + success = true; + } else { + success = false; + } +} + + +void TestInterfaceDBusStubAdapterInternal::unsubscribeFromTestBroadcastWithOutArgsSelective(const std::shared_ptr<CommonAPI::ClientId> clientId) { + subscribersForTestBroadcastWithOutArgsSelective_->erase(clientId); + stub_->onTestBroadcastWithOutArgsSelectiveSubscriptionChanged(clientId, CommonAPI::SelectiveBroadcastSubscriptionEvent::UNSUBSCRIBED); +} + +std::shared_ptr<CommonAPI::ClientIdList> const TestInterfaceDBusStubAdapterInternal::getSubscribersForTestBroadcastWithOutArgsSelective() { + return subscribersForTestBroadcastWithOutArgsSelective_; +} + + + +const TestInterfaceDBusStubAdapterHelper::StubDispatcherTable& TestInterfaceDBusStubAdapterInternal::getStubDispatcherTable() { + return stubDispatcherTable_; +} + +const CommonAPI::DBus::StubAttributeTable& TestInterfaceDBusStubAdapterInternal::getStubAttributeTable() { + return stubAttributeTable_; +} + +TestInterfaceDBusStubAdapterInternal::TestInterfaceDBusStubAdapterInternal( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) + : CommonAPI::DBus::DBusStubAdapter(_address, _connection,false), + TestInterfaceDBusStubAdapterHelper(_address, _connection, std::dynamic_pointer_cast<TestInterfaceStub>(_stub), false), + stubDispatcherTable_({ + { { "getTestPredefinedTypeAttributeAttribute", "" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::getTestPredefinedTypeAttributeAttributeStubDispatcher } + , { { "setTestPredefinedTypeAttributeAttribute", "u" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::setTestPredefinedTypeAttributeAttributeStubDispatcher }, + { { "getTestDerivedStructAttributeAttribute", "" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::getTestDerivedStructAttributeAttributeStubDispatcher } + , { { "setTestDerivedStructAttributeAttribute", "(sqi)" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::setTestDerivedStructAttributeAttributeStubDispatcher }, + { { "getTestDerivedArrayAttributeAttribute", "" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::getTestDerivedArrayAttributeAttributeStubDispatcher } + , { { "setTestDerivedArrayAttributeAttribute", "at" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::setTestDerivedArrayAttributeAttributeStubDispatcher } + , + { { "testEmptyMethod", "" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::testEmptyMethodStubDispatcher }, + { { "testVoidPredefinedTypeMethod", "us" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::testVoidPredefinedTypeMethodStubDispatcher }, + { { "testPredefinedTypeMethod", "us" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::testPredefinedTypeMethodStubDispatcher }, + { { "testVoidDerivedTypeMethod", "ia{ua(sq)}" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::testVoidDerivedTypeMethodStubDispatcher }, + { { "testDerivedTypeMethod", "ia{ua(sq)}" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::testDerivedTypeMethodStubDispatcher }, + { { "TestArrayOfPolymorphicStructMethod", "a(uv)" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::testArrayOfPolymorphicStructMethodStubDispatcher }, + { { "TestMapOfPolymorphicStructMethod", "a{y(uv)}" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::testMapOfPolymorphicStructMethodStubDispatcher }, + { { "TestStructWithPolymorphicMemberMethod", "(u(uv))" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::testStructWithPolymorphicMemberMethodStubDispatcher }, + { { "TestStructWithEnumKeyMapMember", "(a{is})" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::testStructWithEnumKeyMapMemberStubDispatcher } + , + { { "subscribeForTestSelectiveBroadcastSelective", "" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::subscribeTestSelectiveBroadcastSelectiveStubDispatcher } + , + { { "unsubscribeFromTestSelectiveBroadcastSelective", "" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::unsubscribeTestSelectiveBroadcastSelectiveStubDispatcher }, + { { "subscribeForTestBroadcastWithOutArgsSelective", "" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::subscribeTestBroadcastWithOutArgsSelectiveStubDispatcher } + , + { { "unsubscribeFromTestBroadcastWithOutArgsSelective", "" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::unsubscribeTestBroadcastWithOutArgsSelectiveStubDispatcher } + }), + stubAttributeTable_() { + subscribersForTestSelectiveBroadcastSelective_ = std::make_shared<CommonAPI::ClientIdList>(); + subscribersForTestBroadcastWithOutArgsSelective_ = std::make_shared<CommonAPI::ClientIdList>(); + + stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &commonapi::tests::TestInterfaceDBusStubAdapterInternal::getTestInterfaceInterfaceVersionStubDispatcher }); +} + +const bool TestInterfaceDBusStubAdapterInternal::hasFreedesktopProperties() { + return false; +} + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/TestInterfaceDBusStubAdapter.hpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestInterfaceDBusStubAdapter.hpp new file mode 100644 index 0000000..7f7d7b1 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/TestInterfaceDBusStubAdapter.hpp @@ -0,0 +1,205 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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_HPP_ +#define COMMONAPI_TESTS_Test_Interface_DBUS_STUB_ADAPTER_HPP_ + +#include <v1_0/commonapi/tests/TestInterfaceStub.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusFactory.hpp> +#include <CommonAPI/DBus/DBusStubAdapterHelper.hpp> +#include <CommonAPI/DBus/DBusStubAdapter.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { + +typedef CommonAPI::DBus::DBusStubAdapterHelper<TestInterfaceStub> TestInterfaceDBusStubAdapterHelper; + +class TestInterfaceDBusStubAdapterInternal + : public virtual TestInterfaceStubAdapter, + public TestInterfaceDBusStubAdapterHelper +{ +public: + TestInterfaceDBusStubAdapterInternal( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub); + + ~TestInterfaceDBusStubAdapterInternal(); + + virtual const bool hasFreedesktopProperties(); + + void fireTestPredefinedTypeAttributeAttributeChanged(const uint32_t& value); + void fireTestDerivedStructAttributeAttributeChanged(const ::commonapi::tests::DerivedTypeCollection::TestStructExtended& value); + void fireTestDerivedArrayAttributeAttributeChanged(const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64& value); + + void fireTestPredefinedTypeBroadcastEvent(const uint32_t& uint32Value, const std::string& stringValue); + void fireTestSelectiveBroadcastSelective(const std::shared_ptr<CommonAPI::ClientId> _client); + void sendTestSelectiveBroadcastSelective(const std::shared_ptr<CommonAPI::ClientIdList> _receivers = nullptr); + void subscribeForTestSelectiveBroadcastSelective(const std::shared_ptr<CommonAPI::ClientId> clientId, bool& success); + void unsubscribeFromTestSelectiveBroadcastSelective(const std::shared_ptr<CommonAPI::ClientId> clientId); + std::shared_ptr<CommonAPI::ClientIdList> const getSubscribersForTestSelectiveBroadcastSelective(); + void fireTestBroadcastWithOutArgsSelective(const std::shared_ptr<CommonAPI::ClientId> _client, const uint32_t &_uint32Value, const std::string &_stringValue); + void sendTestBroadcastWithOutArgsSelective(const uint32_t &_uint32Value, const std::string &_stringValue, const std::shared_ptr<CommonAPI::ClientIdList> _receivers = nullptr); + void subscribeForTestBroadcastWithOutArgsSelective(const std::shared_ptr<CommonAPI::ClientId> clientId, bool& success); + void unsubscribeFromTestBroadcastWithOutArgsSelective(const std::shared_ptr<CommonAPI::ClientId> clientId); + std::shared_ptr<CommonAPI::ClientIdList> const getSubscribersForTestBroadcastWithOutArgsSelective(); + + + const TestInterfaceDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable(); + const CommonAPI::DBus::StubAttributeTable& getStubAttributeTable(); + + void deactivateManagedInstances(); + + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestInterfaceStub, + CommonAPI::Version + > getTestInterfaceInterfaceVersionStubDispatcher; + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestInterfaceStub, + uint32_t + > getTestPredefinedTypeAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestInterfaceStub, + uint32_t + > setTestPredefinedTypeAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > getTestDerivedStructAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > setTestDerivedStructAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > getTestDerivedArrayAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + TestInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > setTestDerivedArrayAttributeAttributeStubDispatcher; + + +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<>, + std::tuple<> + > testEmptyMethodStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<uint32_t, std::string>, + std::tuple<> + > testVoidPredefinedTypeMethodStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<uint32_t, std::string>, + std::tuple<uint32_t, std::string> + > testPredefinedTypeMethodStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>, + std::tuple<> + > testVoidDerivedTypeMethodStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap>, + std::tuple<::commonapi::tests::DerivedTypeCollection::TestEnumExtended2, ::commonapi::tests::DerivedTypeCollection::TestMap> + > testDerivedTypeMethodStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>>>, + std::tuple<> + > testArrayOfPolymorphicStructMethodStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic>, + std::tuple<> + > testMapOfPolymorphicStructMethodStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember>, + std::tuple<> + > testStructWithPolymorphicMemberMethodStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + TestInterfaceStub, + std::tuple<::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap>, + std::tuple<> + > testStructWithEnumKeyMapMemberStubDispatcher; + + +static CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher< + TestInterfaceStub, + TestInterfaceStubAdapter, + std::tuple<>, + std::tuple<bool> + > subscribeTestSelectiveBroadcastSelectiveStubDispatcher; + +static CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher< + TestInterfaceStub, + TestInterfaceStubAdapter, + std::tuple<>, + std::tuple<> + > unsubscribeTestSelectiveBroadcastSelectiveStubDispatcher; +static CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher< + TestInterfaceStub, + TestInterfaceStubAdapter, + std::tuple<>, + std::tuple<bool> + > subscribeTestBroadcastWithOutArgsSelectiveStubDispatcher; + +static CommonAPI::DBus::DBusMethodWithReplyAdapterDispatcher< + TestInterfaceStub, + TestInterfaceStubAdapter, + std::tuple<>, + std::tuple<> + > unsubscribeTestBroadcastWithOutArgsSelectiveStubDispatcher; + + + protected: + virtual const char* getMethodsDBusIntrospectionXmlData() const; + + private: + TestInterfaceDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_; + CommonAPI::DBus::StubAttributeTable stubAttributeTable_; +}; + +class TestInterfaceDBusStubAdapter + : public TestInterfaceDBusStubAdapterInternal, + public std::enable_shared_from_this<TestInterfaceDBusStubAdapter> { +public: + TestInterfaceDBusStubAdapter( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) + : CommonAPI::DBus::DBusStubAdapter( + _address, + _connection, + false), + TestInterfaceDBusStubAdapterInternal( + _address, + _connection, + _stub) { + } +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Test_Interface_DBUS_STUB_ADAPTER_HPP_ diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/BranchInterfaceDBusProxy.cpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/BranchInterfaceDBusProxy.cpp new file mode 100644 index 0000000..25fa000 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/BranchInterfaceDBusProxy.cpp @@ -0,0 +1,71 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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/. +*/ +#include <v1_0/commonapi/tests/managed/BranchInterfaceDBusProxy.hpp> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +std::shared_ptr<CommonAPI::DBus::DBusProxy> createBranchInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection) { + return std::make_shared<BranchInterfaceDBusProxy>(_address, _connection); +} + +INITIALIZER(registerBranchInterfaceDBusProxy) { + CommonAPI::DBus::Factory::get()->registerProxyCreateMethod( + BranchInterface::getInterface(), + &createBranchInterfaceDBusProxy); +} + +BranchInterfaceDBusProxy::BranchInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection) + : CommonAPI::DBus::DBusProxy(_address, _connection) +{ +} + + + + void BranchInterfaceDBusProxy::testBranchMethod(const int32_t &_inInt, const std::string &_inString, CommonAPI::CallStatus &_status, BranchInterface::testBranchMethodError &_error, int32_t &_outInt, std::string &_outString, const CommonAPI::CallInfo *_info) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<int32_t, std::string>, + CommonAPI::DBus::DBusSerializableArguments<BranchInterface::testBranchMethodError, int32_t, std::string> >::callMethodWithReply( + *this, + "testBranchMethod", + "is", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _inInt, _inString, + _status, + _error + , _outInt, _outString); + } + std::future<CommonAPI::CallStatus> BranchInterfaceDBusProxy::testBranchMethodAsync(const int32_t &_inInt, const std::string &_inString, TestBranchMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<int32_t, std::string>, + CommonAPI::DBus::DBusSerializableArguments<BranchInterface::testBranchMethodError, int32_t, std::string> >::callMethodAsync( + *this, + "testBranchMethod", + "is", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _inInt, _inString, + std::move(_callback), + std::tuple<BranchInterface::testBranchMethodError, int32_t, std::string>()); + } + + + void BranchInterfaceDBusProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const { + ownVersionMajor = 1; + ownVersionMinor = 0; + } + + } // namespace managed + } // namespace tests + } // namespace commonapi + } // namespace v1_0 diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/BranchInterfaceDBusProxy.hpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/BranchInterfaceDBusProxy.hpp new file mode 100644 index 0000000..3738f3d --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/BranchInterfaceDBusProxy.hpp @@ -0,0 +1,62 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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_MANAGED_Branch_Interface_DBUS_PROXY_HPP_ +#define COMMONAPI_TESTS_MANAGED_Branch_Interface_DBUS_PROXY_HPP_ + +#include <v1_0/commonapi/tests/managed/BranchInterfaceProxyBase.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusAddress.hpp> +#include <CommonAPI/DBus/DBusFactory.hpp> +#include <CommonAPI/DBus/DBusProxy.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +#include <string> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +class BranchInterfaceDBusProxy + : virtual public BranchInterfaceProxyBase, + virtual public CommonAPI::DBus::DBusProxy { +public: + BranchInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection); + + virtual ~BranchInterfaceDBusProxy() { } + + + + virtual void testBranchMethod(const int32_t &_inInt, const std::string &_inString, CommonAPI::CallStatus &_status, BranchInterface::testBranchMethodError &_error, int32_t &_outInt, std::string &_outString, const CommonAPI::CallInfo *_info); + virtual std::future<CommonAPI::CallStatus> testBranchMethodAsync(const int32_t &_inInt, const std::string &_inString, TestBranchMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info); + + + virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const; + +private: + + + +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Branch_Interface_DBUS_PROXY_HPP_ + diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.cpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.cpp new file mode 100644 index 0000000..e833d10 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.cpp @@ -0,0 +1,102 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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/. +*/ +#include <v1_0/commonapi/tests/managed/BranchInterface.hpp> +#include <v1_0/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.hpp> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createBranchInterfaceDBusStubAdapter( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) { + return std::make_shared<BranchInterfaceDBusStubAdapter>(_address, _connection, _stub); +} + +INITIALIZER(registerBranchInterfaceDBusStubAdapter) { + CommonAPI::DBus::Factory::get()->registerStubAdapterCreateMethod( + BranchInterface::getInterface(), &createBranchInterfaceDBusStubAdapter); +} + +BranchInterfaceDBusStubAdapterInternal::~BranchInterfaceDBusStubAdapterInternal() { + deactivateManagedInstances(); + BranchInterfaceDBusStubAdapterHelper::deinit(); +} + +void BranchInterfaceDBusStubAdapterInternal::deactivateManagedInstances() { + +} + +const char* BranchInterfaceDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const { + static const std::string introspectionData = + "<method name=\"getInterfaceVersion\">\n" + "<arg name=\"value\" type=\"uu\" direction=\"out\" />" + "</method>\n" + "<method name=\"testBranchMethod\">\n" + "<arg name=\"_inInt\" type=\"i\" direction=\"in\" />\n" + "<arg name=\"_inString\" type=\"s\" direction=\"in\" />\n" + "<arg name=\"_error\" type=\"i\" direction=\"out\" />\n" + "<arg name=\"_outInt\" type=\"i\" direction=\"out\" />\n" + "<arg name=\"_outString\" type=\"s\" direction=\"out\" />\n" + "</method>\n" + + ; + return introspectionData.c_str(); +} + +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + BranchInterfaceStub, + CommonAPI::Version + > BranchInterfaceDBusStubAdapterInternal::getBranchInterfaceInterfaceVersionStubDispatcher(&BranchInterfaceStub::getInterfaceVersion, "uu"); + + + +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + BranchInterfaceStub, + std::tuple<int32_t, std::string>, + std::tuple<BranchInterface::testBranchMethodError, int32_t, std::string> + > BranchInterfaceDBusStubAdapterInternal::testBranchMethodStubDispatcher(&BranchInterfaceStub::testBranchMethod, "iis", std::tuple<int32_t, std::string, BranchInterface::testBranchMethodError, int32_t, std::string>()); + + + + + +const BranchInterfaceDBusStubAdapterHelper::StubDispatcherTable& BranchInterfaceDBusStubAdapterInternal::getStubDispatcherTable() { + return stubDispatcherTable_; +} + +const CommonAPI::DBus::StubAttributeTable& BranchInterfaceDBusStubAdapterInternal::getStubAttributeTable() { + return stubAttributeTable_; +} + +BranchInterfaceDBusStubAdapterInternal::BranchInterfaceDBusStubAdapterInternal( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) + : CommonAPI::DBus::DBusStubAdapter(_address, _connection,false), + BranchInterfaceDBusStubAdapterHelper(_address, _connection, std::dynamic_pointer_cast<BranchInterfaceStub>(_stub), false), + stubDispatcherTable_({ + { { "testBranchMethod", "is" }, &commonapi::tests::managed::BranchInterfaceDBusStubAdapterInternal::testBranchMethodStubDispatcher } + }), + stubAttributeTable_() { + + stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &commonapi::tests::managed::BranchInterfaceDBusStubAdapterInternal::getBranchInterfaceInterfaceVersionStubDispatcher }); +} + +const bool BranchInterfaceDBusStubAdapterInternal::hasFreedesktopProperties() { + return false; +} + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.hpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.hpp new file mode 100644 index 0000000..ab1e41b --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.hpp @@ -0,0 +1,103 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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_MANAGED_Branch_Interface_DBUS_STUB_ADAPTER_HPP_ +#define COMMONAPI_TESTS_MANAGED_Branch_Interface_DBUS_STUB_ADAPTER_HPP_ + +#include <v1_0/commonapi/tests/managed/BranchInterfaceStub.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusFactory.hpp> +#include <CommonAPI/DBus/DBusStubAdapterHelper.hpp> +#include <CommonAPI/DBus/DBusStubAdapter.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +typedef CommonAPI::DBus::DBusStubAdapterHelper<BranchInterfaceStub> BranchInterfaceDBusStubAdapterHelper; + +class BranchInterfaceDBusStubAdapterInternal + : public virtual BranchInterfaceStubAdapter, + public BranchInterfaceDBusStubAdapterHelper +{ +public: + BranchInterfaceDBusStubAdapterInternal( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub); + + ~BranchInterfaceDBusStubAdapterInternal(); + + virtual const bool hasFreedesktopProperties(); + + + + + const BranchInterfaceDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable(); + const CommonAPI::DBus::StubAttributeTable& getStubAttributeTable(); + + void deactivateManagedInstances(); + + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + BranchInterfaceStub, + CommonAPI::Version + > getBranchInterfaceInterfaceVersionStubDispatcher; + + + +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + BranchInterfaceStub, + std::tuple<int32_t, std::string>, + std::tuple<BranchInterface::testBranchMethodError, int32_t, std::string> + > testBranchMethodStubDispatcher; + + + + + protected: + virtual const char* getMethodsDBusIntrospectionXmlData() const; + + private: + BranchInterfaceDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_; + CommonAPI::DBus::StubAttributeTable stubAttributeTable_; +}; + +class BranchInterfaceDBusStubAdapter + : public BranchInterfaceDBusStubAdapterInternal, + public std::enable_shared_from_this<BranchInterfaceDBusStubAdapter> { +public: + BranchInterfaceDBusStubAdapter( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) + : CommonAPI::DBus::DBusStubAdapter( + _address, + _connection, + false), + BranchInterfaceDBusStubAdapterInternal( + _address, + _connection, + _stub) { + } +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Branch_Interface_DBUS_STUB_ADAPTER_HPP_ diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/LeafInterfaceDBusProxy.cpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/LeafInterfaceDBusProxy.cpp new file mode 100644 index 0000000..6fe152e --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/LeafInterfaceDBusProxy.cpp @@ -0,0 +1,71 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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/. +*/ +#include <v1_0/commonapi/tests/managed/LeafInterfaceDBusProxy.hpp> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +std::shared_ptr<CommonAPI::DBus::DBusProxy> createLeafInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection) { + return std::make_shared<LeafInterfaceDBusProxy>(_address, _connection); +} + +INITIALIZER(registerLeafInterfaceDBusProxy) { + CommonAPI::DBus::Factory::get()->registerProxyCreateMethod( + LeafInterface::getInterface(), + &createLeafInterfaceDBusProxy); +} + +LeafInterfaceDBusProxy::LeafInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection) + : CommonAPI::DBus::DBusProxy(_address, _connection) +{ +} + + + + void LeafInterfaceDBusProxy::testLeafMethod(const int32_t &_inInt, const std::string &_inString, CommonAPI::CallStatus &_status, LeafInterface::testLeafMethodError &_error, int32_t &_outInt, std::string &_outString, const CommonAPI::CallInfo *_info) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<int32_t, std::string>, + CommonAPI::DBus::DBusSerializableArguments<LeafInterface::testLeafMethodError, int32_t, std::string> >::callMethodWithReply( + *this, + "testLeafMethod", + "is", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _inInt, _inString, + _status, + _error + , _outInt, _outString); + } + std::future<CommonAPI::CallStatus> LeafInterfaceDBusProxy::testLeafMethodAsync(const int32_t &_inInt, const std::string &_inString, TestLeafMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<int32_t, std::string>, + CommonAPI::DBus::DBusSerializableArguments<LeafInterface::testLeafMethodError, int32_t, std::string> >::callMethodAsync( + *this, + "testLeafMethod", + "is", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _inInt, _inString, + std::move(_callback), + std::tuple<LeafInterface::testLeafMethodError, int32_t, std::string>()); + } + + + void LeafInterfaceDBusProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const { + ownVersionMajor = 1; + ownVersionMinor = 0; + } + + } // namespace managed + } // namespace tests + } // namespace commonapi + } // namespace v1_0 diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/LeafInterfaceDBusProxy.hpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/LeafInterfaceDBusProxy.hpp new file mode 100644 index 0000000..0dae7b3 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/LeafInterfaceDBusProxy.hpp @@ -0,0 +1,62 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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_MANAGED_Leaf_Interface_DBUS_PROXY_HPP_ +#define COMMONAPI_TESTS_MANAGED_Leaf_Interface_DBUS_PROXY_HPP_ + +#include <v1_0/commonapi/tests/managed/LeafInterfaceProxyBase.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusAddress.hpp> +#include <CommonAPI/DBus/DBusFactory.hpp> +#include <CommonAPI/DBus/DBusProxy.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +#include <string> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +class LeafInterfaceDBusProxy + : virtual public LeafInterfaceProxyBase, + virtual public CommonAPI::DBus::DBusProxy { +public: + LeafInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection); + + virtual ~LeafInterfaceDBusProxy() { } + + + + virtual void testLeafMethod(const int32_t &_inInt, const std::string &_inString, CommonAPI::CallStatus &_status, LeafInterface::testLeafMethodError &_error, int32_t &_outInt, std::string &_outString, const CommonAPI::CallInfo *_info); + virtual std::future<CommonAPI::CallStatus> testLeafMethodAsync(const int32_t &_inInt, const std::string &_inString, TestLeafMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info); + + + virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const; + +private: + + + +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Leaf_Interface_DBUS_PROXY_HPP_ + diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.cpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.cpp new file mode 100644 index 0000000..7e4473e --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.cpp @@ -0,0 +1,102 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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/. +*/ +#include <v1_0/commonapi/tests/managed/LeafInterface.hpp> +#include <v1_0/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.hpp> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createLeafInterfaceDBusStubAdapter( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) { + return std::make_shared<LeafInterfaceDBusStubAdapter>(_address, _connection, _stub); +} + +INITIALIZER(registerLeafInterfaceDBusStubAdapter) { + CommonAPI::DBus::Factory::get()->registerStubAdapterCreateMethod( + LeafInterface::getInterface(), &createLeafInterfaceDBusStubAdapter); +} + +LeafInterfaceDBusStubAdapterInternal::~LeafInterfaceDBusStubAdapterInternal() { + deactivateManagedInstances(); + LeafInterfaceDBusStubAdapterHelper::deinit(); +} + +void LeafInterfaceDBusStubAdapterInternal::deactivateManagedInstances() { + +} + +const char* LeafInterfaceDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const { + static const std::string introspectionData = + "<method name=\"getInterfaceVersion\">\n" + "<arg name=\"value\" type=\"uu\" direction=\"out\" />" + "</method>\n" + "<method name=\"testLeafMethod\">\n" + "<arg name=\"_inInt\" type=\"i\" direction=\"in\" />\n" + "<arg name=\"_inString\" type=\"s\" direction=\"in\" />\n" + "<arg name=\"_error\" type=\"i\" direction=\"out\" />\n" + "<arg name=\"_outInt\" type=\"i\" direction=\"out\" />\n" + "<arg name=\"_outString\" type=\"s\" direction=\"out\" />\n" + "</method>\n" + + ; + return introspectionData.c_str(); +} + +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + LeafInterfaceStub, + CommonAPI::Version + > LeafInterfaceDBusStubAdapterInternal::getLeafInterfaceInterfaceVersionStubDispatcher(&LeafInterfaceStub::getInterfaceVersion, "uu"); + + + +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + LeafInterfaceStub, + std::tuple<int32_t, std::string>, + std::tuple<LeafInterface::testLeafMethodError, int32_t, std::string> + > LeafInterfaceDBusStubAdapterInternal::testLeafMethodStubDispatcher(&LeafInterfaceStub::testLeafMethod, "iis", std::tuple<int32_t, std::string, LeafInterface::testLeafMethodError, int32_t, std::string>()); + + + + + +const LeafInterfaceDBusStubAdapterHelper::StubDispatcherTable& LeafInterfaceDBusStubAdapterInternal::getStubDispatcherTable() { + return stubDispatcherTable_; +} + +const CommonAPI::DBus::StubAttributeTable& LeafInterfaceDBusStubAdapterInternal::getStubAttributeTable() { + return stubAttributeTable_; +} + +LeafInterfaceDBusStubAdapterInternal::LeafInterfaceDBusStubAdapterInternal( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) + : CommonAPI::DBus::DBusStubAdapter(_address, _connection,false), + LeafInterfaceDBusStubAdapterHelper(_address, _connection, std::dynamic_pointer_cast<LeafInterfaceStub>(_stub), false), + stubDispatcherTable_({ + { { "testLeafMethod", "is" }, &commonapi::tests::managed::LeafInterfaceDBusStubAdapterInternal::testLeafMethodStubDispatcher } + }), + stubAttributeTable_() { + + stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &commonapi::tests::managed::LeafInterfaceDBusStubAdapterInternal::getLeafInterfaceInterfaceVersionStubDispatcher }); +} + +const bool LeafInterfaceDBusStubAdapterInternal::hasFreedesktopProperties() { + return false; +} + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.hpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.hpp new file mode 100644 index 0000000..e1b739c --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.hpp @@ -0,0 +1,103 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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_MANAGED_Leaf_Interface_DBUS_STUB_ADAPTER_HPP_ +#define COMMONAPI_TESTS_MANAGED_Leaf_Interface_DBUS_STUB_ADAPTER_HPP_ + +#include <v1_0/commonapi/tests/managed/LeafInterfaceStub.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusFactory.hpp> +#include <CommonAPI/DBus/DBusStubAdapterHelper.hpp> +#include <CommonAPI/DBus/DBusStubAdapter.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +typedef CommonAPI::DBus::DBusStubAdapterHelper<LeafInterfaceStub> LeafInterfaceDBusStubAdapterHelper; + +class LeafInterfaceDBusStubAdapterInternal + : public virtual LeafInterfaceStubAdapter, + public LeafInterfaceDBusStubAdapterHelper +{ +public: + LeafInterfaceDBusStubAdapterInternal( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub); + + ~LeafInterfaceDBusStubAdapterInternal(); + + virtual const bool hasFreedesktopProperties(); + + + + + const LeafInterfaceDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable(); + const CommonAPI::DBus::StubAttributeTable& getStubAttributeTable(); + + void deactivateManagedInstances(); + + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + LeafInterfaceStub, + CommonAPI::Version + > getLeafInterfaceInterfaceVersionStubDispatcher; + + + +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + LeafInterfaceStub, + std::tuple<int32_t, std::string>, + std::tuple<LeafInterface::testLeafMethodError, int32_t, std::string> + > testLeafMethodStubDispatcher; + + + + + protected: + virtual const char* getMethodsDBusIntrospectionXmlData() const; + + private: + LeafInterfaceDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_; + CommonAPI::DBus::StubAttributeTable stubAttributeTable_; +}; + +class LeafInterfaceDBusStubAdapter + : public LeafInterfaceDBusStubAdapterInternal, + public std::enable_shared_from_this<LeafInterfaceDBusStubAdapter> { +public: + LeafInterfaceDBusStubAdapter( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) + : CommonAPI::DBus::DBusStubAdapter( + _address, + _connection, + false), + LeafInterfaceDBusStubAdapterInternal( + _address, + _connection, + _stub) { + } +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Leaf_Interface_DBUS_STUB_ADAPTER_HPP_ diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/RootInterfaceDBusProxy.cpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/RootInterfaceDBusProxy.cpp new file mode 100644 index 0000000..c694796 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/RootInterfaceDBusProxy.cpp @@ -0,0 +1,79 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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/. +*/ +#include <v1_0/commonapi/tests/managed/RootInterfaceDBusProxy.hpp> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +std::shared_ptr<CommonAPI::DBus::DBusProxy> createRootInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection) { + return std::make_shared<RootInterfaceDBusProxy>(_address, _connection); +} + +INITIALIZER(registerRootInterfaceDBusProxy) { + CommonAPI::DBus::Factory::get()->registerProxyCreateMethod( + RootInterface::getInterface(), + &createRootInterfaceDBusProxy); +} + +RootInterfaceDBusProxy::RootInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection) + : CommonAPI::DBus::DBusProxy(_address, _connection) +, proxyManagerLeafInterface_(*this, "commonapi.tests.managed.LeafInterface"), + proxyManagerBranchInterface_(*this, "commonapi.tests.managed.BranchInterface") +{ +} + + + + void RootInterfaceDBusProxy::testRootMethod(const int32_t &_inInt, const std::string &_inString, CommonAPI::CallStatus &_status, RootInterface::testRootMethodError &_error, int32_t &_outInt, std::string &_outString, const CommonAPI::CallInfo *_info) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<int32_t, std::string>, + CommonAPI::DBus::DBusSerializableArguments<RootInterface::testRootMethodError, int32_t, std::string> >::callMethodWithReply( + *this, + "testRootMethod", + "is", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _inInt, _inString, + _status, + _error + , _outInt, _outString); + } + std::future<CommonAPI::CallStatus> RootInterfaceDBusProxy::testRootMethodAsync(const int32_t &_inInt, const std::string &_inString, TestRootMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<int32_t, std::string>, + CommonAPI::DBus::DBusSerializableArguments<RootInterface::testRootMethodError, int32_t, std::string> >::callMethodAsync( + *this, + "testRootMethod", + "is", + (_info ? _info : &CommonAPI::DBus::defaultCallInfo), + _inInt, _inString, + std::move(_callback), + std::tuple<RootInterface::testRootMethodError, int32_t, std::string>()); + } + + CommonAPI::ProxyManager& RootInterfaceDBusProxy::getProxyManagerLeafInterface() { + return proxyManagerLeafInterface_; + } + CommonAPI::ProxyManager& RootInterfaceDBusProxy::getProxyManagerBranchInterface() { + return proxyManagerBranchInterface_; + } + + void RootInterfaceDBusProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const { + ownVersionMajor = 1; + ownVersionMinor = 0; + } + + } // namespace managed + } // namespace tests + } // namespace commonapi + } // namespace v1_0 diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/RootInterfaceDBusProxy.hpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/RootInterfaceDBusProxy.hpp new file mode 100644 index 0000000..67920ba --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/RootInterfaceDBusProxy.hpp @@ -0,0 +1,67 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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_MANAGED_Root_Interface_DBUS_PROXY_HPP_ +#define COMMONAPI_TESTS_MANAGED_Root_Interface_DBUS_PROXY_HPP_ + +#include <v1_0/commonapi/tests/managed/RootInterfaceProxyBase.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusAddress.hpp> +#include <CommonAPI/DBus/DBusFactory.hpp> +#include <CommonAPI/DBus/DBusProxy.hpp> +#include <CommonAPI/DBus/DBusProxyManager.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +#include <string> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +class RootInterfaceDBusProxy + : virtual public RootInterfaceProxyBase, + virtual public CommonAPI::DBus::DBusProxy { +public: + RootInterfaceDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection); + + virtual ~RootInterfaceDBusProxy() { } + + + + virtual void testRootMethod(const int32_t &_inInt, const std::string &_inString, CommonAPI::CallStatus &_status, RootInterface::testRootMethodError &_error, int32_t &_outInt, std::string &_outString, const CommonAPI::CallInfo *_info); + virtual std::future<CommonAPI::CallStatus> testRootMethodAsync(const int32_t &_inInt, const std::string &_inString, TestRootMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info); + + virtual CommonAPI::ProxyManager& getProxyManagerLeafInterface(); + virtual CommonAPI::ProxyManager& getProxyManagerBranchInterface(); + + virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const; + +private: + + + + CommonAPI::DBus::DBusProxyManager proxyManagerLeafInterface_; + CommonAPI::DBus::DBusProxyManager proxyManagerBranchInterface_; +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Root_Interface_DBUS_PROXY_HPP_ + diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/RootInterfaceDBusStubAdapter.cpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/RootInterfaceDBusStubAdapter.cpp new file mode 100644 index 0000000..06a6667 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/RootInterfaceDBusStubAdapter.cpp @@ -0,0 +1,222 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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/. +*/ +#include <v1_0/commonapi/tests/managed/RootInterface.hpp> +#include <v1_0/commonapi/tests/managed/RootInterfaceDBusStubAdapter.hpp> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createRootInterfaceDBusStubAdapter( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) { + return std::make_shared<RootInterfaceDBusStubAdapter>(_address, _connection, _stub); +} + +INITIALIZER(registerRootInterfaceDBusStubAdapter) { + CommonAPI::DBus::Factory::get()->registerStubAdapterCreateMethod( + RootInterface::getInterface(), &createRootInterfaceDBusStubAdapter); +} + +RootInterfaceDBusStubAdapterInternal::~RootInterfaceDBusStubAdapterInternal() { + deactivateManagedInstances(); + RootInterfaceDBusStubAdapterHelper::deinit(); +} + +void RootInterfaceDBusStubAdapterInternal::deactivateManagedInstances() { + std::set<std::string>::iterator iter; + std::set<std::string>::iterator iterNext; + + iter = registeredLeafInterfaceInstances.begin(); + while (iter != registeredLeafInterfaceInstances.end()) { + iterNext = std::next(iter); + + if (deregisterManagedStubLeafInterface(*iter)) { + iter = iterNext; + } + else { + iter++; + } + } + iter = registeredBranchInterfaceInstances.begin(); + while (iter != registeredBranchInterfaceInstances.end()) { + iterNext = std::next(iter); + + if (deregisterManagedStubBranchInterface(*iter)) { + iter = iterNext; + } + else { + iter++; + } + } +} + +const char* RootInterfaceDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const { + static const std::string introspectionData = + "<method name=\"getInterfaceVersion\">\n" + "<arg name=\"value\" type=\"uu\" direction=\"out\" />" + "</method>\n" + "<method name=\"testRootMethod\">\n" + "<arg name=\"_inInt\" type=\"i\" direction=\"in\" />\n" + "<arg name=\"_inString\" type=\"s\" direction=\"in\" />\n" + "<arg name=\"_error\" type=\"i\" direction=\"out\" />\n" + "<arg name=\"_outInt\" type=\"i\" direction=\"out\" />\n" + "<arg name=\"_outString\" type=\"s\" direction=\"out\" />\n" + "</method>\n" + + ; + return introspectionData.c_str(); +} + +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + RootInterfaceStub, + CommonAPI::Version + > RootInterfaceDBusStubAdapterInternal::getRootInterfaceInterfaceVersionStubDispatcher(&RootInterfaceStub::getInterfaceVersion, "uu"); + + + +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + RootInterfaceStub, + std::tuple<int32_t, std::string>, + std::tuple<RootInterface::testRootMethodError, int32_t, std::string> + > RootInterfaceDBusStubAdapterInternal::testRootMethodStubDispatcher(&RootInterfaceStub::testRootMethod, "iis", std::tuple<int32_t, std::string, RootInterface::testRootMethodError, int32_t, std::string>()); + + + + + +const RootInterfaceDBusStubAdapterHelper::StubDispatcherTable& RootInterfaceDBusStubAdapterInternal::getStubDispatcherTable() { + return stubDispatcherTable_; +} + +const CommonAPI::DBus::StubAttributeTable& RootInterfaceDBusStubAdapterInternal::getStubAttributeTable() { + return stubAttributeTable_; +} +bool RootInterfaceDBusStubAdapterInternal::registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub> _stub, const std::string &_instance) { + if (registeredLeafInterfaceInstances.find(_instance) == registeredLeafInterfaceInstances.end()) { + std::string itsAddress = "local:commonapi.tests.managed.LeafInterface:" + _instance; + CommonAPI::DBus::DBusAddress itsDBusAddress; + CommonAPI::DBus::DBusAddressTranslator::get()->translate(itsAddress, itsDBusAddress); + + std::string objectPath(itsDBusAddress.getObjectPath()); + std::string adapterObjectPath(getDBusAddress().getObjectPath()); + + if (objectPath.compare(0, adapterObjectPath.length(), adapterObjectPath) == 0) { + std::shared_ptr<CommonAPI::DBus::Factory> itsFactory = CommonAPI::DBus::Factory::get(); + + auto stubAdapter = itsFactory->createDBusStubAdapter(_stub, "commonapi.tests.managed.LeafInterface", itsDBusAddress, connection_); + bool isRegistered = itsFactory->registerManagedService(stubAdapter); + if (isRegistered) { + bool isExported = connection_->getDBusObjectManager()->exportManagedDBusStubAdapter(adapterObjectPath, stubAdapter); + if (isExported) { + registeredLeafInterfaceInstances.insert(_instance); + return true; + } else { + itsFactory->unregisterManagedService(itsAddress); + } + } + } + } + return false; +} + +bool RootInterfaceDBusStubAdapterInternal::deregisterManagedStubLeafInterface(const std::string &_instance) { + std::string itsAddress = "local:commonapi.tests.managed.LeafInterface:" + _instance; + if (registeredLeafInterfaceInstances.find(_instance) != registeredLeafInterfaceInstances.end()) { + std::shared_ptr<CommonAPI::DBus::Factory> itsFactory = CommonAPI::DBus::Factory::get(); + std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> stubAdapter + = itsFactory->getRegisteredService(itsAddress); + if (stubAdapter) { + connection_->getDBusObjectManager()->unexportManagedDBusStubAdapter( + getDBusAddress().getObjectPath(), stubAdapter); + itsFactory->unregisterManagedService(itsAddress); + registeredLeafInterfaceInstances.erase(_instance); + return true; + } + } + return false; +} + +std::set<std::string>& RootInterfaceDBusStubAdapterInternal::getLeafInterfaceInstances() { + return registeredLeafInterfaceInstances; +} +bool RootInterfaceDBusStubAdapterInternal::registerManagedStubBranchInterface(std::shared_ptr<BranchInterfaceStub> _stub, const std::string &_instance) { + if (registeredBranchInterfaceInstances.find(_instance) == registeredBranchInterfaceInstances.end()) { + std::string itsAddress = "local:commonapi.tests.managed.BranchInterface:" + _instance; + CommonAPI::DBus::DBusAddress itsDBusAddress; + CommonAPI::DBus::DBusAddressTranslator::get()->translate(itsAddress, itsDBusAddress); + + std::string objectPath(itsDBusAddress.getObjectPath()); + std::string adapterObjectPath(getDBusAddress().getObjectPath()); + + if (objectPath.compare(0, adapterObjectPath.length(), adapterObjectPath) == 0) { + std::shared_ptr<CommonAPI::DBus::Factory> itsFactory = CommonAPI::DBus::Factory::get(); + + auto stubAdapter = itsFactory->createDBusStubAdapter(_stub, "commonapi.tests.managed.BranchInterface", itsDBusAddress, connection_); + bool isRegistered = itsFactory->registerManagedService(stubAdapter); + if (isRegistered) { + bool isExported = connection_->getDBusObjectManager()->exportManagedDBusStubAdapter(adapterObjectPath, stubAdapter); + if (isExported) { + registeredBranchInterfaceInstances.insert(_instance); + return true; + } else { + itsFactory->unregisterManagedService(itsAddress); + } + } + } + } + return false; +} + +bool RootInterfaceDBusStubAdapterInternal::deregisterManagedStubBranchInterface(const std::string &_instance) { + std::string itsAddress = "local:commonapi.tests.managed.BranchInterface:" + _instance; + if (registeredBranchInterfaceInstances.find(_instance) != registeredBranchInterfaceInstances.end()) { + std::shared_ptr<CommonAPI::DBus::Factory> itsFactory = CommonAPI::DBus::Factory::get(); + std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> stubAdapter + = itsFactory->getRegisteredService(itsAddress); + if (stubAdapter) { + connection_->getDBusObjectManager()->unexportManagedDBusStubAdapter( + getDBusAddress().getObjectPath(), stubAdapter); + itsFactory->unregisterManagedService(itsAddress); + registeredBranchInterfaceInstances.erase(_instance); + return true; + } + } + return false; +} + +std::set<std::string>& RootInterfaceDBusStubAdapterInternal::getBranchInterfaceInstances() { + return registeredBranchInterfaceInstances; +} + +RootInterfaceDBusStubAdapterInternal::RootInterfaceDBusStubAdapterInternal( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) + : CommonAPI::DBus::DBusStubAdapter(_address, _connection,true), + RootInterfaceDBusStubAdapterHelper(_address, _connection, std::dynamic_pointer_cast<RootInterfaceStub>(_stub), true), + stubDispatcherTable_({ + { { "testRootMethod", "is" }, &commonapi::tests::managed::RootInterfaceDBusStubAdapterInternal::testRootMethodStubDispatcher } + }), + stubAttributeTable_() { + + stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &commonapi::tests::managed::RootInterfaceDBusStubAdapterInternal::getRootInterfaceInterfaceVersionStubDispatcher }); +} + +const bool RootInterfaceDBusStubAdapterInternal::hasFreedesktopProperties() { + return false; +} + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/RootInterfaceDBusStubAdapter.hpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/RootInterfaceDBusStubAdapter.hpp new file mode 100644 index 0000000..d5828a3 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/RootInterfaceDBusStubAdapter.hpp @@ -0,0 +1,113 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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_MANAGED_Root_Interface_DBUS_STUB_ADAPTER_HPP_ +#define COMMONAPI_TESTS_MANAGED_Root_Interface_DBUS_STUB_ADAPTER_HPP_ + +#include <v1_0/commonapi/tests/managed/RootInterfaceStub.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusAddressTranslator.hpp> +#include <CommonAPI/DBus/DBusFactory.hpp> +#include <CommonAPI/DBus/DBusObjectManager.hpp> +#include <CommonAPI/DBus/DBusStubAdapterHelper.hpp> +#include <CommonAPI/DBus/DBusStubAdapter.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +typedef CommonAPI::DBus::DBusStubAdapterHelper<RootInterfaceStub> RootInterfaceDBusStubAdapterHelper; + +class RootInterfaceDBusStubAdapterInternal + : public virtual RootInterfaceStubAdapter, + public RootInterfaceDBusStubAdapterHelper +{ +public: + RootInterfaceDBusStubAdapterInternal( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub); + + ~RootInterfaceDBusStubAdapterInternal(); + + virtual const bool hasFreedesktopProperties(); + + + + bool registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub>, const std::string&); + bool deregisterManagedStubLeafInterface(const std::string&); + std::set<std::string>& getLeafInterfaceInstances(); + bool registerManagedStubBranchInterface(std::shared_ptr<BranchInterfaceStub>, const std::string&); + bool deregisterManagedStubBranchInterface(const std::string&); + std::set<std::string>& getBranchInterfaceInstances(); + + const RootInterfaceDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable(); + const CommonAPI::DBus::StubAttributeTable& getStubAttributeTable(); + + void deactivateManagedInstances(); + + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + RootInterfaceStub, + CommonAPI::Version + > getRootInterfaceInterfaceVersionStubDispatcher; + + + +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + RootInterfaceStub, + std::tuple<int32_t, std::string>, + std::tuple<RootInterface::testRootMethodError, int32_t, std::string> + > testRootMethodStubDispatcher; + + + + + protected: + virtual const char* getMethodsDBusIntrospectionXmlData() const; + + private: + std::set<std::string> registeredLeafInterfaceInstances; + std::set<std::string> registeredBranchInterfaceInstances; + RootInterfaceDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_; + CommonAPI::DBus::StubAttributeTable stubAttributeTable_; +}; + +class RootInterfaceDBusStubAdapter + : public RootInterfaceDBusStubAdapterInternal, + public std::enable_shared_from_this<RootInterfaceDBusStubAdapter> { +public: + RootInterfaceDBusStubAdapter( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) + : CommonAPI::DBus::DBusStubAdapter( + _address, + _connection, + true), + RootInterfaceDBusStubAdapterInternal( + _address, + _connection, + _stub) { + } +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Root_Interface_DBUS_STUB_ADAPTER_HPP_ diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/SecondRootDBusProxy.cpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/SecondRootDBusProxy.cpp new file mode 100644 index 0000000..ba66245 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/SecondRootDBusProxy.cpp @@ -0,0 +1,52 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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/. +*/ +#include <v1_0/commonapi/tests/managed/SecondRootDBusProxy.hpp> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +std::shared_ptr<CommonAPI::DBus::DBusProxy> createSecondRootDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection) { + return std::make_shared<SecondRootDBusProxy>(_address, _connection); +} + +INITIALIZER(registerSecondRootDBusProxy) { + CommonAPI::DBus::Factory::get()->registerProxyCreateMethod( + SecondRoot::getInterface(), + &createSecondRootDBusProxy); +} + +SecondRootDBusProxy::SecondRootDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection) + : CommonAPI::DBus::DBusProxy(_address, _connection) +, proxyManagerLeafInterface_(*this, "commonapi.tests.managed.LeafInterface") +{ +} + + + + + CommonAPI::ProxyManager& SecondRootDBusProxy::getProxyManagerLeafInterface() { + return proxyManagerLeafInterface_; + } + + void SecondRootDBusProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const { + ownVersionMajor = 1; + ownVersionMinor = 0; + } + + } // namespace managed + } // namespace tests + } // namespace commonapi + } // namespace v1_0 diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/SecondRootDBusProxy.hpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/SecondRootDBusProxy.hpp new file mode 100644 index 0000000..80053ed --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/SecondRootDBusProxy.hpp @@ -0,0 +1,63 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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_MANAGED_Second_Root_DBUS_PROXY_HPP_ +#define COMMONAPI_TESTS_MANAGED_Second_Root_DBUS_PROXY_HPP_ + +#include <v1_0/commonapi/tests/managed/SecondRootProxyBase.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusAddress.hpp> +#include <CommonAPI/DBus/DBusFactory.hpp> +#include <CommonAPI/DBus/DBusProxy.hpp> +#include <CommonAPI/DBus/DBusProxyManager.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +#include <string> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +class SecondRootDBusProxy + : virtual public SecondRootProxyBase, + virtual public CommonAPI::DBus::DBusProxy { +public: + SecondRootDBusProxy( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection); + + virtual ~SecondRootDBusProxy() { } + + + + + virtual CommonAPI::ProxyManager& getProxyManagerLeafInterface(); + + virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const; + +private: + + + + CommonAPI::DBus::DBusProxyManager proxyManagerLeafInterface_; +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Second_Root_DBUS_PROXY_HPP_ + diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/SecondRootDBusStubAdapter.cpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/SecondRootDBusStubAdapter.cpp new file mode 100644 index 0000000..c42347e --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/SecondRootDBusStubAdapter.cpp @@ -0,0 +1,151 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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/. +*/ +#include <v1_0/commonapi/tests/managed/SecondRoot.hpp> +#include <v1_0/commonapi/tests/managed/SecondRootDBusStubAdapter.hpp> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createSecondRootDBusStubAdapter( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) { + return std::make_shared<SecondRootDBusStubAdapter>(_address, _connection, _stub); +} + +INITIALIZER(registerSecondRootDBusStubAdapter) { + CommonAPI::DBus::Factory::get()->registerStubAdapterCreateMethod( + SecondRoot::getInterface(), &createSecondRootDBusStubAdapter); +} + +SecondRootDBusStubAdapterInternal::~SecondRootDBusStubAdapterInternal() { + deactivateManagedInstances(); + SecondRootDBusStubAdapterHelper::deinit(); +} + +void SecondRootDBusStubAdapterInternal::deactivateManagedInstances() { + std::set<std::string>::iterator iter; + std::set<std::string>::iterator iterNext; + + iter = registeredLeafInterfaceInstances.begin(); + while (iter != registeredLeafInterfaceInstances.end()) { + iterNext = std::next(iter); + + if (deregisterManagedStubLeafInterface(*iter)) { + iter = iterNext; + } + else { + iter++; + } + } +} + +const char* SecondRootDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const { + static const std::string introspectionData = + "<method name=\"getInterfaceVersion\">\n" + "<arg name=\"value\" type=\"uu\" direction=\"out\" />" + "</method>\n" + + "" + ; + return introspectionData.c_str(); +} + +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + SecondRootStub, + CommonAPI::Version + > SecondRootDBusStubAdapterInternal::getSecondRootInterfaceVersionStubDispatcher(&SecondRootStub::getInterfaceVersion, "uu"); + + + + + + + + +const SecondRootDBusStubAdapterHelper::StubDispatcherTable& SecondRootDBusStubAdapterInternal::getStubDispatcherTable() { + return stubDispatcherTable_; +} + +const CommonAPI::DBus::StubAttributeTable& SecondRootDBusStubAdapterInternal::getStubAttributeTable() { + return stubAttributeTable_; +} +bool SecondRootDBusStubAdapterInternal::registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub> _stub, const std::string &_instance) { + if (registeredLeafInterfaceInstances.find(_instance) == registeredLeafInterfaceInstances.end()) { + std::string itsAddress = "local:commonapi.tests.managed.LeafInterface:" + _instance; + CommonAPI::DBus::DBusAddress itsDBusAddress; + CommonAPI::DBus::DBusAddressTranslator::get()->translate(itsAddress, itsDBusAddress); + + std::string objectPath(itsDBusAddress.getObjectPath()); + std::string adapterObjectPath(getDBusAddress().getObjectPath()); + + if (objectPath.compare(0, adapterObjectPath.length(), adapterObjectPath) == 0) { + std::shared_ptr<CommonAPI::DBus::Factory> itsFactory = CommonAPI::DBus::Factory::get(); + + auto stubAdapter = itsFactory->createDBusStubAdapter(_stub, "commonapi.tests.managed.LeafInterface", itsDBusAddress, connection_); + bool isRegistered = itsFactory->registerManagedService(stubAdapter); + if (isRegistered) { + bool isExported = connection_->getDBusObjectManager()->exportManagedDBusStubAdapter(adapterObjectPath, stubAdapter); + if (isExported) { + registeredLeafInterfaceInstances.insert(_instance); + return true; + } else { + itsFactory->unregisterManagedService(itsAddress); + } + } + } + } + return false; +} + +bool SecondRootDBusStubAdapterInternal::deregisterManagedStubLeafInterface(const std::string &_instance) { + std::string itsAddress = "local:commonapi.tests.managed.LeafInterface:" + _instance; + if (registeredLeafInterfaceInstances.find(_instance) != registeredLeafInterfaceInstances.end()) { + std::shared_ptr<CommonAPI::DBus::Factory> itsFactory = CommonAPI::DBus::Factory::get(); + std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> stubAdapter + = itsFactory->getRegisteredService(itsAddress); + if (stubAdapter) { + connection_->getDBusObjectManager()->unexportManagedDBusStubAdapter( + getDBusAddress().getObjectPath(), stubAdapter); + itsFactory->unregisterManagedService(itsAddress); + registeredLeafInterfaceInstances.erase(_instance); + return true; + } + } + return false; +} + +std::set<std::string>& SecondRootDBusStubAdapterInternal::getLeafInterfaceInstances() { + return registeredLeafInterfaceInstances; +} + +SecondRootDBusStubAdapterInternal::SecondRootDBusStubAdapterInternal( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) + : CommonAPI::DBus::DBusStubAdapter(_address, _connection,true), + SecondRootDBusStubAdapterHelper(_address, _connection, std::dynamic_pointer_cast<SecondRootStub>(_stub), true), + stubDispatcherTable_({ + }), + stubAttributeTable_() { + + stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &commonapi::tests::managed::SecondRootDBusStubAdapterInternal::getSecondRootInterfaceVersionStubDispatcher }); +} + +const bool SecondRootDBusStubAdapterInternal::hasFreedesktopProperties() { + return false; +} + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/SecondRootDBusStubAdapter.hpp b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/SecondRootDBusStubAdapter.hpp new file mode 100644 index 0000000..ee4b556 --- /dev/null +++ b/src/test/src-gen/dbus/v1_0/commonapi/tests/managed/SecondRootDBusStubAdapter.hpp @@ -0,0 +1,104 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* 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_MANAGED_Second_Root_DBUS_STUB_ADAPTER_HPP_ +#define COMMONAPI_TESTS_MANAGED_Second_Root_DBUS_STUB_ADAPTER_HPP_ + +#include <v1_0/commonapi/tests/managed/SecondRootStub.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusAddressTranslator.hpp> +#include <CommonAPI/DBus/DBusFactory.hpp> +#include <CommonAPI/DBus/DBusObjectManager.hpp> +#include <CommonAPI/DBus/DBusStubAdapterHelper.hpp> +#include <CommonAPI/DBus/DBusStubAdapter.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +typedef CommonAPI::DBus::DBusStubAdapterHelper<SecondRootStub> SecondRootDBusStubAdapterHelper; + +class SecondRootDBusStubAdapterInternal + : public virtual SecondRootStubAdapter, + public SecondRootDBusStubAdapterHelper +{ +public: + SecondRootDBusStubAdapterInternal( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub); + + ~SecondRootDBusStubAdapterInternal(); + + virtual const bool hasFreedesktopProperties(); + + + + bool registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub>, const std::string&); + bool deregisterManagedStubLeafInterface(const std::string&); + std::set<std::string>& getLeafInterfaceInstances(); + + const SecondRootDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable(); + const CommonAPI::DBus::StubAttributeTable& getStubAttributeTable(); + + void deactivateManagedInstances(); + + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + SecondRootStub, + CommonAPI::Version + > getSecondRootInterfaceVersionStubDispatcher; + + + + + + + + protected: + virtual const char* getMethodsDBusIntrospectionXmlData() const; + + private: + std::set<std::string> registeredLeafInterfaceInstances; + SecondRootDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_; + CommonAPI::DBus::StubAttributeTable stubAttributeTable_; +}; + +class SecondRootDBusStubAdapter + : public SecondRootDBusStubAdapterInternal, + public std::enable_shared_from_this<SecondRootDBusStubAdapter> { +public: + SecondRootDBusStubAdapter( + const CommonAPI::DBus::DBusAddress &_address, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection> &_connection, + const std::shared_ptr<CommonAPI::StubBase> &_stub) + : CommonAPI::DBus::DBusStubAdapter( + _address, + _connection, + true), + SecondRootDBusStubAdapterInternal( + _address, + _connection, + _stub) { + } +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Second_Root_DBUS_STUB_ADAPTER_HPP_ |