diff options
Diffstat (limited to 'src/test/src-gen/v1_0/commonapi/tests')
71 files changed, 7939 insertions, 0 deletions
diff --git a/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterface.hpp b/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterface.hpp new file mode 100644 index 0000000..07e4b4b --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterface.hpp @@ -0,0 +1,54 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_HPP_ +#define COMMONAPI_TESTS_EXTENDED_INTERFACE_HPP_ + + + +#include <v1_0/commonapi/tests/TestInterface.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/Types.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { + +class ExtendedInterface +: virtual public TestInterface { +public: + virtual ~ExtendedInterface() { } + + static inline const char* getInterface(); + static inline CommonAPI::Version getInterfaceVersion(); +}; + +const char* ExtendedInterface::getInterface() { + return ("commonapi.tests.ExtendedInterface"); +} + +CommonAPI::Version ExtendedInterface::getInterfaceVersion() { + return CommonAPI::Version(1, 0); +} + + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +namespace CommonAPI { +} + +#endif // COMMONAPI_TESTS_EXTENDED_INTERFACE_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceDBusProxy.cpp b/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceDBusProxy.cpp new file mode 100644 index 0000000..8290e55 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/ExtendedInterfaceDBusProxy.hpp b/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceDBusProxy.hpp new file mode 100644 index 0000000..1112a85 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/ExtendedInterfaceDBusStubAdapter.cpp b/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceDBusStubAdapter.cpp new file mode 100644 index 0000000..6cc2a36 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/ExtendedInterfaceDBusStubAdapter.hpp b/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceDBusStubAdapter.hpp new file mode 100644 index 0000000..41c986f --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/ExtendedInterfaceProxy.hpp b/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceProxy.hpp new file mode 100644 index 0000000..6c4a1e5 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceProxy.hpp @@ -0,0 +1,157 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_PROXY_HPP_ +#define COMMONAPI_TESTS_Extended_Interface_PROXY_HPP_ + +#include <v1_0/commonapi/tests/ExtendedInterfaceProxyBase.hpp> + +#include "v1_0/commonapi/tests/TestInterfaceProxy.hpp" + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { + +template <typename ... _AttributeExtensions> +class ExtendedInterfaceProxy + : virtual public ExtendedInterface, + virtual public ExtendedInterfaceProxyBase, + virtual public TestInterfaceProxy<_AttributeExtensions...>, + public _AttributeExtensions... { +public: + ExtendedInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate); + ~ExtendedInterfaceProxy(); + + typedef ExtendedInterface InterfaceType; + + inline static const char* getInterfaceId() { + return(ExtendedInterface::getInterfaceId()); + } + + + + /** + * Calls TestIntMethodExtended with synchronous semantics. + * + * All const parameters are input parameters to this method. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void TestIntMethodExtended(const uint32_t &_inInt, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls TestIntMethodExtended with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> TestIntMethodExtendedAsync(const uint32_t &_inInt, TestIntMethodExtendedAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr); + + + /** + * Returns the CommonAPI address of the remote partner this proxy communicates with. + */ + virtual const CommonAPI::Address &getAddress() const; + + /** + * Returns true if the remote partner for this proxy is currently known to be available. + */ + virtual bool isAvailable() const; + + /** + * Returns true if the remote partner for this proxy is available. + */ + virtual bool isAvailableBlocking() const; + + /** + * Returns the wrapper class that is used to (de-)register for notifications about + * the availability of the remote partner of this proxy. + */ + virtual CommonAPI::ProxyStatusEvent& getProxyStatusEvent(); + + /** + * Returns the wrapper class that is used to access version information of the remote + * partner of this proxy. + */ + virtual CommonAPI::InterfaceVersionAttribute& getInterfaceVersionAttribute(); + + private: + std::shared_ptr<ExtendedInterfaceProxyBase> delegate_; +}; + +typedef ExtendedInterfaceProxy<> ExtendedInterfaceProxyDefault; + + +// +// ExtendedInterfaceProxy Implementation +// +template <typename ... _AttributeExtensions> +ExtendedInterfaceProxy<_AttributeExtensions...>::ExtendedInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate): + TestInterfaceProxy<_AttributeExtensions...>(delegate), + _AttributeExtensions(*(std::dynamic_pointer_cast<ExtendedInterfaceProxyBase>(delegate)))..., + delegate_(std::dynamic_pointer_cast<ExtendedInterfaceProxyBase>(delegate)) { +} + +template <typename ... _AttributeExtensions> +ExtendedInterfaceProxy<_AttributeExtensions...>::~ExtendedInterfaceProxy() { +} + +template <typename ... _AttributeExtensions> +void ExtendedInterfaceProxy<_AttributeExtensions...>::TestIntMethodExtended(const uint32_t &_inInt, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info) { + delegate_->TestIntMethodExtended(_inInt, _status, _info); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> ExtendedInterfaceProxy<_AttributeExtensions...>::TestIntMethodExtendedAsync(const uint32_t &_inInt, TestIntMethodExtendedAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return delegate_->TestIntMethodExtendedAsync(_inInt, _callback, _info); +} + +template <typename ... _AttributeExtensions> +const CommonAPI::Address &ExtendedInterfaceProxy<_AttributeExtensions...>::getAddress() const { + return delegate_->getAddress(); +} + +template <typename ... _AttributeExtensions> +bool ExtendedInterfaceProxy<_AttributeExtensions...>::isAvailable() const { + return delegate_->isAvailable(); +} + +template <typename ... _AttributeExtensions> +bool ExtendedInterfaceProxy<_AttributeExtensions...>::isAvailableBlocking() const { + return delegate_->isAvailableBlocking(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::ProxyStatusEvent& ExtendedInterfaceProxy<_AttributeExtensions...>::getProxyStatusEvent() { + return delegate_->getProxyStatusEvent(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::InterfaceVersionAttribute& ExtendedInterfaceProxy<_AttributeExtensions...>::getInterfaceVersionAttribute() { + return delegate_->getInterfaceVersionAttribute(); +} + + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + + +#endif // COMMONAPI_TESTS_Extended_Interface_PROXY_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceProxyBase.hpp b/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceProxyBase.hpp new file mode 100644 index 0000000..5ab90c0 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceProxyBase.hpp @@ -0,0 +1,50 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_PROXY_BASE_HPP_ +#define COMMONAPI_TESTS_Extended_Interface_PROXY_BASE_HPP_ + +#include <v1_0/commonapi/tests/ExtendedInterface.hpp> +#include <v1_0/commonapi/tests/TestInterfaceProxyBase.hpp> + + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <vector> + +#include <CommonAPI/Proxy.hpp> +#include <functional> +#include <future> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { + +class ExtendedInterfaceProxyBase + : virtual public TestInterfaceProxyBase { +public: + + typedef std::function<void(const CommonAPI::CallStatus&)> TestIntMethodExtendedAsyncCallback; + + + + virtual void TestIntMethodExtended(const uint32_t &_inInt, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual std::future<CommonAPI::CallStatus> TestIntMethodExtendedAsync(const uint32_t &_inInt, TestIntMethodExtendedAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr) = 0; +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Extended_Interface_PROXY_BASE_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceStub.hpp b/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceStub.hpp new file mode 100644 index 0000000..96ec358 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceStub.hpp @@ -0,0 +1,108 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_STUB_HPP_ +#define COMMONAPI_TESTS_Extended_Interface_STUB_HPP_ + +#include <functional> + + + +#include <v1_0/commonapi/tests/TestInterfaceStub.hpp> + +#include <v1_0/commonapi/tests/ExtendedInterface.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <vector> + +#include <CommonAPI/Stub.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { + +/** + * Receives messages from remote and handles all dispatching of deserialized calls + * to a stub for the service ExtendedInterface. Also provides means to send broadcasts + * and attribute-changed-notifications of observable attributes as defined by this service. + * An application developer should not need to bother with this class. + */ +class ExtendedInterfaceStubAdapter + : virtual public CommonAPI::StubAdapter, + public ExtendedInterface, + public virtual TestInterfaceStubAdapter { + public: + + + + virtual void deactivateManagedInstances() = 0; +protected: + /** + * Defines properties for storing the ClientIds of clients / proxies that have + * subscribed to the selective broadcasts + */ +}; + +/** + * Defines the necessary callbacks to handle remote set events related to the attributes + * defined in the IDL description for ExtendedInterface. + * For each attribute two callbacks are defined: + * - a verification callback that allows to verify the requested value and to prevent setting + * e.g. an invalid value ("onRemoteSet<AttributeName>"). + * - an action callback to do local work after the attribute value has been changed + * ("onRemote<AttributeName>Changed"). + * + * This class and the one below are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class ExtendedInterfaceStubRemoteEvent +: public virtual TestInterfaceStubRemoteEvent +{ +public: + virtual ~ExtendedInterfaceStubRemoteEvent() { } + +}; + +/** + * Defines the interface that must be implemented by any class that should provide + * the service ExtendedInterface to remote clients. + * This class and the one above are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class ExtendedInterfaceStub + : public virtual CommonAPI::Stub<ExtendedInterfaceStubAdapter, ExtendedInterfaceStubRemoteEvent>, + public virtual TestInterfaceStub +{ +public: + typedef std::function<void ()> TestIntMethodExtendedReply_t; + + virtual ~ExtendedInterfaceStub() {} + virtual const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) = 0; + + + /// This is the method that will be called on remote calls on the method TestIntMethodExtended. + virtual void TestIntMethodExtended(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _inInt, TestIntMethodExtendedReply_t _reply) = 0; + + using CommonAPI::Stub<ExtendedInterfaceStubAdapter, ExtendedInterfaceStubRemoteEvent>::initStubAdapter; + typedef CommonAPI::Stub<ExtendedInterfaceStubAdapter, ExtendedInterfaceStubRemoteEvent>::StubAdapterType StubAdapterType; + typedef CommonAPI::Stub<ExtendedInterfaceStubAdapter, ExtendedInterfaceStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType; + typedef ExtendedInterfaceStubRemoteEvent RemoteEventType; + typedef ExtendedInterface StubInterface; +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Extended_Interface_STUB_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceStubDefault.cpp b/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceStubDefault.cpp new file mode 100644 index 0000000..ad918f2 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceStubDefault.cpp @@ -0,0 +1,47 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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/ExtendedInterfaceStubDefault.hpp> +#include <assert.h> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +ExtendedInterfaceStubDefault::ExtendedInterfaceStubDefault(): + remoteEventHandler_(this), + interfaceVersion_(ExtendedInterface::getInterfaceVersion()) { +} + +const CommonAPI::Version& ExtendedInterfaceStubDefault::getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client) { + return interfaceVersion_; +} + +ExtendedInterfaceStubRemoteEvent* ExtendedInterfaceStubDefault::initStubAdapter(const std::shared_ptr<ExtendedInterfaceStubAdapter> &_adapter) { + TestInterfaceStubDefault::initStubAdapter(_adapter); + CommonAPI::Stub<ExtendedInterfaceStubAdapter, ExtendedInterfaceStubRemoteEvent>::stubAdapter_ = _adapter; + return &remoteEventHandler_; +} + + +void ExtendedInterfaceStubDefault::TestIntMethodExtended(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _inInt, TestIntMethodExtendedReply_t _reply) { + _reply(); +} + + + + +ExtendedInterfaceStubDefault::RemoteEventHandler::RemoteEventHandler(ExtendedInterfaceStubDefault *_defaultStub) + : TestInterfaceStubDefault::RemoteEventHandler(_defaultStub), + defaultStub_(_defaultStub) { +} + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceStubDefault.hpp b/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceStubDefault.hpp new file mode 100644 index 0000000..30156c9 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/ExtendedInterfaceStubDefault.hpp @@ -0,0 +1,67 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_STUB_DEFAULT_HPP_ +#define COMMONAPI_TESTS_Extended_Interface_STUB_DEFAULT_HPP_ + +#include <v1_0/commonapi/tests/TestInterfaceStubDefault.hpp> + +#include <v1_0/commonapi/tests/ExtendedInterfaceStub.hpp> +#include <sstream> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +/** + * Provides a default implementation for ExtendedInterfaceStubRemoteEvent and + * ExtendedInterfaceStub. Method callbacks have an empty implementation, + * remote set calls on attributes will always change the value of the attribute + * to the one received. + * + * Override this stub if you only want to provide a subset of the functionality + * that would be defined for this service, and/or if you do not need any non-default + * behaviour. + */ +class ExtendedInterfaceStubDefault + : public virtual ExtendedInterfaceStub, + public virtual TestInterfaceStubDefault { +public: + ExtendedInterfaceStubDefault(); + + ExtendedInterfaceStubRemoteEvent* initStubAdapter(const std::shared_ptr<ExtendedInterfaceStubAdapter> &_adapter); + + const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client); + + + virtual void TestIntMethodExtended(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _inInt, TestIntMethodExtendedReply_t _reply); + + + +protected: + class RemoteEventHandler: public virtual ExtendedInterfaceStubRemoteEvent, public virtual TestInterfaceStubDefault::RemoteEventHandler { + public: + RemoteEventHandler(ExtendedInterfaceStubDefault *_defaultStub); + + + private: + ExtendedInterfaceStubDefault *defaultStub_; + }; +private: + ExtendedInterfaceStubDefault::RemoteEventHandler remoteEventHandler_; + + + CommonAPI::Version interfaceVersion_; +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Extended_Interface_STUB_DEFAULT diff --git a/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusProxy.cpp b/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusProxy.cpp new file mode 100644 index 0000000..79e680c --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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, getAddress().getInterface(), "TestAttributedFromDerivedInterface") +{ +} + + 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/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusProxy.hpp b/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusProxy.hpp new file mode 100644 index 0000000..bf46a6b --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusProxy.hpp @@ -0,0 +1,66 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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> +#include <CommonAPI/DBus/DBusFreedesktopAttribute.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: + typedef CommonAPI::Variant< + uint32_t + > FreedesktopVariant_t; + + CommonAPI::DBus::DBusFreedesktopObservableAttribute<CommonAPI::DBus::DBusFreedesktopAttribute<TestAttributedFromDerivedInterfaceAttribute>, FreedesktopVariant_t> 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/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusStubAdapter.cpp b/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusStubAdapter.cpp new file mode 100644 index 0000000..fdf7019 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusStubAdapter.cpp @@ -0,0 +1,215 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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()) + + "<property name=\"TestAttributedFromDerivedInterface\" type=\"u\" access=\"readwrite\" />\n" + + ; + return introspectionData.c_str(); +} + +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + CommonAPI::Version + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestFreedesktopDerivedInterfaceInterfaceVersionStubDispatcher(&TestFreedesktopDerivedInterfaceStub::getInterfaceVersion, "uu"); + +CommonAPI::DBus::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestAttributedFromDerivedInterfaceAttributeStubDispatcher(&TestFreedesktopDerivedInterfaceStub::getTestAttributedFromDerivedInterfaceAttribute); +CommonAPI::DBus::DBusSetFreedesktopObservableAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::setTestAttributedFromDerivedInterfaceAttributeStubDispatcher( + &TestFreedesktopDerivedInterfaceStub::getTestAttributedFromDerivedInterfaceAttribute, + &TestFreedesktopDerivedInterfaceStubRemoteEvent::onRemoteSetTestAttributedFromDerivedInterfaceAttribute, + &TestFreedesktopDerivedInterfaceStubRemoteEvent::onRemoteTestAttributedFromDerivedInterfaceAttributeChanged + ,&TestFreedesktopDerivedInterfaceStubAdapter::fireTestAttributedFromDerivedInterfaceAttributeChanged + ); + +#ifdef WIN32 +CommonAPI::DBus::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestPredefinedTypeAttributeAttributeStubDispatcher(&TestFreedesktopDerivedInterfaceStub::getTestPredefinedTypeAttributeAttribute); +CommonAPI::DBus::DBusSetFreedesktopObservableAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::setTestPredefinedTypeAttributeAttributeStubDispatcher( + &TestFreedesktopDerivedInterfaceStub::getTestPredefinedTypeAttributeAttribute, + &TestFreedesktopDerivedInterfaceStubRemoteEvent::onRemoteSetTestPredefinedTypeAttributeAttribute, + &TestFreedesktopDerivedInterfaceStubRemoteEvent::onRemoteTestPredefinedTypeAttributeAttributeChanged + ,&TestFreedesktopDerivedInterfaceStubAdapter::fireTestPredefinedTypeAttributeAttributeChanged + ); +CommonAPI::DBus::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestReadonlyAttributeAttributeStubDispatcher(&TestFreedesktopDerivedInterfaceStub::getTestReadonlyAttributeAttribute); +CommonAPI::DBus::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestDerivedStructAttributeAttributeStubDispatcher(&TestFreedesktopDerivedInterfaceStub::getTestDerivedStructAttributeAttribute); +CommonAPI::DBus::DBusSetFreedesktopObservableAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::setTestDerivedStructAttributeAttributeStubDispatcher( + &TestFreedesktopDerivedInterfaceStub::getTestDerivedStructAttributeAttribute, + &TestFreedesktopDerivedInterfaceStubRemoteEvent::onRemoteSetTestDerivedStructAttributeAttribute, + &TestFreedesktopDerivedInterfaceStubRemoteEvent::onRemoteTestDerivedStructAttributeAttributeChanged + ,&TestFreedesktopDerivedInterfaceStubAdapter::fireTestDerivedStructAttributeAttributeChanged + ); +CommonAPI::DBus::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestDerivedArrayAttributeAttributeStubDispatcher(&TestFreedesktopDerivedInterfaceStub::getTestDerivedArrayAttributeAttribute); +CommonAPI::DBus::DBusSetFreedesktopObservableAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::setTestDerivedArrayAttributeAttributeStubDispatcher( + &TestFreedesktopDerivedInterfaceStub::getTestDerivedArrayAttributeAttribute, + &TestFreedesktopDerivedInterfaceStubRemoteEvent::onRemoteSetTestDerivedArrayAttributeAttribute, + &TestFreedesktopDerivedInterfaceStubRemoteEvent::onRemoteTestDerivedArrayAttributeAttributeChanged + ,&TestFreedesktopDerivedInterfaceStubAdapter::fireTestDerivedArrayAttributeAttributeChanged + ); +#endif + + +#ifdef WIN32 +#endif + +void TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::fireTestAttributedFromDerivedInterfaceAttributeChanged(const uint32_t& value) { + CommonAPI::DBus::DBusStubFreedesktopPropertiesSignalHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t>> + ::sendPropertiesChangedSignal( + *this, + "TestAttributedFromDerivedInterface", + 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_({ + #ifdef WIN32 + #endif + }), + stubAttributeTable_({ + { + "TestAttributedFromDerivedInterface", + { + &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestAttributedFromDerivedInterfaceAttributeStubDispatcher, + &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::setTestAttributedFromDerivedInterfaceAttributeStubDispatcher + } + } + #ifdef WIN32 + , + { + "TestPredefinedTypeAttribute", + { + &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestPredefinedTypeAttributeAttributeStubDispatcher, + &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::setTestPredefinedTypeAttributeAttributeStubDispatcher + } + }, + { + "TestReadonlyAttribute", + { + &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestReadonlyAttributeAttributeStubDispatcher, + NULL + } + }, + { + "TestDerivedStructAttribute", + { + &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestDerivedStructAttributeAttributeStubDispatcher, + &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::setTestDerivedStructAttributeAttributeStubDispatcher + } + }, + { + "TestDerivedArrayAttribute", + { + &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::getTestDerivedArrayAttributeAttributeStubDispatcher, + &commonapi::tests::TestFreedesktopDerivedInterfaceDBusStubAdapterInternal::setTestDerivedArrayAttributeAttributeStubDispatcher + } + } + #endif + } + ) { + + #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 true; +} + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusStubAdapter.hpp b/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusStubAdapter.hpp new file mode 100644 index 0000000..daecd30 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceDBusStubAdapter.hpp @@ -0,0 +1,161 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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> +#include <CommonAPI/DBus/DBusFreedesktopStubAdapterHelper.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::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > getTestAttributedFromDerivedInterfaceAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetFreedesktopObservableAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > setTestAttributedFromDerivedInterfaceAttributeStubDispatcher; + +#ifdef WIN32 +static CommonAPI::DBus::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > getTestPredefinedTypeAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetFreedesktopObservableAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > setTestPredefinedTypeAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + uint32_t + > getTestReadonlyAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > getTestDerivedStructAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetFreedesktopObservableAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > setTestDerivedStructAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopDerivedInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > getTestDerivedArrayAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetFreedesktopObservableAttributeStubDispatcher< + 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/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusProxy.cpp b/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusProxy.cpp new file mode 100644 index 0000000..8305c98 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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, getAddress().getInterface(), "TestPredefinedTypeAttribute"), + testReadonlyAttribute_(*this, getAddress().getInterface(), "TestReadonlyAttribute"), + testDerivedStructAttribute_(*this, getAddress().getInterface(), "TestDerivedStructAttribute"), + testDerivedArrayAttribute_(*this, getAddress().getInterface(), "TestDerivedArrayAttribute") +{ +} + + 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/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusProxy.hpp b/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusProxy.hpp new file mode 100644 index 0000000..c34ced8 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusProxy.hpp @@ -0,0 +1,74 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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> +#include <CommonAPI/DBus/DBusFreedesktopAttribute.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: + typedef CommonAPI::Variant< + uint32_t, + uint32_t, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > FreedesktopVariant_t; + + CommonAPI::DBus::DBusFreedesktopObservableAttribute<CommonAPI::DBus::DBusFreedesktopAttribute<TestPredefinedTypeAttributeAttribute>, FreedesktopVariant_t> testPredefinedTypeAttribute_; + CommonAPI::DBus::DBusFreedesktopObservableAttribute<CommonAPI::DBus::DBusFreedesktopReadonlyAttribute<TestReadonlyAttributeAttribute>, FreedesktopVariant_t> testReadonlyAttribute_; + CommonAPI::DBus::DBusFreedesktopObservableAttribute<CommonAPI::DBus::DBusFreedesktopAttribute<TestDerivedStructAttributeAttribute>, FreedesktopVariant_t> testDerivedStructAttribute_; + CommonAPI::DBus::DBusFreedesktopObservableAttribute<CommonAPI::DBus::DBusFreedesktopAttribute<TestDerivedArrayAttributeAttribute>, FreedesktopVariant_t> testDerivedArrayAttribute_; + + +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Test_Freedesktop_Interface_DBUS_PROXY_HPP_ + diff --git a/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusStubAdapter.cpp b/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusStubAdapter.cpp new file mode 100644 index 0000000..9189b8b --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusStubAdapter.cpp @@ -0,0 +1,196 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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" + "<property name=\"TestPredefinedTypeAttribute\" type=\"u\" access=\"readwrite\" />\n" + "<property name=\"TestReadonlyAttribute\" type=\"u\" access=\"read\" />\n" + "<property name=\"TestDerivedStructAttribute\" type=\"(sqi)\" access=\"readwrite\" />\n" + "<property name=\"TestDerivedArrayAttribute\" type=\"at\" access=\"readwrite\" />\n" + + ; + return introspectionData.c_str(); +} + +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + CommonAPI::Version + > TestFreedesktopInterfaceDBusStubAdapterInternal::getTestFreedesktopInterfaceInterfaceVersionStubDispatcher(&TestFreedesktopInterfaceStub::getInterfaceVersion, "uu"); + +CommonAPI::DBus::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + uint32_t + > TestFreedesktopInterfaceDBusStubAdapterInternal::getTestPredefinedTypeAttributeAttributeStubDispatcher(&TestFreedesktopInterfaceStub::getTestPredefinedTypeAttributeAttribute); +CommonAPI::DBus::DBusSetFreedesktopObservableAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + uint32_t + > TestFreedesktopInterfaceDBusStubAdapterInternal::setTestPredefinedTypeAttributeAttributeStubDispatcher( + &TestFreedesktopInterfaceStub::getTestPredefinedTypeAttributeAttribute, + &TestFreedesktopInterfaceStubRemoteEvent::onRemoteSetTestPredefinedTypeAttributeAttribute, + &TestFreedesktopInterfaceStubRemoteEvent::onRemoteTestPredefinedTypeAttributeAttributeChanged + ,&TestFreedesktopInterfaceStubAdapter::fireTestPredefinedTypeAttributeAttributeChanged + ); +CommonAPI::DBus::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + uint32_t + > TestFreedesktopInterfaceDBusStubAdapterInternal::getTestReadonlyAttributeAttributeStubDispatcher(&TestFreedesktopInterfaceStub::getTestReadonlyAttributeAttribute); +CommonAPI::DBus::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > TestFreedesktopInterfaceDBusStubAdapterInternal::getTestDerivedStructAttributeAttributeStubDispatcher(&TestFreedesktopInterfaceStub::getTestDerivedStructAttributeAttribute); +CommonAPI::DBus::DBusSetFreedesktopObservableAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > TestFreedesktopInterfaceDBusStubAdapterInternal::setTestDerivedStructAttributeAttributeStubDispatcher( + &TestFreedesktopInterfaceStub::getTestDerivedStructAttributeAttribute, + &TestFreedesktopInterfaceStubRemoteEvent::onRemoteSetTestDerivedStructAttributeAttribute, + &TestFreedesktopInterfaceStubRemoteEvent::onRemoteTestDerivedStructAttributeAttributeChanged + ,&TestFreedesktopInterfaceStubAdapter::fireTestDerivedStructAttributeAttributeChanged + ); +CommonAPI::DBus::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > TestFreedesktopInterfaceDBusStubAdapterInternal::getTestDerivedArrayAttributeAttributeStubDispatcher(&TestFreedesktopInterfaceStub::getTestDerivedArrayAttributeAttribute); +CommonAPI::DBus::DBusSetFreedesktopObservableAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > TestFreedesktopInterfaceDBusStubAdapterInternal::setTestDerivedArrayAttributeAttributeStubDispatcher( + &TestFreedesktopInterfaceStub::getTestDerivedArrayAttributeAttribute, + &TestFreedesktopInterfaceStubRemoteEvent::onRemoteSetTestDerivedArrayAttributeAttribute, + &TestFreedesktopInterfaceStubRemoteEvent::onRemoteTestDerivedArrayAttributeAttributeChanged + ,&TestFreedesktopInterfaceStubAdapter::fireTestDerivedArrayAttributeAttributeChanged + ); + + + + +void TestFreedesktopInterfaceDBusStubAdapterInternal::fireTestPredefinedTypeAttributeAttributeChanged(const uint32_t& value) { + CommonAPI::DBus::DBusStubFreedesktopPropertiesSignalHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t>> + ::sendPropertiesChangedSignal( + *this, + "TestPredefinedTypeAttribute", + value + ); +} +void TestFreedesktopInterfaceDBusStubAdapterInternal::fireTestReadonlyAttributeAttributeChanged(const uint32_t& value) { + CommonAPI::DBus::DBusStubFreedesktopPropertiesSignalHelper<CommonAPI::DBus::DBusSerializableArguments<uint32_t>> + ::sendPropertiesChangedSignal( + *this, + "TestReadonlyAttribute", + value + ); +} +void TestFreedesktopInterfaceDBusStubAdapterInternal::fireTestDerivedStructAttributeAttributeChanged(const ::commonapi::tests::DerivedTypeCollection::TestStructExtended& value) { + CommonAPI::DBus::DBusStubFreedesktopPropertiesSignalHelper<CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::TestStructExtended>> + ::sendPropertiesChangedSignal( + *this, + "TestDerivedStructAttribute", + value + ); +} +void TestFreedesktopInterfaceDBusStubAdapterInternal::fireTestDerivedArrayAttributeAttributeChanged(const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64& value) { + CommonAPI::DBus::DBusStubFreedesktopPropertiesSignalHelper<CommonAPI::DBus::DBusSerializableArguments<::commonapi::tests::DerivedTypeCollection::TestArrayUInt64>> + ::sendPropertiesChangedSignal( + *this, + "TestDerivedArrayAttribute", + 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_({ + }), + stubAttributeTable_({ + { + "TestPredefinedTypeAttribute", + { + &commonapi::tests::TestFreedesktopInterfaceDBusStubAdapterInternal::getTestPredefinedTypeAttributeAttributeStubDispatcher, + &commonapi::tests::TestFreedesktopInterfaceDBusStubAdapterInternal::setTestPredefinedTypeAttributeAttributeStubDispatcher + } + }, + { + "TestReadonlyAttribute", + { + &commonapi::tests::TestFreedesktopInterfaceDBusStubAdapterInternal::getTestReadonlyAttributeAttributeStubDispatcher, + NULL + } + }, + { + "TestDerivedStructAttribute", + { + &commonapi::tests::TestFreedesktopInterfaceDBusStubAdapterInternal::getTestDerivedStructAttributeAttributeStubDispatcher, + &commonapi::tests::TestFreedesktopInterfaceDBusStubAdapterInternal::setTestDerivedStructAttributeAttributeStubDispatcher + } + }, + { + "TestDerivedArrayAttribute", + { + &commonapi::tests::TestFreedesktopInterfaceDBusStubAdapterInternal::getTestDerivedArrayAttributeAttributeStubDispatcher, + &commonapi::tests::TestFreedesktopInterfaceDBusStubAdapterInternal::setTestDerivedArrayAttributeAttributeStubDispatcher + } + } + } + ) { + + stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &commonapi::tests::TestFreedesktopInterfaceDBusStubAdapterInternal::getTestFreedesktopInterfaceInterfaceVersionStubDispatcher }); +} + +const bool TestFreedesktopInterfaceDBusStubAdapterInternal::hasFreedesktopProperties() { + return true; +} + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusStubAdapter.hpp b/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusStubAdapter.hpp new file mode 100644 index 0000000..7695ff3 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/TestFreedesktopInterfaceDBusStubAdapter.hpp @@ -0,0 +1,129 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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> +#include <CommonAPI/DBus/DBusFreedesktopStubAdapterHelper.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::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + uint32_t + > getTestPredefinedTypeAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetFreedesktopObservableAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + uint32_t + > setTestPredefinedTypeAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + uint32_t + > getTestReadonlyAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > getTestDerivedStructAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetFreedesktopObservableAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestStructExtended + > setTestDerivedStructAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusGetFreedesktopAttributeStubDispatcher< + TestFreedesktopInterfaceStub, + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 + > getTestDerivedArrayAttributeAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetFreedesktopObservableAttributeStubDispatcher< + 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/v1_0/commonapi/tests/TestInterface.hpp b/src/test/src-gen/v1_0/commonapi/tests/TestInterface.hpp new file mode 100644 index 0000000..fae3886 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/TestInterface.hpp @@ -0,0 +1,52 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_HPP_ +#define COMMONAPI_TESTS_TEST_INTERFACE_HPP_ + + + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/Types.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { + +class TestInterface { +public: + virtual ~TestInterface() { } + + static inline const char* getInterface(); + static inline CommonAPI::Version getInterfaceVersion(); +}; + +const char* TestInterface::getInterface() { + return ("commonapi.tests.TestInterface"); +} + +CommonAPI::Version TestInterface::getInterfaceVersion() { + return CommonAPI::Version(1, 0); +} + + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +namespace CommonAPI { +} + +#endif // COMMONAPI_TESTS_TEST_INTERFACE_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceDBusProxy.cpp b/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceDBusProxy.cpp new file mode 100644 index 0000000..0854131 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/TestInterfaceDBusProxy.hpp b/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceDBusProxy.hpp new file mode 100644 index 0000000..52f30b3 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/TestInterfaceDBusStubAdapter.cpp b/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceDBusStubAdapter.cpp new file mode 100644 index 0000000..c2e343a --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/TestInterfaceDBusStubAdapter.hpp b/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceDBusStubAdapter.hpp new file mode 100644 index 0000000..8d42c65 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/TestInterfaceProxy.hpp b/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceProxy.hpp new file mode 100644 index 0000000..94da6c8 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceProxy.hpp @@ -0,0 +1,501 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_PROXY_HPP_ +#define COMMONAPI_TESTS_Test_Interface_PROXY_HPP_ + +#include <v1_0/commonapi/tests/TestInterfaceProxyBase.hpp> + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/AttributeExtension.hpp> +#include <CommonAPI/Factory.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { + +template <typename ... _AttributeExtensions> +class TestInterfaceProxy + : virtual public TestInterface, + virtual public TestInterfaceProxyBase, + public _AttributeExtensions... { +public: + TestInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate); + ~TestInterfaceProxy(); + + typedef TestInterface InterfaceType; + + + /** + * Returns the wrapper class that provides access to the attribute TestPredefinedTypeAttribute. + */ + virtual TestPredefinedTypeAttributeAttribute& getTestPredefinedTypeAttributeAttribute() { + return delegate_->getTestPredefinedTypeAttributeAttribute(); + } + /** + * Returns the wrapper class that provides access to the attribute TestDerivedStructAttribute. + */ + virtual TestDerivedStructAttributeAttribute& getTestDerivedStructAttributeAttribute() { + return delegate_->getTestDerivedStructAttributeAttribute(); + } + /** + * Returns the wrapper class that provides access to the attribute TestDerivedArrayAttribute. + */ + virtual TestDerivedArrayAttributeAttribute& getTestDerivedArrayAttributeAttribute() { + return delegate_->getTestDerivedArrayAttributeAttribute(); + } + + /** + * Returns the wrapper class that provides access to the broadcast TestPredefinedTypeBroadcast. + */ + virtual TestPredefinedTypeBroadcastEvent& getTestPredefinedTypeBroadcastEvent() { + return delegate_->getTestPredefinedTypeBroadcastEvent(); + } + /** + * Returns the wrapper class that provides access to the broadcast TestSelectiveBroadcast. + */ + virtual TestSelectiveBroadcastSelectiveEvent& getTestSelectiveBroadcastSelectiveEvent() { + return delegate_->getTestSelectiveBroadcastSelectiveEvent(); + } + /** + * Returns the wrapper class that provides access to the broadcast TestBroadcastWithOutArgs. + */ + virtual TestBroadcastWithOutArgsSelectiveEvent& getTestBroadcastWithOutArgsSelectiveEvent() { + return delegate_->getTestBroadcastWithOutArgsSelectiveEvent(); + } + + /** + * Calls testEmptyMethod with synchronous semantics. + * + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void testEmptyMethod(CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls testEmptyMethod with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> testEmptyMethodAsync(TestEmptyMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls testVoidPredefinedTypeMethod with synchronous semantics. + * + * All const parameters are input parameters to this method. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void testVoidPredefinedTypeMethod(const uint32_t &_uint32Value, const std::string &_stringValue, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls testVoidPredefinedTypeMethod with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> testVoidPredefinedTypeMethodAsync(const uint32_t &_uint32Value, const std::string &_stringValue, TestVoidPredefinedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls testPredefinedTypeMethod with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void testPredefinedTypeMethod(const uint32_t &_uint32InValue, const std::string &_stringInValue, CommonAPI::CallStatus &_status, uint32_t &_uint32OutValue, std::string &_stringOutValue, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls testPredefinedTypeMethod with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> testPredefinedTypeMethodAsync(const uint32_t &_uint32InValue, const std::string &_stringInValue, TestPredefinedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls testVoidDerivedTypeMethod with synchronous semantics. + * + * All const parameters are input parameters to this method. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void testVoidDerivedTypeMethod(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2Value, const ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapValue, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls testVoidDerivedTypeMethod with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> testVoidDerivedTypeMethodAsync(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2Value, const ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapValue, TestVoidDerivedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls testDerivedTypeMethod with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void 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 = nullptr); + /** + * Calls testDerivedTypeMethod with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> testDerivedTypeMethodAsync(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2InValue, const ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapInValue, TestDerivedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls TestArrayOfPolymorphicStructMethod with synchronous semantics. + * + * All const parameters are input parameters to this method. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void TestArrayOfPolymorphicStructMethod(const std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>> &_inArray, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls TestArrayOfPolymorphicStructMethod with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> TestArrayOfPolymorphicStructMethodAsync(const std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>> &_inArray, TestArrayOfPolymorphicStructMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls TestMapOfPolymorphicStructMethod with synchronous semantics. + * + * All const parameters are input parameters to this method. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void TestMapOfPolymorphicStructMethod(const ::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic &_inMap, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls TestMapOfPolymorphicStructMethod with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> TestMapOfPolymorphicStructMethodAsync(const ::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic &_inMap, TestMapOfPolymorphicStructMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls TestStructWithPolymorphicMemberMethod with synchronous semantics. + * + * All const parameters are input parameters to this method. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void TestStructWithPolymorphicMemberMethod(const ::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember &_inStruct, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls TestStructWithPolymorphicMemberMethod with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> TestStructWithPolymorphicMemberMethodAsync(const ::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember &_inStruct, TestStructWithPolymorphicMemberMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls TestStructWithEnumKeyMapMember with synchronous semantics. + * + * All const parameters are input parameters to this method. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void TestStructWithEnumKeyMapMember(const ::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap &_inStruct, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls TestStructWithEnumKeyMapMember with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> TestStructWithEnumKeyMapMemberAsync(const ::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap &_inStruct, TestStructWithEnumKeyMapMemberAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr); + + + /** + * Returns the CommonAPI address of the remote partner this proxy communicates with. + */ + virtual const CommonAPI::Address &getAddress() const; + + /** + * Returns true if the remote partner for this proxy is currently known to be available. + */ + virtual bool isAvailable() const; + + /** + * Returns true if the remote partner for this proxy is available. + */ + virtual bool isAvailableBlocking() const; + + /** + * Returns the wrapper class that is used to (de-)register for notifications about + * the availability of the remote partner of this proxy. + */ + virtual CommonAPI::ProxyStatusEvent& getProxyStatusEvent(); + + /** + * Returns the wrapper class that is used to access version information of the remote + * partner of this proxy. + */ + virtual CommonAPI::InterfaceVersionAttribute& getInterfaceVersionAttribute(); + + private: + std::shared_ptr<TestInterfaceProxyBase> delegate_; +}; + +typedef TestInterfaceProxy<> TestInterfaceProxyDefault; + +namespace TestInterfaceExtensions { + template <template <typename > class _ExtensionType> + class TestPredefinedTypeAttributeAttributeExtension { + public: + typedef _ExtensionType<TestInterfaceProxyBase::TestPredefinedTypeAttributeAttribute> extension_type; + + static_assert(std::is_base_of<typename CommonAPI::AttributeExtension<TestInterfaceProxyBase::TestPredefinedTypeAttributeAttribute>, extension_type>::value, + "Not CommonAPI Attribute Extension!"); + #ifdef WIN32 + TestPredefinedTypeAttributeAttributeExtension() {} + #endif + + TestPredefinedTypeAttributeAttributeExtension(TestInterfaceProxyBase& proxy): attributeExtension_(proxy.getTestPredefinedTypeAttributeAttribute()) { + } + + inline extension_type& getTestPredefinedTypeAttributeAttributeExtension() { + return attributeExtension_; + } + + private: + extension_type attributeExtension_; + }; + + template <template <typename > class _ExtensionType> + class TestDerivedStructAttributeAttributeExtension { + public: + typedef _ExtensionType<TestInterfaceProxyBase::TestDerivedStructAttributeAttribute> extension_type; + + static_assert(std::is_base_of<typename CommonAPI::AttributeExtension<TestInterfaceProxyBase::TestDerivedStructAttributeAttribute>, extension_type>::value, + "Not CommonAPI Attribute Extension!"); + #ifdef WIN32 + TestDerivedStructAttributeAttributeExtension() {} + #endif + + TestDerivedStructAttributeAttributeExtension(TestInterfaceProxyBase& proxy): attributeExtension_(proxy.getTestDerivedStructAttributeAttribute()) { + } + + inline extension_type& getTestDerivedStructAttributeAttributeExtension() { + return attributeExtension_; + } + + private: + extension_type attributeExtension_; + }; + + template <template <typename > class _ExtensionType> + class TestDerivedArrayAttributeAttributeExtension { + public: + typedef _ExtensionType<TestInterfaceProxyBase::TestDerivedArrayAttributeAttribute> extension_type; + + static_assert(std::is_base_of<typename CommonAPI::AttributeExtension<TestInterfaceProxyBase::TestDerivedArrayAttributeAttribute>, extension_type>::value, + "Not CommonAPI Attribute Extension!"); + #ifdef WIN32 + TestDerivedArrayAttributeAttributeExtension() {} + #endif + + TestDerivedArrayAttributeAttributeExtension(TestInterfaceProxyBase& proxy): attributeExtension_(proxy.getTestDerivedArrayAttributeAttribute()) { + } + + inline extension_type& getTestDerivedArrayAttributeAttributeExtension() { + return attributeExtension_; + } + + private: + extension_type attributeExtension_; + }; + +} // namespace TestInterfaceExtensions + +// +// TestInterfaceProxy Implementation +// +template <typename ... _AttributeExtensions> +TestInterfaceProxy<_AttributeExtensions...>::TestInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate): + _AttributeExtensions(*(std::dynamic_pointer_cast<TestInterfaceProxyBase>(delegate)))..., + delegate_(std::dynamic_pointer_cast<TestInterfaceProxyBase>(delegate)) { +} + +template <typename ... _AttributeExtensions> +TestInterfaceProxy<_AttributeExtensions...>::~TestInterfaceProxy() { +} + +template <typename ... _AttributeExtensions> +void TestInterfaceProxy<_AttributeExtensions...>::testEmptyMethod(CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info) { + delegate_->testEmptyMethod(_status, _info); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> TestInterfaceProxy<_AttributeExtensions...>::testEmptyMethodAsync(TestEmptyMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return delegate_->testEmptyMethodAsync(_callback, _info); +} +template <typename ... _AttributeExtensions> +void TestInterfaceProxy<_AttributeExtensions...>::testVoidPredefinedTypeMethod(const uint32_t &_uint32Value, const std::string &_stringValue, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info) { + delegate_->testVoidPredefinedTypeMethod(_uint32Value, _stringValue, _status, _info); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> TestInterfaceProxy<_AttributeExtensions...>::testVoidPredefinedTypeMethodAsync(const uint32_t &_uint32Value, const std::string &_stringValue, TestVoidPredefinedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return delegate_->testVoidPredefinedTypeMethodAsync(_uint32Value, _stringValue, _callback, _info); +} +template <typename ... _AttributeExtensions> +void TestInterfaceProxy<_AttributeExtensions...>::testPredefinedTypeMethod(const uint32_t &_uint32InValue, const std::string &_stringInValue, CommonAPI::CallStatus &_status, uint32_t &_uint32OutValue, std::string &_stringOutValue, const CommonAPI::CallInfo *_info) { + delegate_->testPredefinedTypeMethod(_uint32InValue, _stringInValue, _status, _uint32OutValue, _stringOutValue, _info); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> TestInterfaceProxy<_AttributeExtensions...>::testPredefinedTypeMethodAsync(const uint32_t &_uint32InValue, const std::string &_stringInValue, TestPredefinedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return delegate_->testPredefinedTypeMethodAsync(_uint32InValue, _stringInValue, _callback, _info); +} +template <typename ... _AttributeExtensions> +void TestInterfaceProxy<_AttributeExtensions...>::testVoidDerivedTypeMethod(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2Value, const ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapValue, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info) { + delegate_->testVoidDerivedTypeMethod(_testEnumExtended2Value, _testMapValue, _status, _info); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> TestInterfaceProxy<_AttributeExtensions...>::testVoidDerivedTypeMethodAsync(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2Value, const ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapValue, TestVoidDerivedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return delegate_->testVoidDerivedTypeMethodAsync(_testEnumExtended2Value, _testMapValue, _callback, _info); +} +template <typename ... _AttributeExtensions> +void TestInterfaceProxy<_AttributeExtensions...>::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) { + delegate_->testDerivedTypeMethod(_testEnumExtended2InValue, _testMapInValue, _status, _testEnumExtended2OutValue, _testMapOutValue, _info); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> TestInterfaceProxy<_AttributeExtensions...>::testDerivedTypeMethodAsync(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2InValue, const ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapInValue, TestDerivedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return delegate_->testDerivedTypeMethodAsync(_testEnumExtended2InValue, _testMapInValue, _callback, _info); +} +template <typename ... _AttributeExtensions> +void TestInterfaceProxy<_AttributeExtensions...>::TestArrayOfPolymorphicStructMethod(const std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>> &_inArray, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info) { + delegate_->TestArrayOfPolymorphicStructMethod(_inArray, _status, _info); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> TestInterfaceProxy<_AttributeExtensions...>::TestArrayOfPolymorphicStructMethodAsync(const std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>> &_inArray, TestArrayOfPolymorphicStructMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return delegate_->TestArrayOfPolymorphicStructMethodAsync(_inArray, _callback, _info); +} +template <typename ... _AttributeExtensions> +void TestInterfaceProxy<_AttributeExtensions...>::TestMapOfPolymorphicStructMethod(const ::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic &_inMap, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info) { + delegate_->TestMapOfPolymorphicStructMethod(_inMap, _status, _info); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> TestInterfaceProxy<_AttributeExtensions...>::TestMapOfPolymorphicStructMethodAsync(const ::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic &_inMap, TestMapOfPolymorphicStructMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return delegate_->TestMapOfPolymorphicStructMethodAsync(_inMap, _callback, _info); +} +template <typename ... _AttributeExtensions> +void TestInterfaceProxy<_AttributeExtensions...>::TestStructWithPolymorphicMemberMethod(const ::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember &_inStruct, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info) { + delegate_->TestStructWithPolymorphicMemberMethod(_inStruct, _status, _info); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> TestInterfaceProxy<_AttributeExtensions...>::TestStructWithPolymorphicMemberMethodAsync(const ::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember &_inStruct, TestStructWithPolymorphicMemberMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return delegate_->TestStructWithPolymorphicMemberMethodAsync(_inStruct, _callback, _info); +} +template <typename ... _AttributeExtensions> +void TestInterfaceProxy<_AttributeExtensions...>::TestStructWithEnumKeyMapMember(const ::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap &_inStruct, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info) { + delegate_->TestStructWithEnumKeyMapMember(_inStruct, _status, _info); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> TestInterfaceProxy<_AttributeExtensions...>::TestStructWithEnumKeyMapMemberAsync(const ::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap &_inStruct, TestStructWithEnumKeyMapMemberAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return delegate_->TestStructWithEnumKeyMapMemberAsync(_inStruct, _callback, _info); +} + +template <typename ... _AttributeExtensions> +const CommonAPI::Address &TestInterfaceProxy<_AttributeExtensions...>::getAddress() const { + return delegate_->getAddress(); +} + +template <typename ... _AttributeExtensions> +bool TestInterfaceProxy<_AttributeExtensions...>::isAvailable() const { + return delegate_->isAvailable(); +} + +template <typename ... _AttributeExtensions> +bool TestInterfaceProxy<_AttributeExtensions...>::isAvailableBlocking() const { + return delegate_->isAvailableBlocking(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::ProxyStatusEvent& TestInterfaceProxy<_AttributeExtensions...>::getProxyStatusEvent() { + return delegate_->getProxyStatusEvent(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::InterfaceVersionAttribute& TestInterfaceProxy<_AttributeExtensions...>::getInterfaceVersionAttribute() { + return delegate_->getInterfaceVersionAttribute(); +} + + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +namespace CommonAPI { +template<template<typename > class _AttributeExtension> +struct DefaultAttributeProxyHelper<::v1_0::commonapi::tests::TestInterfaceProxy, + _AttributeExtension> { + typedef typename ::v1_0::commonapi::tests::TestInterfaceProxy< + ::v1_0::commonapi::tests::TestInterfaceExtensions::TestPredefinedTypeAttributeAttributeExtension<_AttributeExtension>, + ::v1_0::commonapi::tests::TestInterfaceExtensions::TestDerivedStructAttributeAttributeExtension<_AttributeExtension>, + ::v1_0::commonapi::tests::TestInterfaceExtensions::TestDerivedArrayAttributeAttributeExtension<_AttributeExtension> + > class_t; +}; +} + +#endif // COMMONAPI_TESTS_Test_Interface_PROXY_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceProxyBase.hpp b/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceProxyBase.hpp new file mode 100644 index 0000000..8ede5a7 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceProxyBase.hpp @@ -0,0 +1,98 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_PROXY_BASE_HPP_ +#define COMMONAPI_TESTS_Test_Interface_PROXY_BASE_HPP_ + +#include <v1_0/commonapi/tests/TestInterface.hpp> + + +#include <commonapi/tests/DerivedTypeCollection.hpp> +#include <commonapi/tests/PredefinedTypeCollection.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/Deployment.hpp> +#include <CommonAPI/InputStream.hpp> +#include <CommonAPI/OutputStream.hpp> +#include <CommonAPI/Struct.hpp> +#include <cstdint> +#include <unordered_map> +#include <vector> + +#include <CommonAPI/Attribute.hpp> +#include <CommonAPI/Event.hpp> +#include <CommonAPI/SelectiveEvent.hpp> +#include <CommonAPI/Proxy.hpp> +#include <functional> +#include <future> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { + +class TestInterfaceProxyBase + : virtual public CommonAPI::Proxy { +public: + typedef CommonAPI::ObservableAttribute<uint32_t> TestPredefinedTypeAttributeAttribute; + typedef CommonAPI::ObservableAttribute<::commonapi::tests::DerivedTypeCollection::TestStructExtended> TestDerivedStructAttributeAttribute; + typedef CommonAPI::ObservableAttribute<::commonapi::tests::DerivedTypeCollection::TestArrayUInt64> TestDerivedArrayAttributeAttribute; + typedef CommonAPI::Event< + uint32_t, std::string + > TestPredefinedTypeBroadcastEvent; + typedef CommonAPI::SelectiveEvent<> TestSelectiveBroadcastSelectiveEvent; + typedef CommonAPI::SelectiveEvent<uint32_t, std::string> TestBroadcastWithOutArgsSelectiveEvent; + + typedef std::function<void(const CommonAPI::CallStatus&)> TestEmptyMethodAsyncCallback; + typedef std::function<void(const CommonAPI::CallStatus&)> TestVoidPredefinedTypeMethodAsyncCallback; + typedef std::function<void(const CommonAPI::CallStatus&, const uint32_t&, const std::string&)> TestPredefinedTypeMethodAsyncCallback; + typedef std::function<void(const CommonAPI::CallStatus&)> TestVoidDerivedTypeMethodAsyncCallback; + typedef std::function<void(const CommonAPI::CallStatus&, const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2&, const ::commonapi::tests::DerivedTypeCollection::TestMap&)> TestDerivedTypeMethodAsyncCallback; + typedef std::function<void(const CommonAPI::CallStatus&)> TestArrayOfPolymorphicStructMethodAsyncCallback; + typedef std::function<void(const CommonAPI::CallStatus&)> TestMapOfPolymorphicStructMethodAsyncCallback; + typedef std::function<void(const CommonAPI::CallStatus&)> TestStructWithPolymorphicMemberMethodAsyncCallback; + typedef std::function<void(const CommonAPI::CallStatus&)> TestStructWithEnumKeyMapMemberAsyncCallback; + + virtual TestPredefinedTypeAttributeAttribute& getTestPredefinedTypeAttributeAttribute() = 0; + virtual TestDerivedStructAttributeAttribute& getTestDerivedStructAttributeAttribute() = 0; + virtual TestDerivedArrayAttributeAttribute& getTestDerivedArrayAttributeAttribute() = 0; + + virtual TestPredefinedTypeBroadcastEvent& getTestPredefinedTypeBroadcastEvent() = 0; + virtual TestSelectiveBroadcastSelectiveEvent& getTestSelectiveBroadcastSelectiveEvent() = 0; + virtual TestBroadcastWithOutArgsSelectiveEvent& getTestBroadcastWithOutArgsSelectiveEvent() = 0; + + virtual void testEmptyMethod(CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual std::future<CommonAPI::CallStatus> testEmptyMethodAsync(TestEmptyMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual void testVoidPredefinedTypeMethod(const uint32_t &_uint32Value, const std::string &_stringValue, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual std::future<CommonAPI::CallStatus> testVoidPredefinedTypeMethodAsync(const uint32_t &_uint32Value, const std::string &_stringValue, TestVoidPredefinedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual void testPredefinedTypeMethod(const uint32_t &_uint32InValue, const std::string &_stringInValue, CommonAPI::CallStatus &_status, uint32_t &_uint32OutValue, std::string &_stringOutValue, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual std::future<CommonAPI::CallStatus> testPredefinedTypeMethodAsync(const uint32_t &_uint32InValue, const std::string &_stringInValue, TestPredefinedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual void testVoidDerivedTypeMethod(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2Value, const ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapValue, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual std::future<CommonAPI::CallStatus> testVoidDerivedTypeMethodAsync(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2Value, const ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapValue, TestVoidDerivedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr) = 0; + 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 = nullptr) = 0; + virtual std::future<CommonAPI::CallStatus> testDerivedTypeMethodAsync(const ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 &_testEnumExtended2InValue, const ::commonapi::tests::DerivedTypeCollection::TestMap &_testMapInValue, TestDerivedTypeMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual void TestArrayOfPolymorphicStructMethod(const std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>> &_inArray, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual std::future<CommonAPI::CallStatus> TestArrayOfPolymorphicStructMethodAsync(const std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>> &_inArray, TestArrayOfPolymorphicStructMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual void TestMapOfPolymorphicStructMethod(const ::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic &_inMap, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual std::future<CommonAPI::CallStatus> TestMapOfPolymorphicStructMethodAsync(const ::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic &_inMap, TestMapOfPolymorphicStructMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual void TestStructWithPolymorphicMemberMethod(const ::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember &_inStruct, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual std::future<CommonAPI::CallStatus> TestStructWithPolymorphicMemberMethodAsync(const ::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember &_inStruct, TestStructWithPolymorphicMemberMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual void TestStructWithEnumKeyMapMember(const ::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap &_inStruct, CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual std::future<CommonAPI::CallStatus> TestStructWithEnumKeyMapMemberAsync(const ::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap &_inStruct, TestStructWithEnumKeyMapMemberAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr) = 0; +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Test_Interface_PROXY_BASE_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceStub.hpp b/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceStub.hpp new file mode 100644 index 0000000..af3f02e --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceStub.hpp @@ -0,0 +1,212 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_STUB_HPP_ +#define COMMONAPI_TESTS_Test_Interface_STUB_HPP_ + +#include <functional> + + + +#include <commonapi/tests/DerivedTypeCollection.hpp> +#include <commonapi/tests/PredefinedTypeCollection.hpp> + +#include <v1_0/commonapi/tests/TestInterface.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/Deployment.hpp> +#include <CommonAPI/InputStream.hpp> +#include <CommonAPI/OutputStream.hpp> +#include <CommonAPI/Struct.hpp> +#include <cstdint> +#include <unordered_map> +#include <unordered_set> +#include <vector> + +#include <CommonAPI/Stub.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { + +/** + * Receives messages from remote and handles all dispatching of deserialized calls + * to a stub for the service TestInterface. Also provides means to send broadcasts + * and attribute-changed-notifications of observable attributes as defined by this service. + * An application developer should not need to bother with this class. + */ +class TestInterfaceStubAdapter + : virtual public CommonAPI::StubAdapter, + public TestInterface { + public: + ///Notifies all remote listeners about a change of value of the attribute TestPredefinedTypeAttribute. + virtual void fireTestPredefinedTypeAttributeAttributeChanged(const uint32_t& TestPredefinedTypeAttribute) = 0; + ///Notifies all remote listeners about a change of value of the attribute TestDerivedStructAttribute. + virtual void fireTestDerivedStructAttributeAttributeChanged(const ::commonapi::tests::DerivedTypeCollection::TestStructExtended& TestDerivedStructAttribute) = 0; + ///Notifies all remote listeners about a change of value of the attribute TestDerivedArrayAttribute. + virtual void fireTestDerivedArrayAttributeAttributeChanged(const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64& TestDerivedArrayAttribute) = 0; + + /** + * Sends a broadcast event for TestPredefinedTypeBroadcast. Should not be called directly. + * Instead, the "fire<broadcastName>Event" methods of the stub should be used. + */ + virtual void fireTestPredefinedTypeBroadcastEvent(const uint32_t &_uint32Value, const std::string &_stringValue) = 0; + /** + * Sends a selective broadcast event for TestSelectiveBroadcast. Should not be called directly. + * Instead, the "fire<broadcastName>Event" methods of the stub should be used. + */ + virtual void fireTestSelectiveBroadcastSelective(const std::shared_ptr<CommonAPI::ClientId> _client) = 0; + virtual void sendTestSelectiveBroadcastSelective(const std::shared_ptr<CommonAPI::ClientIdList> _receivers = nullptr) = 0; + virtual void subscribeForTestSelectiveBroadcastSelective(const std::shared_ptr<CommonAPI::ClientId> clientId, bool& success) = 0; + virtual void unsubscribeFromTestSelectiveBroadcastSelective(const std::shared_ptr<CommonAPI::ClientId> clientId) = 0; + virtual std::shared_ptr<CommonAPI::ClientIdList> const getSubscribersForTestSelectiveBroadcastSelective() = 0; + /** + * Sends a selective broadcast event for TestBroadcastWithOutArgs. Should not be called directly. + * Instead, the "fire<broadcastName>Event" methods of the stub should be used. + */ + virtual void fireTestBroadcastWithOutArgsSelective(const std::shared_ptr<CommonAPI::ClientId> _client, const uint32_t &_uint32Value, const std::string &_stringValue) = 0; + virtual void sendTestBroadcastWithOutArgsSelective(const uint32_t &_uint32Value, const std::string &_stringValue, const std::shared_ptr<CommonAPI::ClientIdList> _receivers = nullptr) = 0; + virtual void subscribeForTestBroadcastWithOutArgsSelective(const std::shared_ptr<CommonAPI::ClientId> clientId, bool& success) = 0; + virtual void unsubscribeFromTestBroadcastWithOutArgsSelective(const std::shared_ptr<CommonAPI::ClientId> clientId) = 0; + virtual std::shared_ptr<CommonAPI::ClientIdList> const getSubscribersForTestBroadcastWithOutArgsSelective() = 0; + + + virtual void deactivateManagedInstances() = 0; +protected: + /** + * Defines properties for storing the ClientIds of clients / proxies that have + * subscribed to the selective broadcasts + */ + std::shared_ptr<CommonAPI::ClientIdList> subscribersForTestSelectiveBroadcastSelective_; + std::shared_ptr<CommonAPI::ClientIdList> subscribersForTestBroadcastWithOutArgsSelective_; +}; + +/** + * Defines the necessary callbacks to handle remote set events related to the attributes + * defined in the IDL description for TestInterface. + * For each attribute two callbacks are defined: + * - a verification callback that allows to verify the requested value and to prevent setting + * e.g. an invalid value ("onRemoteSet<AttributeName>"). + * - an action callback to do local work after the attribute value has been changed + * ("onRemote<AttributeName>Changed"). + * + * This class and the one below are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class TestInterfaceStubRemoteEvent +{ +public: + virtual ~TestInterfaceStubRemoteEvent() { } + + /// Verification callback for remote set requests on the attribute TestPredefinedTypeAttribute + virtual bool onRemoteSetTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t TestPredefinedTypeAttribute) = 0; + /// Action callback for remote set requests on the attribute TestPredefinedTypeAttribute + virtual void onRemoteTestPredefinedTypeAttributeAttributeChanged() = 0; + /// Verification callback for remote set requests on the attribute TestDerivedStructAttribute + virtual bool onRemoteSetTestDerivedStructAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestStructExtended TestDerivedStructAttribute) = 0; + /// Action callback for remote set requests on the attribute TestDerivedStructAttribute + virtual void onRemoteTestDerivedStructAttributeAttributeChanged() = 0; + /// Verification callback for remote set requests on the attribute TestDerivedArrayAttribute + virtual bool onRemoteSetTestDerivedArrayAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 TestDerivedArrayAttribute) = 0; + /// Action callback for remote set requests on the attribute TestDerivedArrayAttribute + virtual void onRemoteTestDerivedArrayAttributeAttributeChanged() = 0; +}; + +/** + * Defines the interface that must be implemented by any class that should provide + * the service TestInterface to remote clients. + * This class and the one above are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class TestInterfaceStub + : public virtual CommonAPI::Stub<TestInterfaceStubAdapter, TestInterfaceStubRemoteEvent> +{ +public: + typedef std::function<void ()> testEmptyMethodReply_t; + typedef std::function<void ()> testVoidPredefinedTypeMethodReply_t; + typedef std::function<void (uint32_t _uint32OutValue, std::string _stringOutValue)> testPredefinedTypeMethodReply_t; + typedef std::function<void ()> testVoidDerivedTypeMethodReply_t; + typedef std::function<void (::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 _testEnumExtended2OutValue, ::commonapi::tests::DerivedTypeCollection::TestMap _testMapOutValue)> testDerivedTypeMethodReply_t; + typedef std::function<void ()> TestArrayOfPolymorphicStructMethodReply_t; + typedef std::function<void ()> TestMapOfPolymorphicStructMethodReply_t; + typedef std::function<void ()> TestStructWithPolymorphicMemberMethodReply_t; + typedef std::function<void ()> TestStructWithEnumKeyMapMemberReply_t; + + virtual ~TestInterfaceStub() {} + virtual const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) = 0; + + /// Provides getter access to the attribute TestPredefinedTypeAttribute + virtual const uint32_t &getTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client) = 0; + /// Provides getter access to the attribute TestDerivedStructAttribute + virtual const ::commonapi::tests::DerivedTypeCollection::TestStructExtended &getTestDerivedStructAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client) = 0; + /// Provides getter access to the attribute TestDerivedArrayAttribute + virtual const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 &getTestDerivedArrayAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client) = 0; + + /// This is the method that will be called on remote calls on the method testEmptyMethod. + virtual void testEmptyMethod(const std::shared_ptr<CommonAPI::ClientId> _client, testEmptyMethodReply_t _reply) = 0; + /// This is the method that will be called on remote calls on the method testVoidPredefinedTypeMethod. + virtual void testVoidPredefinedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _uint32Value, std::string _stringValue, testVoidPredefinedTypeMethodReply_t _reply) = 0; + /// This is the method that will be called on remote calls on the method testPredefinedTypeMethod. + virtual void testPredefinedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _uint32InValue, std::string _stringInValue, testPredefinedTypeMethodReply_t _reply) = 0; + /// This is the method that will be called on remote calls on the method testVoidDerivedTypeMethod. + virtual void testVoidDerivedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 _testEnumExtended2Value, ::commonapi::tests::DerivedTypeCollection::TestMap _testMapValue, testVoidDerivedTypeMethodReply_t _reply) = 0; + /// This is the method that will be called on remote calls on the method testDerivedTypeMethod. + virtual void testDerivedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 _testEnumExtended2InValue, ::commonapi::tests::DerivedTypeCollection::TestMap _testMapInValue, testDerivedTypeMethodReply_t _reply) = 0; + /// This is the method that will be called on remote calls on the method TestArrayOfPolymorphicStructMethod. + virtual void TestArrayOfPolymorphicStructMethod(const std::shared_ptr<CommonAPI::ClientId> _client, std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>> _inArray, TestArrayOfPolymorphicStructMethodReply_t _reply) = 0; + /// This is the method that will be called on remote calls on the method TestMapOfPolymorphicStructMethod. + virtual void TestMapOfPolymorphicStructMethod(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic _inMap, TestMapOfPolymorphicStructMethodReply_t _reply) = 0; + /// This is the method that will be called on remote calls on the method TestStructWithPolymorphicMemberMethod. + virtual void TestStructWithPolymorphicMemberMethod(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember _inStruct, TestStructWithPolymorphicMemberMethodReply_t _reply) = 0; + /// This is the method that will be called on remote calls on the method TestStructWithEnumKeyMapMember. + virtual void TestStructWithEnumKeyMapMember(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap _inStruct, TestStructWithEnumKeyMapMemberReply_t _reply) = 0; + /// Sends a broadcast event for TestPredefinedTypeBroadcast. + virtual void fireTestPredefinedTypeBroadcastEvent(const uint32_t &_uint32Value, const std::string &_stringValue) = 0; + /** + * Sends a selective broadcast event for TestSelectiveBroadcast to the given ClientIds. + * The ClientIds must all be out of the set of subscribed clients. + * If no ClientIds are given, the selective broadcast is sent to all subscribed clients. + */ + virtual void fireTestSelectiveBroadcastSelective(const std::shared_ptr<CommonAPI::ClientIdList> _receivers = nullptr) = 0; + /// retreives the list of all subscribed clients for TestSelectiveBroadcast + virtual std::shared_ptr<CommonAPI::ClientIdList> const getSubscribersForTestSelectiveBroadcastSelective() = 0; + /// Hook method for reacting on new subscriptions or removed subscriptions respectively for selective broadcasts. + virtual void onTestSelectiveBroadcastSelectiveSubscriptionChanged(const std::shared_ptr<CommonAPI::ClientId> _client, const CommonAPI::SelectiveBroadcastSubscriptionEvent _event) = 0; + /// Hook method for reacting accepting or denying new subscriptions + virtual bool onTestSelectiveBroadcastSelectiveSubscriptionRequested(const std::shared_ptr<CommonAPI::ClientId> _client) = 0; + /** + * Sends a selective broadcast event for TestBroadcastWithOutArgs to the given ClientIds. + * The ClientIds must all be out of the set of subscribed clients. + * If no ClientIds are given, the selective broadcast is sent to all subscribed clients. + */ + virtual void fireTestBroadcastWithOutArgsSelective(const uint32_t &_uint32Value, const std::string &_stringValue, const std::shared_ptr<CommonAPI::ClientIdList> _receivers = nullptr) = 0; + /// retreives the list of all subscribed clients for TestBroadcastWithOutArgs + virtual std::shared_ptr<CommonAPI::ClientIdList> const getSubscribersForTestBroadcastWithOutArgsSelective() = 0; + /// Hook method for reacting on new subscriptions or removed subscriptions respectively for selective broadcasts. + virtual void onTestBroadcastWithOutArgsSelectiveSubscriptionChanged(const std::shared_ptr<CommonAPI::ClientId> _client, const CommonAPI::SelectiveBroadcastSubscriptionEvent _event) = 0; + /// Hook method for reacting accepting or denying new subscriptions + virtual bool onTestBroadcastWithOutArgsSelectiveSubscriptionRequested(const std::shared_ptr<CommonAPI::ClientId> _client) = 0; + + using CommonAPI::Stub<TestInterfaceStubAdapter, TestInterfaceStubRemoteEvent>::initStubAdapter; + typedef CommonAPI::Stub<TestInterfaceStubAdapter, TestInterfaceStubRemoteEvent>::StubAdapterType StubAdapterType; + typedef CommonAPI::Stub<TestInterfaceStubAdapter, TestInterfaceStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType; + typedef TestInterfaceStubRemoteEvent RemoteEventType; + typedef TestInterface StubInterface; +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Test_Interface_STUB_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceStubDefault.cpp b/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceStubDefault.cpp new file mode 100644 index 0000000..0b9532b --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceStubDefault.cpp @@ -0,0 +1,268 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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/TestInterfaceStubDefault.hpp> +#include <assert.h> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +TestInterfaceStubDefault::TestInterfaceStubDefault(): + remoteEventHandler_(this), + interfaceVersion_(TestInterface::getInterfaceVersion()) { +} + +const CommonAPI::Version& TestInterfaceStubDefault::getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client) { + return interfaceVersion_; +} + +TestInterfaceStubRemoteEvent* TestInterfaceStubDefault::initStubAdapter(const std::shared_ptr<TestInterfaceStubAdapter> &_adapter) { + CommonAPI::Stub<TestInterfaceStubAdapter, TestInterfaceStubRemoteEvent>::stubAdapter_ = _adapter; + return &remoteEventHandler_; +} + +const uint32_t& TestInterfaceStubDefault::getTestPredefinedTypeAttributeAttribute() { + return testPredefinedTypeAttributeAttributeValue_; +} + +const uint32_t& TestInterfaceStubDefault::getTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client) { + return getTestPredefinedTypeAttributeAttribute(); +} + +void TestInterfaceStubDefault::setTestPredefinedTypeAttributeAttribute(uint32_t _value) { + const bool valueChanged = trySetTestPredefinedTypeAttributeAttribute(std::move(_value)); + if (valueChanged && stubAdapter_ != NULL) { + stubAdapter_->fireTestPredefinedTypeAttributeAttributeChanged(testPredefinedTypeAttributeAttributeValue_); + } +} + +bool TestInterfaceStubDefault::trySetTestPredefinedTypeAttributeAttribute(uint32_t _value) { + if (!validateTestPredefinedTypeAttributeAttributeRequestedValue(_value)) + return false; + + const bool valueChanged = (testPredefinedTypeAttributeAttributeValue_ != _value); + testPredefinedTypeAttributeAttributeValue_ = std::move(_value); + return valueChanged; +} + +bool TestInterfaceStubDefault::validateTestPredefinedTypeAttributeAttributeRequestedValue(const uint32_t &_value) { + return true; +} + +void TestInterfaceStubDefault::setTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _value) { + setTestPredefinedTypeAttributeAttribute(_value); +} + +void TestInterfaceStubDefault::onRemoteTestPredefinedTypeAttributeAttributeChanged() { + // No operation in default +} + +void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestPredefinedTypeAttributeAttributeChanged() { + assert(defaultStub_ !=NULL); + defaultStub_->onRemoteTestPredefinedTypeAttributeAttributeChanged(); +} + +bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestPredefinedTypeAttributeAttribute(uint32_t _value) { + assert(defaultStub_ !=NULL); + return defaultStub_->trySetTestPredefinedTypeAttributeAttribute(std::move(_value)); +} + +bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _value) { + return onRemoteSetTestPredefinedTypeAttributeAttribute(_value); +} + +const ::commonapi::tests::DerivedTypeCollection::TestStructExtended& TestInterfaceStubDefault::getTestDerivedStructAttributeAttribute() { + return testDerivedStructAttributeAttributeValue_; +} + +const ::commonapi::tests::DerivedTypeCollection::TestStructExtended& TestInterfaceStubDefault::getTestDerivedStructAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client) { + return getTestDerivedStructAttributeAttribute(); +} + +void TestInterfaceStubDefault::setTestDerivedStructAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestStructExtended _value) { + const bool valueChanged = trySetTestDerivedStructAttributeAttribute(std::move(_value)); + if (valueChanged && stubAdapter_ != NULL) { + stubAdapter_->fireTestDerivedStructAttributeAttributeChanged(testDerivedStructAttributeAttributeValue_); + } +} + +bool TestInterfaceStubDefault::trySetTestDerivedStructAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestStructExtended _value) { + if (!validateTestDerivedStructAttributeAttributeRequestedValue(_value)) + return false; + + const bool valueChanged = (testDerivedStructAttributeAttributeValue_ != _value); + testDerivedStructAttributeAttributeValue_ = std::move(_value); + return valueChanged; +} + +bool TestInterfaceStubDefault::validateTestDerivedStructAttributeAttributeRequestedValue(const ::commonapi::tests::DerivedTypeCollection::TestStructExtended &_value) { + return true; +} + +void TestInterfaceStubDefault::setTestDerivedStructAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestStructExtended _value) { + setTestDerivedStructAttributeAttribute(_value); +} + +void TestInterfaceStubDefault::onRemoteTestDerivedStructAttributeAttributeChanged() { + // No operation in default +} + +void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestDerivedStructAttributeAttributeChanged() { + assert(defaultStub_ !=NULL); + defaultStub_->onRemoteTestDerivedStructAttributeAttributeChanged(); +} + +bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedStructAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestStructExtended _value) { + assert(defaultStub_ !=NULL); + return defaultStub_->trySetTestDerivedStructAttributeAttribute(std::move(_value)); +} + +bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedStructAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestStructExtended _value) { + return onRemoteSetTestDerivedStructAttributeAttribute(_value); +} + +const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64& TestInterfaceStubDefault::getTestDerivedArrayAttributeAttribute() { + return testDerivedArrayAttributeAttributeValue_; +} + +const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64& TestInterfaceStubDefault::getTestDerivedArrayAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client) { + return getTestDerivedArrayAttributeAttribute(); +} + +void TestInterfaceStubDefault::setTestDerivedArrayAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value) { + const bool valueChanged = trySetTestDerivedArrayAttributeAttribute(std::move(_value)); + if (valueChanged && stubAdapter_ != NULL) { + stubAdapter_->fireTestDerivedArrayAttributeAttributeChanged(testDerivedArrayAttributeAttributeValue_); + } +} + +bool TestInterfaceStubDefault::trySetTestDerivedArrayAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value) { + if (!validateTestDerivedArrayAttributeAttributeRequestedValue(_value)) + return false; + + const bool valueChanged = (testDerivedArrayAttributeAttributeValue_ != _value); + testDerivedArrayAttributeAttributeValue_ = std::move(_value); + return valueChanged; +} + +bool TestInterfaceStubDefault::validateTestDerivedArrayAttributeAttributeRequestedValue(const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 &_value) { + return true; +} + +void TestInterfaceStubDefault::setTestDerivedArrayAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value) { + setTestDerivedArrayAttributeAttribute(_value); +} + +void TestInterfaceStubDefault::onRemoteTestDerivedArrayAttributeAttributeChanged() { + // No operation in default +} + +void TestInterfaceStubDefault::RemoteEventHandler::onRemoteTestDerivedArrayAttributeAttributeChanged() { + assert(defaultStub_ !=NULL); + defaultStub_->onRemoteTestDerivedArrayAttributeAttributeChanged(); +} + +bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedArrayAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value) { + assert(defaultStub_ !=NULL); + return defaultStub_->trySetTestDerivedArrayAttributeAttribute(std::move(_value)); +} + +bool TestInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedArrayAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value) { + return onRemoteSetTestDerivedArrayAttributeAttribute(_value); +} + + +void TestInterfaceStubDefault::testEmptyMethod(const std::shared_ptr<CommonAPI::ClientId> _client, testEmptyMethodReply_t _reply) { + _reply(); +} + +void TestInterfaceStubDefault::testVoidPredefinedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _uint32Value, std::string _stringValue, testVoidPredefinedTypeMethodReply_t _reply) { + _reply(); +} + +void TestInterfaceStubDefault::testPredefinedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _uint32InValue, std::string _stringInValue, testPredefinedTypeMethodReply_t _reply) { + uint32_t uint32OutValue; + std::string stringOutValue; + _reply(uint32OutValue, stringOutValue); +} + +void TestInterfaceStubDefault::testVoidDerivedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 _testEnumExtended2Value, ::commonapi::tests::DerivedTypeCollection::TestMap _testMapValue, testVoidDerivedTypeMethodReply_t _reply) { + _reply(); +} + +void TestInterfaceStubDefault::testDerivedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 _testEnumExtended2InValue, ::commonapi::tests::DerivedTypeCollection::TestMap _testMapInValue, testDerivedTypeMethodReply_t _reply) { + ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 testEnumExtended2OutValue; + ::commonapi::tests::DerivedTypeCollection::TestMap testMapOutValue; + _reply(testEnumExtended2OutValue, testMapOutValue); +} + +void TestInterfaceStubDefault::TestArrayOfPolymorphicStructMethod(const std::shared_ptr<CommonAPI::ClientId> _client, std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>> _inArray, TestArrayOfPolymorphicStructMethodReply_t _reply) { + _reply(); +} + +void TestInterfaceStubDefault::TestMapOfPolymorphicStructMethod(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic _inMap, TestMapOfPolymorphicStructMethodReply_t _reply) { + _reply(); +} + +void TestInterfaceStubDefault::TestStructWithPolymorphicMemberMethod(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember _inStruct, TestStructWithPolymorphicMemberMethodReply_t _reply) { + _reply(); +} + +void TestInterfaceStubDefault::TestStructWithEnumKeyMapMember(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap _inStruct, TestStructWithEnumKeyMapMemberReply_t _reply) { + _reply(); +} + + +void TestInterfaceStubDefault::fireTestPredefinedTypeBroadcastEvent(const uint32_t &_uint32Value, const std::string &_stringValue) { + assert(stubAdapter_ !=NULL); + stubAdapter_->fireTestPredefinedTypeBroadcastEvent(_uint32Value, _stringValue); +} +void TestInterfaceStubDefault::fireTestSelectiveBroadcastSelective(const std::shared_ptr<CommonAPI::ClientIdList> _receivers) { + assert(stubAdapter_ !=NULL); + stubAdapter_->sendTestSelectiveBroadcastSelective(_receivers); +} +void TestInterfaceStubDefault::onTestSelectiveBroadcastSelectiveSubscriptionChanged(const std::shared_ptr<CommonAPI::ClientId> _client, const CommonAPI::SelectiveBroadcastSubscriptionEvent _event) { + // No operation in default +} +bool TestInterfaceStubDefault::onTestSelectiveBroadcastSelectiveSubscriptionRequested(const std::shared_ptr<CommonAPI::ClientId> _client) { + // Accept in default + return true; +} +std::shared_ptr<CommonAPI::ClientIdList> const TestInterfaceStubDefault::getSubscribersForTestSelectiveBroadcastSelective() { + assert(stubAdapter_ !=NULL); + return(stubAdapter_->getSubscribersForTestSelectiveBroadcastSelective()); +} + +void TestInterfaceStubDefault::fireTestBroadcastWithOutArgsSelective(const uint32_t &_uint32Value, const std::string &_stringValue, const std::shared_ptr<CommonAPI::ClientIdList> _receivers) { + assert(stubAdapter_ !=NULL); + stubAdapter_->sendTestBroadcastWithOutArgsSelective(_uint32Value, _stringValue, _receivers); +} +void TestInterfaceStubDefault::onTestBroadcastWithOutArgsSelectiveSubscriptionChanged(const std::shared_ptr<CommonAPI::ClientId> _client, const CommonAPI::SelectiveBroadcastSubscriptionEvent _event) { + // No operation in default +} +bool TestInterfaceStubDefault::onTestBroadcastWithOutArgsSelectiveSubscriptionRequested(const std::shared_ptr<CommonAPI::ClientId> _client) { + // Accept in default + return true; +} +std::shared_ptr<CommonAPI::ClientIdList> const TestInterfaceStubDefault::getSubscribersForTestBroadcastWithOutArgsSelective() { + assert(stubAdapter_ !=NULL); + return(stubAdapter_->getSubscribersForTestBroadcastWithOutArgsSelective()); +} + + + +TestInterfaceStubDefault::RemoteEventHandler::RemoteEventHandler(TestInterfaceStubDefault *_defaultStub) + : + defaultStub_(_defaultStub) { +} + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceStubDefault.hpp b/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceStubDefault.hpp new file mode 100644 index 0000000..7f00d78 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/TestInterfaceStubDefault.hpp @@ -0,0 +1,122 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_STUB_DEFAULT_HPP_ +#define COMMONAPI_TESTS_Test_Interface_STUB_DEFAULT_HPP_ + + +#include <v1_0/commonapi/tests/TestInterfaceStub.hpp> +#include <sstream> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +/** + * Provides a default implementation for TestInterfaceStubRemoteEvent and + * TestInterfaceStub. Method callbacks have an empty implementation, + * remote set calls on attributes will always change the value of the attribute + * to the one received. + * + * Override this stub if you only want to provide a subset of the functionality + * that would be defined for this service, and/or if you do not need any non-default + * behaviour. + */ +class TestInterfaceStubDefault + : public virtual TestInterfaceStub { +public: + TestInterfaceStubDefault(); + + TestInterfaceStubRemoteEvent* initStubAdapter(const std::shared_ptr<TestInterfaceStubAdapter> &_adapter); + + const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client); + + virtual const uint32_t& getTestPredefinedTypeAttributeAttribute(); + virtual const uint32_t& getTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client); + virtual void setTestPredefinedTypeAttributeAttribute(uint32_t _value); + virtual void setTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _value); + virtual const ::commonapi::tests::DerivedTypeCollection::TestStructExtended& getTestDerivedStructAttributeAttribute(); + virtual const ::commonapi::tests::DerivedTypeCollection::TestStructExtended& getTestDerivedStructAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client); + virtual void setTestDerivedStructAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestStructExtended _value); + virtual void setTestDerivedStructAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestStructExtended _value); + virtual const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64& getTestDerivedArrayAttributeAttribute(); + virtual const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64& getTestDerivedArrayAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client); + virtual void setTestDerivedArrayAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value); + virtual void setTestDerivedArrayAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value); + + virtual void testEmptyMethod(const std::shared_ptr<CommonAPI::ClientId> _client, testEmptyMethodReply_t _reply); + virtual void testVoidPredefinedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _uint32Value, std::string _stringValue, testVoidPredefinedTypeMethodReply_t _reply); + virtual void testPredefinedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _uint32InValue, std::string _stringInValue, testPredefinedTypeMethodReply_t _reply); + virtual void testVoidDerivedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 _testEnumExtended2Value, ::commonapi::tests::DerivedTypeCollection::TestMap _testMapValue, testVoidDerivedTypeMethodReply_t _reply); + virtual void testDerivedTypeMethod(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestEnumExtended2 _testEnumExtended2InValue, ::commonapi::tests::DerivedTypeCollection::TestMap _testMapInValue, testDerivedTypeMethodReply_t _reply); + virtual void TestArrayOfPolymorphicStructMethod(const std::shared_ptr<CommonAPI::ClientId> _client, std::vector<std::shared_ptr<::commonapi::tests::DerivedTypeCollection::TestPolymorphicStruct>> _inArray, TestArrayOfPolymorphicStructMethodReply_t _reply); + virtual void TestMapOfPolymorphicStructMethod(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::MapIntToPolymorphic _inMap, TestMapOfPolymorphicStructMethodReply_t _reply); + virtual void TestStructWithPolymorphicMemberMethod(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::StructWithPolymorphicMember _inStruct, TestStructWithPolymorphicMemberMethodReply_t _reply); + virtual void TestStructWithEnumKeyMapMember(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::StructWithEnumKeyMap _inStruct, TestStructWithEnumKeyMapMemberReply_t _reply); + +virtual void fireTestPredefinedTypeBroadcastEvent(const uint32_t &_uint32Value, const std::string &_stringValue); +virtual void fireTestSelectiveBroadcastSelective(const std::shared_ptr<CommonAPI::ClientIdList> _receivers = nullptr); +virtual std::shared_ptr<CommonAPI::ClientIdList> const getSubscribersForTestSelectiveBroadcastSelective(); +/// Hook method for reacting on new subscriptions or removed subscriptions respectively for selective broadcasts. +virtual void onTestSelectiveBroadcastSelectiveSubscriptionChanged(const std::shared_ptr<CommonAPI::ClientId> _client, const CommonAPI::SelectiveBroadcastSubscriptionEvent _event); +/// Hook method for reacting accepting or denying new subscriptions +virtual bool onTestSelectiveBroadcastSelectiveSubscriptionRequested(const std::shared_ptr<CommonAPI::ClientId> _client); +virtual void fireTestBroadcastWithOutArgsSelective(const uint32_t &_uint32Value, const std::string &_stringValue, const std::shared_ptr<CommonAPI::ClientIdList> _receivers = nullptr); +virtual std::shared_ptr<CommonAPI::ClientIdList> const getSubscribersForTestBroadcastWithOutArgsSelective(); +/// Hook method for reacting on new subscriptions or removed subscriptions respectively for selective broadcasts. +virtual void onTestBroadcastWithOutArgsSelectiveSubscriptionChanged(const std::shared_ptr<CommonAPI::ClientId> _client, const CommonAPI::SelectiveBroadcastSubscriptionEvent _event); +/// Hook method for reacting accepting or denying new subscriptions +virtual bool onTestBroadcastWithOutArgsSelectiveSubscriptionRequested(const std::shared_ptr<CommonAPI::ClientId> _client); + + +protected: + virtual bool trySetTestPredefinedTypeAttributeAttribute(uint32_t _value); + virtual bool validateTestPredefinedTypeAttributeAttributeRequestedValue(const uint32_t &_value); + virtual void onRemoteTestPredefinedTypeAttributeAttributeChanged(); + virtual bool trySetTestDerivedStructAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestStructExtended _value); + virtual bool validateTestDerivedStructAttributeAttributeRequestedValue(const ::commonapi::tests::DerivedTypeCollection::TestStructExtended &_value); + virtual void onRemoteTestDerivedStructAttributeAttributeChanged(); + virtual bool trySetTestDerivedArrayAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value); + virtual bool validateTestDerivedArrayAttributeAttributeRequestedValue(const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 &_value); + virtual void onRemoteTestDerivedArrayAttributeAttributeChanged(); + class RemoteEventHandler: public virtual TestInterfaceStubRemoteEvent { + public: + RemoteEventHandler(TestInterfaceStubDefault *_defaultStub); + + virtual bool onRemoteSetTestPredefinedTypeAttributeAttribute(uint32_t _value); + virtual bool onRemoteSetTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _value); + virtual void onRemoteTestPredefinedTypeAttributeAttributeChanged(); + + virtual bool onRemoteSetTestDerivedStructAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestStructExtended _value); + virtual bool onRemoteSetTestDerivedStructAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestStructExtended _value); + virtual void onRemoteTestDerivedStructAttributeAttributeChanged(); + + virtual bool onRemoteSetTestDerivedArrayAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value); + virtual bool onRemoteSetTestDerivedArrayAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value); + virtual void onRemoteTestDerivedArrayAttributeAttributeChanged(); + + + private: + TestInterfaceStubDefault *defaultStub_; + }; +private: + TestInterfaceStubDefault::RemoteEventHandler remoteEventHandler_; + + uint32_t testPredefinedTypeAttributeAttributeValue_; + ::commonapi::tests::DerivedTypeCollection::TestStructExtended testDerivedStructAttributeAttributeValue_; + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 testDerivedArrayAttributeAttributeValue_; + + CommonAPI::Version interfaceVersion_; +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Test_Interface_STUB_DEFAULT diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterface.cpp b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterface.cpp new file mode 100644 index 0000000..fa8200d --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterface.cpp @@ -0,0 +1,26 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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 "BranchInterface.hpp" + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +#ifndef WIN32 +const int32_t BranchInterface::testBranchMethodError::OK; +const int32_t BranchInterface::testBranchMethodError::NOTOK; +#endif + + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterface.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterface.hpp new file mode 100644 index 0000000..fc1c1ab --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterface.hpp @@ -0,0 +1,64 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_HPP_ +#define COMMONAPI_TESTS_MANAGED_BRANCH_INTERFACE_HPP_ + + + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/InputStream.hpp> +#include <CommonAPI/OutputStream.hpp> +#include <CommonAPI/Types.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +class BranchInterface { +public: + virtual ~BranchInterface() { } + + static inline const char* getInterface(); + static inline CommonAPI::Version getInterfaceVersion(); + + struct testBranchMethodError : CommonAPI::Enumeration<int32_t> { + testBranchMethodError() = default; + testBranchMethodError(const int32_t &_value) + : CommonAPI::Enumeration<int32_t>(_value) {} + static const int32_t OK = 0; + static const int32_t NOTOK = 1; + }; +}; + +const char* BranchInterface::getInterface() { + return ("commonapi.tests.managed.BranchInterface"); +} + +CommonAPI::Version BranchInterface::getInterfaceVersion() { + return CommonAPI::Version(1, 0); +} + + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +namespace CommonAPI { +} + +#endif // COMMONAPI_TESTS_MANAGED_BRANCH_INTERFACE_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceDBusProxy.cpp b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceDBusProxy.cpp new file mode 100644 index 0000000..9bf65e2 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/managed/BranchInterfaceDBusProxy.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceDBusProxy.hpp new file mode 100644 index 0000000..2331979 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.cpp b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.cpp new file mode 100644 index 0000000..29ac294 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.hpp new file mode 100644 index 0000000..8fee9be --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/managed/BranchInterfaceProxy.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceProxy.hpp new file mode 100644 index 0000000..beabc44 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceProxy.hpp @@ -0,0 +1,154 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_PROXY_HPP_ +#define COMMONAPI_TESTS_MANAGED_Branch_Interface_PROXY_HPP_ + +#include <v1_0/commonapi/tests/managed/BranchInterfaceProxyBase.hpp> + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +template <typename ... _AttributeExtensions> +class BranchInterfaceProxy + : virtual public BranchInterface, + virtual public BranchInterfaceProxyBase, + public _AttributeExtensions... { +public: + BranchInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate); + ~BranchInterfaceProxy(); + + typedef BranchInterface InterfaceType; + + + + + /** + * Calls testBranchMethod with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void 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 = nullptr); + /** + * Calls testBranchMethod with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> testBranchMethodAsync(const int32_t &_inInt, const std::string &_inString, TestBranchMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr); + + + /** + * Returns the CommonAPI address of the remote partner this proxy communicates with. + */ + virtual const CommonAPI::Address &getAddress() const; + + /** + * Returns true if the remote partner for this proxy is currently known to be available. + */ + virtual bool isAvailable() const; + + /** + * Returns true if the remote partner for this proxy is available. + */ + virtual bool isAvailableBlocking() const; + + /** + * Returns the wrapper class that is used to (de-)register for notifications about + * the availability of the remote partner of this proxy. + */ + virtual CommonAPI::ProxyStatusEvent& getProxyStatusEvent(); + + /** + * Returns the wrapper class that is used to access version information of the remote + * partner of this proxy. + */ + virtual CommonAPI::InterfaceVersionAttribute& getInterfaceVersionAttribute(); + + private: + std::shared_ptr<BranchInterfaceProxyBase> delegate_; +}; + +typedef BranchInterfaceProxy<> BranchInterfaceProxyDefault; + + +// +// BranchInterfaceProxy Implementation +// +template <typename ... _AttributeExtensions> +BranchInterfaceProxy<_AttributeExtensions...>::BranchInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate): + _AttributeExtensions(*(std::dynamic_pointer_cast<BranchInterfaceProxyBase>(delegate)))..., + delegate_(std::dynamic_pointer_cast<BranchInterfaceProxyBase>(delegate)) { +} + +template <typename ... _AttributeExtensions> +BranchInterfaceProxy<_AttributeExtensions...>::~BranchInterfaceProxy() { +} + +template <typename ... _AttributeExtensions> +void BranchInterfaceProxy<_AttributeExtensions...>::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) { + delegate_->testBranchMethod(_inInt, _inString, _status, _error, _outInt, _outString, _info); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> BranchInterfaceProxy<_AttributeExtensions...>::testBranchMethodAsync(const int32_t &_inInt, const std::string &_inString, TestBranchMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return delegate_->testBranchMethodAsync(_inInt, _inString, _callback, _info); +} + +template <typename ... _AttributeExtensions> +const CommonAPI::Address &BranchInterfaceProxy<_AttributeExtensions...>::getAddress() const { + return delegate_->getAddress(); +} + +template <typename ... _AttributeExtensions> +bool BranchInterfaceProxy<_AttributeExtensions...>::isAvailable() const { + return delegate_->isAvailable(); +} + +template <typename ... _AttributeExtensions> +bool BranchInterfaceProxy<_AttributeExtensions...>::isAvailableBlocking() const { + return delegate_->isAvailableBlocking(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::ProxyStatusEvent& BranchInterfaceProxy<_AttributeExtensions...>::getProxyStatusEvent() { + return delegate_->getProxyStatusEvent(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::InterfaceVersionAttribute& BranchInterfaceProxy<_AttributeExtensions...>::getInterfaceVersionAttribute() { + return delegate_->getInterfaceVersionAttribute(); +} + + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + + +#endif // COMMONAPI_TESTS_MANAGED_Branch_Interface_PROXY_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceProxyBase.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceProxyBase.hpp new file mode 100644 index 0000000..c0bb966 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceProxyBase.hpp @@ -0,0 +1,51 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_PROXY_BASE_HPP_ +#define COMMONAPI_TESTS_MANAGED_Branch_Interface_PROXY_BASE_HPP_ + +#include <v1_0/commonapi/tests/managed/BranchInterface.hpp> + + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <vector> + +#include <CommonAPI/Proxy.hpp> +#include <functional> +#include <future> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +class BranchInterfaceProxyBase + : virtual public CommonAPI::Proxy { +public: + + typedef std::function<void(const CommonAPI::CallStatus&, const BranchInterface::testBranchMethodError&, const int32_t&, const std::string&)> TestBranchMethodAsyncCallback; + + + + 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 = nullptr) = 0; + virtual std::future<CommonAPI::CallStatus> testBranchMethodAsync(const int32_t &_inInt, const std::string &_inString, TestBranchMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr) = 0; +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Branch_Interface_PROXY_BASE_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceStub.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceStub.hpp new file mode 100644 index 0000000..fdec075 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceStub.hpp @@ -0,0 +1,106 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_STUB_HPP_ +#define COMMONAPI_TESTS_MANAGED_Branch_Interface_STUB_HPP_ + +#include <functional> + + + + +#include <v1_0/commonapi/tests/managed/BranchInterface.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <vector> + +#include <CommonAPI/Stub.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +/** + * Receives messages from remote and handles all dispatching of deserialized calls + * to a stub for the service BranchInterface. Also provides means to send broadcasts + * and attribute-changed-notifications of observable attributes as defined by this service. + * An application developer should not need to bother with this class. + */ +class BranchInterfaceStubAdapter + : virtual public CommonAPI::StubAdapter, + public BranchInterface { + public: + + + + virtual void deactivateManagedInstances() = 0; +protected: + /** + * Defines properties for storing the ClientIds of clients / proxies that have + * subscribed to the selective broadcasts + */ +}; + +/** + * Defines the necessary callbacks to handle remote set events related to the attributes + * defined in the IDL description for BranchInterface. + * For each attribute two callbacks are defined: + * - a verification callback that allows to verify the requested value and to prevent setting + * e.g. an invalid value ("onRemoteSet<AttributeName>"). + * - an action callback to do local work after the attribute value has been changed + * ("onRemote<AttributeName>Changed"). + * + * This class and the one below are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class BranchInterfaceStubRemoteEvent +{ +public: + virtual ~BranchInterfaceStubRemoteEvent() { } + +}; + +/** + * Defines the interface that must be implemented by any class that should provide + * the service BranchInterface to remote clients. + * This class and the one above are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class BranchInterfaceStub + : public virtual CommonAPI::Stub<BranchInterfaceStubAdapter, BranchInterfaceStubRemoteEvent> +{ +public: + typedef std::function<void (BranchInterface::testBranchMethodError _error, int32_t _outInt, std::string _outString)> testBranchMethodReply_t; + + virtual ~BranchInterfaceStub() {} + virtual const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) = 0; + + + /// This is the method that will be called on remote calls on the method testBranchMethod. + virtual void testBranchMethod(const std::shared_ptr<CommonAPI::ClientId> _client, int32_t _inInt, std::string _inString, testBranchMethodReply_t _reply) = 0; + + using CommonAPI::Stub<BranchInterfaceStubAdapter, BranchInterfaceStubRemoteEvent>::initStubAdapter; + typedef CommonAPI::Stub<BranchInterfaceStubAdapter, BranchInterfaceStubRemoteEvent>::StubAdapterType StubAdapterType; + typedef CommonAPI::Stub<BranchInterfaceStubAdapter, BranchInterfaceStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType; + typedef BranchInterfaceStubRemoteEvent RemoteEventType; + typedef BranchInterface StubInterface; +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Branch_Interface_STUB_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceStubDefault.cpp b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceStubDefault.cpp new file mode 100644 index 0000000..2a16da2 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceStubDefault.cpp @@ -0,0 +1,51 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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/BranchInterfaceStubDefault.hpp> +#include <assert.h> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +BranchInterfaceStubDefault::BranchInterfaceStubDefault(): + remoteEventHandler_(this), + interfaceVersion_(BranchInterface::getInterfaceVersion()) { +} + +const CommonAPI::Version& BranchInterfaceStubDefault::getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client) { + return interfaceVersion_; +} + +BranchInterfaceStubRemoteEvent* BranchInterfaceStubDefault::initStubAdapter(const std::shared_ptr<BranchInterfaceStubAdapter> &_adapter) { + CommonAPI::Stub<BranchInterfaceStubAdapter, BranchInterfaceStubRemoteEvent>::stubAdapter_ = _adapter; + return &remoteEventHandler_; +} + + +void BranchInterfaceStubDefault::testBranchMethod(const std::shared_ptr<CommonAPI::ClientId> _client, int32_t _inInt, std::string _inString, testBranchMethodReply_t _reply) { + BranchInterface::testBranchMethodError error; + int32_t outInt; + std::string outString; + _reply(error, outInt, outString); +} + + + + +BranchInterfaceStubDefault::RemoteEventHandler::RemoteEventHandler(BranchInterfaceStubDefault *_defaultStub) + : + defaultStub_(_defaultStub) { +} + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceStubDefault.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceStubDefault.hpp new file mode 100644 index 0000000..0d0eab2 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/BranchInterfaceStubDefault.hpp @@ -0,0 +1,67 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_STUB_DEFAULT_HPP_ +#define COMMONAPI_TESTS_MANAGED_Branch_Interface_STUB_DEFAULT_HPP_ + + +#include <v1_0/commonapi/tests/managed/BranchInterfaceStub.hpp> +#include <sstream> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +/** + * Provides a default implementation for BranchInterfaceStubRemoteEvent and + * BranchInterfaceStub. Method callbacks have an empty implementation, + * remote set calls on attributes will always change the value of the attribute + * to the one received. + * + * Override this stub if you only want to provide a subset of the functionality + * that would be defined for this service, and/or if you do not need any non-default + * behaviour. + */ +class BranchInterfaceStubDefault + : public virtual BranchInterfaceStub { +public: + BranchInterfaceStubDefault(); + + BranchInterfaceStubRemoteEvent* initStubAdapter(const std::shared_ptr<BranchInterfaceStubAdapter> &_adapter); + + const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client); + + + virtual void testBranchMethod(const std::shared_ptr<CommonAPI::ClientId> _client, int32_t _inInt, std::string _inString, testBranchMethodReply_t _reply); + + + +protected: + class RemoteEventHandler: public virtual BranchInterfaceStubRemoteEvent { + public: + RemoteEventHandler(BranchInterfaceStubDefault *_defaultStub); + + + private: + BranchInterfaceStubDefault *defaultStub_; + }; +private: + BranchInterfaceStubDefault::RemoteEventHandler remoteEventHandler_; + + + CommonAPI::Version interfaceVersion_; +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Branch_Interface_STUB_DEFAULT diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterface.cpp b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterface.cpp new file mode 100644 index 0000000..ed3c7e0 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterface.cpp @@ -0,0 +1,26 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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 "LeafInterface.hpp" + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +#ifndef WIN32 +const int32_t LeafInterface::testLeafMethodError::OK; +const int32_t LeafInterface::testLeafMethodError::NOTOK; +#endif + + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterface.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterface.hpp new file mode 100644 index 0000000..07cc9ff --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterface.hpp @@ -0,0 +1,64 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_HPP_ +#define COMMONAPI_TESTS_MANAGED_LEAF_INTERFACE_HPP_ + + + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/InputStream.hpp> +#include <CommonAPI/OutputStream.hpp> +#include <CommonAPI/Types.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +class LeafInterface { +public: + virtual ~LeafInterface() { } + + static inline const char* getInterface(); + static inline CommonAPI::Version getInterfaceVersion(); + + struct testLeafMethodError : CommonAPI::Enumeration<int32_t> { + testLeafMethodError() = default; + testLeafMethodError(const int32_t &_value) + : CommonAPI::Enumeration<int32_t>(_value) {} + static const int32_t OK = 0; + static const int32_t NOTOK = 1; + }; +}; + +const char* LeafInterface::getInterface() { + return ("commonapi.tests.managed.LeafInterface"); +} + +CommonAPI::Version LeafInterface::getInterfaceVersion() { + return CommonAPI::Version(1, 0); +} + + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +namespace CommonAPI { +} + +#endif // COMMONAPI_TESTS_MANAGED_LEAF_INTERFACE_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceDBusProxy.cpp b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceDBusProxy.cpp new file mode 100644 index 0000000..6fb9572 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/managed/LeafInterfaceDBusProxy.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceDBusProxy.hpp new file mode 100644 index 0000000..0534681 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.cpp b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.cpp new file mode 100644 index 0000000..3fb6774 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.hpp new file mode 100644 index 0000000..a6fd68c --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/managed/LeafInterfaceProxy.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceProxy.hpp new file mode 100644 index 0000000..3f4fcd9 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceProxy.hpp @@ -0,0 +1,154 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_PROXY_HPP_ +#define COMMONAPI_TESTS_MANAGED_Leaf_Interface_PROXY_HPP_ + +#include <v1_0/commonapi/tests/managed/LeafInterfaceProxyBase.hpp> + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +template <typename ... _AttributeExtensions> +class LeafInterfaceProxy + : virtual public LeafInterface, + virtual public LeafInterfaceProxyBase, + public _AttributeExtensions... { +public: + LeafInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate); + ~LeafInterfaceProxy(); + + typedef LeafInterface InterfaceType; + + + + + /** + * Calls testLeafMethod with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void 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 = nullptr); + /** + * Calls testLeafMethod with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> testLeafMethodAsync(const int32_t &_inInt, const std::string &_inString, TestLeafMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr); + + + /** + * Returns the CommonAPI address of the remote partner this proxy communicates with. + */ + virtual const CommonAPI::Address &getAddress() const; + + /** + * Returns true if the remote partner for this proxy is currently known to be available. + */ + virtual bool isAvailable() const; + + /** + * Returns true if the remote partner for this proxy is available. + */ + virtual bool isAvailableBlocking() const; + + /** + * Returns the wrapper class that is used to (de-)register for notifications about + * the availability of the remote partner of this proxy. + */ + virtual CommonAPI::ProxyStatusEvent& getProxyStatusEvent(); + + /** + * Returns the wrapper class that is used to access version information of the remote + * partner of this proxy. + */ + virtual CommonAPI::InterfaceVersionAttribute& getInterfaceVersionAttribute(); + + private: + std::shared_ptr<LeafInterfaceProxyBase> delegate_; +}; + +typedef LeafInterfaceProxy<> LeafInterfaceProxyDefault; + + +// +// LeafInterfaceProxy Implementation +// +template <typename ... _AttributeExtensions> +LeafInterfaceProxy<_AttributeExtensions...>::LeafInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate): + _AttributeExtensions(*(std::dynamic_pointer_cast<LeafInterfaceProxyBase>(delegate)))..., + delegate_(std::dynamic_pointer_cast<LeafInterfaceProxyBase>(delegate)) { +} + +template <typename ... _AttributeExtensions> +LeafInterfaceProxy<_AttributeExtensions...>::~LeafInterfaceProxy() { +} + +template <typename ... _AttributeExtensions> +void LeafInterfaceProxy<_AttributeExtensions...>::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) { + delegate_->testLeafMethod(_inInt, _inString, _status, _error, _outInt, _outString, _info); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> LeafInterfaceProxy<_AttributeExtensions...>::testLeafMethodAsync(const int32_t &_inInt, const std::string &_inString, TestLeafMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return delegate_->testLeafMethodAsync(_inInt, _inString, _callback, _info); +} + +template <typename ... _AttributeExtensions> +const CommonAPI::Address &LeafInterfaceProxy<_AttributeExtensions...>::getAddress() const { + return delegate_->getAddress(); +} + +template <typename ... _AttributeExtensions> +bool LeafInterfaceProxy<_AttributeExtensions...>::isAvailable() const { + return delegate_->isAvailable(); +} + +template <typename ... _AttributeExtensions> +bool LeafInterfaceProxy<_AttributeExtensions...>::isAvailableBlocking() const { + return delegate_->isAvailableBlocking(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::ProxyStatusEvent& LeafInterfaceProxy<_AttributeExtensions...>::getProxyStatusEvent() { + return delegate_->getProxyStatusEvent(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::InterfaceVersionAttribute& LeafInterfaceProxy<_AttributeExtensions...>::getInterfaceVersionAttribute() { + return delegate_->getInterfaceVersionAttribute(); +} + + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + + +#endif // COMMONAPI_TESTS_MANAGED_Leaf_Interface_PROXY_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceProxyBase.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceProxyBase.hpp new file mode 100644 index 0000000..4babc5d --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceProxyBase.hpp @@ -0,0 +1,51 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_PROXY_BASE_HPP_ +#define COMMONAPI_TESTS_MANAGED_Leaf_Interface_PROXY_BASE_HPP_ + +#include <v1_0/commonapi/tests/managed/LeafInterface.hpp> + + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <vector> + +#include <CommonAPI/Proxy.hpp> +#include <functional> +#include <future> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +class LeafInterfaceProxyBase + : virtual public CommonAPI::Proxy { +public: + + typedef std::function<void(const CommonAPI::CallStatus&, const LeafInterface::testLeafMethodError&, const int32_t&, const std::string&)> TestLeafMethodAsyncCallback; + + + + 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 = nullptr) = 0; + virtual std::future<CommonAPI::CallStatus> testLeafMethodAsync(const int32_t &_inInt, const std::string &_inString, TestLeafMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr) = 0; +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Leaf_Interface_PROXY_BASE_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceStub.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceStub.hpp new file mode 100644 index 0000000..e2d5854 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceStub.hpp @@ -0,0 +1,106 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_STUB_HPP_ +#define COMMONAPI_TESTS_MANAGED_Leaf_Interface_STUB_HPP_ + +#include <functional> + + + + +#include <v1_0/commonapi/tests/managed/LeafInterface.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <vector> + +#include <CommonAPI/Stub.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +/** + * Receives messages from remote and handles all dispatching of deserialized calls + * to a stub for the service LeafInterface. Also provides means to send broadcasts + * and attribute-changed-notifications of observable attributes as defined by this service. + * An application developer should not need to bother with this class. + */ +class LeafInterfaceStubAdapter + : virtual public CommonAPI::StubAdapter, + public LeafInterface { + public: + + + + virtual void deactivateManagedInstances() = 0; +protected: + /** + * Defines properties for storing the ClientIds of clients / proxies that have + * subscribed to the selective broadcasts + */ +}; + +/** + * Defines the necessary callbacks to handle remote set events related to the attributes + * defined in the IDL description for LeafInterface. + * For each attribute two callbacks are defined: + * - a verification callback that allows to verify the requested value and to prevent setting + * e.g. an invalid value ("onRemoteSet<AttributeName>"). + * - an action callback to do local work after the attribute value has been changed + * ("onRemote<AttributeName>Changed"). + * + * This class and the one below are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class LeafInterfaceStubRemoteEvent +{ +public: + virtual ~LeafInterfaceStubRemoteEvent() { } + +}; + +/** + * Defines the interface that must be implemented by any class that should provide + * the service LeafInterface to remote clients. + * This class and the one above are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class LeafInterfaceStub + : public virtual CommonAPI::Stub<LeafInterfaceStubAdapter, LeafInterfaceStubRemoteEvent> +{ +public: + typedef std::function<void (LeafInterface::testLeafMethodError _error, int32_t _outInt, std::string _outString)> testLeafMethodReply_t; + + virtual ~LeafInterfaceStub() {} + virtual const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) = 0; + + + /// This is the method that will be called on remote calls on the method testLeafMethod. + virtual void testLeafMethod(const std::shared_ptr<CommonAPI::ClientId> _client, int32_t _inInt, std::string _inString, testLeafMethodReply_t _reply) = 0; + + using CommonAPI::Stub<LeafInterfaceStubAdapter, LeafInterfaceStubRemoteEvent>::initStubAdapter; + typedef CommonAPI::Stub<LeafInterfaceStubAdapter, LeafInterfaceStubRemoteEvent>::StubAdapterType StubAdapterType; + typedef CommonAPI::Stub<LeafInterfaceStubAdapter, LeafInterfaceStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType; + typedef LeafInterfaceStubRemoteEvent RemoteEventType; + typedef LeafInterface StubInterface; +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Leaf_Interface_STUB_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceStubDefault.cpp b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceStubDefault.cpp new file mode 100644 index 0000000..6808e59 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceStubDefault.cpp @@ -0,0 +1,51 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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/LeafInterfaceStubDefault.hpp> +#include <assert.h> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +LeafInterfaceStubDefault::LeafInterfaceStubDefault(): + remoteEventHandler_(this), + interfaceVersion_(LeafInterface::getInterfaceVersion()) { +} + +const CommonAPI::Version& LeafInterfaceStubDefault::getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client) { + return interfaceVersion_; +} + +LeafInterfaceStubRemoteEvent* LeafInterfaceStubDefault::initStubAdapter(const std::shared_ptr<LeafInterfaceStubAdapter> &_adapter) { + CommonAPI::Stub<LeafInterfaceStubAdapter, LeafInterfaceStubRemoteEvent>::stubAdapter_ = _adapter; + return &remoteEventHandler_; +} + + +void LeafInterfaceStubDefault::testLeafMethod(const std::shared_ptr<CommonAPI::ClientId> _client, int32_t _inInt, std::string _inString, testLeafMethodReply_t _reply) { + LeafInterface::testLeafMethodError error; + int32_t outInt; + std::string outString; + _reply(error, outInt, outString); +} + + + + +LeafInterfaceStubDefault::RemoteEventHandler::RemoteEventHandler(LeafInterfaceStubDefault *_defaultStub) + : + defaultStub_(_defaultStub) { +} + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceStubDefault.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceStubDefault.hpp new file mode 100644 index 0000000..a188eff --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/LeafInterfaceStubDefault.hpp @@ -0,0 +1,67 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_STUB_DEFAULT_HPP_ +#define COMMONAPI_TESTS_MANAGED_Leaf_Interface_STUB_DEFAULT_HPP_ + + +#include <v1_0/commonapi/tests/managed/LeafInterfaceStub.hpp> +#include <sstream> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +/** + * Provides a default implementation for LeafInterfaceStubRemoteEvent and + * LeafInterfaceStub. Method callbacks have an empty implementation, + * remote set calls on attributes will always change the value of the attribute + * to the one received. + * + * Override this stub if you only want to provide a subset of the functionality + * that would be defined for this service, and/or if you do not need any non-default + * behaviour. + */ +class LeafInterfaceStubDefault + : public virtual LeafInterfaceStub { +public: + LeafInterfaceStubDefault(); + + LeafInterfaceStubRemoteEvent* initStubAdapter(const std::shared_ptr<LeafInterfaceStubAdapter> &_adapter); + + const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client); + + + virtual void testLeafMethod(const std::shared_ptr<CommonAPI::ClientId> _client, int32_t _inInt, std::string _inString, testLeafMethodReply_t _reply); + + + +protected: + class RemoteEventHandler: public virtual LeafInterfaceStubRemoteEvent { + public: + RemoteEventHandler(LeafInterfaceStubDefault *_defaultStub); + + + private: + LeafInterfaceStubDefault *defaultStub_; + }; +private: + LeafInterfaceStubDefault::RemoteEventHandler remoteEventHandler_; + + + CommonAPI::Version interfaceVersion_; +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Leaf_Interface_STUB_DEFAULT diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterface.cpp b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterface.cpp new file mode 100644 index 0000000..4625cdc --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterface.cpp @@ -0,0 +1,26 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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 "RootInterface.hpp" + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +#ifndef WIN32 +const int32_t RootInterface::testRootMethodError::OK; +const int32_t RootInterface::testRootMethodError::NOTOK; +#endif + + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterface.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterface.hpp new file mode 100644 index 0000000..5542224 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterface.hpp @@ -0,0 +1,65 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_HPP_ +#define COMMONAPI_TESTS_MANAGED_ROOT_INTERFACE_HPP_ + + +#include <set> + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/InputStream.hpp> +#include <CommonAPI/OutputStream.hpp> +#include <CommonAPI/Types.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +class RootInterface { +public: + virtual ~RootInterface() { } + + static inline const char* getInterface(); + static inline CommonAPI::Version getInterfaceVersion(); + + struct testRootMethodError : CommonAPI::Enumeration<int32_t> { + testRootMethodError() = default; + testRootMethodError(const int32_t &_value) + : CommonAPI::Enumeration<int32_t>(_value) {} + static const int32_t OK = 0; + static const int32_t NOTOK = 1; + }; +}; + +const char* RootInterface::getInterface() { + return ("commonapi.tests.managed.RootInterface"); +} + +CommonAPI::Version RootInterface::getInterfaceVersion() { + return CommonAPI::Version(1, 0); +} + + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +namespace CommonAPI { +} + +#endif // COMMONAPI_TESTS_MANAGED_ROOT_INTERFACE_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceDBusProxy.cpp b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceDBusProxy.cpp new file mode 100644 index 0000000..d9fa380 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/managed/RootInterfaceDBusProxy.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceDBusProxy.hpp new file mode 100644 index 0000000..9e59989 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/managed/RootInterfaceDBusStubAdapter.cpp b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceDBusStubAdapter.cpp new file mode 100644 index 0000000..eb46efa --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/managed/RootInterfaceDBusStubAdapter.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceDBusStubAdapter.hpp new file mode 100644 index 0000000..21121b9 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/managed/RootInterfaceProxy.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceProxy.hpp new file mode 100644 index 0000000..1c824b2 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceProxy.hpp @@ -0,0 +1,164 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_PROXY_HPP_ +#define COMMONAPI_TESTS_MANAGED_Root_Interface_PROXY_HPP_ + +#include <v1_0/commonapi/tests/managed/RootInterfaceProxyBase.hpp> + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +template <typename ... _AttributeExtensions> +class RootInterfaceProxy + : virtual public RootInterface, + virtual public RootInterfaceProxyBase, + public _AttributeExtensions... { +public: + RootInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate); + ~RootInterfaceProxy(); + + typedef RootInterface InterfaceType; + + + + + /** + * Calls testRootMethod with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void 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 = nullptr); + /** + * Calls testRootMethod with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> testRootMethodAsync(const int32_t &_inInt, const std::string &_inString, TestRootMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr); + + virtual CommonAPI::ProxyManager& getProxyManagerLeafInterface(); + virtual CommonAPI::ProxyManager& getProxyManagerBranchInterface(); + + /** + * Returns the CommonAPI address of the remote partner this proxy communicates with. + */ + virtual const CommonAPI::Address &getAddress() const; + + /** + * Returns true if the remote partner for this proxy is currently known to be available. + */ + virtual bool isAvailable() const; + + /** + * Returns true if the remote partner for this proxy is available. + */ + virtual bool isAvailableBlocking() const; + + /** + * Returns the wrapper class that is used to (de-)register for notifications about + * the availability of the remote partner of this proxy. + */ + virtual CommonAPI::ProxyStatusEvent& getProxyStatusEvent(); + + /** + * Returns the wrapper class that is used to access version information of the remote + * partner of this proxy. + */ + virtual CommonAPI::InterfaceVersionAttribute& getInterfaceVersionAttribute(); + + private: + std::shared_ptr<RootInterfaceProxyBase> delegate_; +}; + +typedef RootInterfaceProxy<> RootInterfaceProxyDefault; + + +// +// RootInterfaceProxy Implementation +// +template <typename ... _AttributeExtensions> +RootInterfaceProxy<_AttributeExtensions...>::RootInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate): + _AttributeExtensions(*(std::dynamic_pointer_cast<RootInterfaceProxyBase>(delegate)))..., + delegate_(std::dynamic_pointer_cast<RootInterfaceProxyBase>(delegate)) { +} + +template <typename ... _AttributeExtensions> +RootInterfaceProxy<_AttributeExtensions...>::~RootInterfaceProxy() { +} + +template <typename ... _AttributeExtensions> +void RootInterfaceProxy<_AttributeExtensions...>::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) { + delegate_->testRootMethod(_inInt, _inString, _status, _error, _outInt, _outString, _info); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> RootInterfaceProxy<_AttributeExtensions...>::testRootMethodAsync(const int32_t &_inInt, const std::string &_inString, TestRootMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return delegate_->testRootMethodAsync(_inInt, _inString, _callback, _info); +} + +template <typename ... _AttributeExtensions> +const CommonAPI::Address &RootInterfaceProxy<_AttributeExtensions...>::getAddress() const { + return delegate_->getAddress(); +} + +template <typename ... _AttributeExtensions> +bool RootInterfaceProxy<_AttributeExtensions...>::isAvailable() const { + return delegate_->isAvailable(); +} + +template <typename ... _AttributeExtensions> +bool RootInterfaceProxy<_AttributeExtensions...>::isAvailableBlocking() const { + return delegate_->isAvailableBlocking(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::ProxyStatusEvent& RootInterfaceProxy<_AttributeExtensions...>::getProxyStatusEvent() { + return delegate_->getProxyStatusEvent(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::InterfaceVersionAttribute& RootInterfaceProxy<_AttributeExtensions...>::getInterfaceVersionAttribute() { + return delegate_->getInterfaceVersionAttribute(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::ProxyManager& RootInterfaceProxy<_AttributeExtensions...>::getProxyManagerLeafInterface() { + return delegate_->getProxyManagerLeafInterface(); +} +template <typename ... _AttributeExtensions> +CommonAPI::ProxyManager& RootInterfaceProxy<_AttributeExtensions...>::getProxyManagerBranchInterface() { + return delegate_->getProxyManagerBranchInterface(); +} + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + + +#endif // COMMONAPI_TESTS_MANAGED_Root_Interface_PROXY_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceProxyBase.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceProxyBase.hpp new file mode 100644 index 0000000..6eb0cfc --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceProxyBase.hpp @@ -0,0 +1,56 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_PROXY_BASE_HPP_ +#define COMMONAPI_TESTS_MANAGED_Root_Interface_PROXY_BASE_HPP_ + +#include <v1_0/commonapi/tests/managed/RootInterface.hpp> + + +#include <v1_0/commonapi/tests/managed/BranchInterfaceStub.hpp> +#include <v1_0/commonapi/tests/managed/LeafInterfaceStub.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <vector> + +#include <CommonAPI/ProxyManager.hpp> +#include <CommonAPI/Proxy.hpp> +#include <functional> +#include <future> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +class RootInterfaceProxyBase + : virtual public CommonAPI::Proxy { +public: + + typedef std::function<void(const CommonAPI::CallStatus&, const RootInterface::testRootMethodError&, const int32_t&, const std::string&)> TestRootMethodAsyncCallback; + + + + 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 = nullptr) = 0; + virtual std::future<CommonAPI::CallStatus> testRootMethodAsync(const int32_t &_inInt, const std::string &_inString, TestRootMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual CommonAPI::ProxyManager& getProxyManagerLeafInterface() = 0; + virtual CommonAPI::ProxyManager& getProxyManagerBranchInterface() = 0; +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Root_Interface_PROXY_BASE_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceStub.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceStub.hpp new file mode 100644 index 0000000..f1d2349 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceStub.hpp @@ -0,0 +1,120 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_STUB_HPP_ +#define COMMONAPI_TESTS_MANAGED_Root_Interface_STUB_HPP_ + +#include <functional> + + + +#include <v1_0/commonapi/tests/managed/BranchInterfaceStub.hpp> +#include <v1_0/commonapi/tests/managed/LeafInterfaceStub.hpp> + +#include <v1_0/commonapi/tests/managed/RootInterface.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <vector> + +#include <CommonAPI/Stub.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +/** + * Receives messages from remote and handles all dispatching of deserialized calls + * to a stub for the service RootInterface. Also provides means to send broadcasts + * and attribute-changed-notifications of observable attributes as defined by this service. + * An application developer should not need to bother with this class. + */ +class RootInterfaceStubAdapter + : virtual public CommonAPI::StubAdapter, + public RootInterface { + public: + + + virtual bool registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub>, const std::string&) = 0; + virtual bool deregisterManagedStubLeafInterface(const std::string&) = 0; + virtual std::set<std::string>& getLeafInterfaceInstances() = 0; + virtual bool registerManagedStubBranchInterface(std::shared_ptr<BranchInterfaceStub>, const std::string&) = 0; + virtual bool deregisterManagedStubBranchInterface(const std::string&) = 0; + virtual std::set<std::string>& getBranchInterfaceInstances() = 0; + + virtual void deactivateManagedInstances() = 0; +protected: + /** + * Defines properties for storing the ClientIds of clients / proxies that have + * subscribed to the selective broadcasts + */ +}; + +/** + * Defines the necessary callbacks to handle remote set events related to the attributes + * defined in the IDL description for RootInterface. + * For each attribute two callbacks are defined: + * - a verification callback that allows to verify the requested value and to prevent setting + * e.g. an invalid value ("onRemoteSet<AttributeName>"). + * - an action callback to do local work after the attribute value has been changed + * ("onRemote<AttributeName>Changed"). + * + * This class and the one below are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class RootInterfaceStubRemoteEvent +{ +public: + virtual ~RootInterfaceStubRemoteEvent() { } + +}; + +/** + * Defines the interface that must be implemented by any class that should provide + * the service RootInterface to remote clients. + * This class and the one above are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class RootInterfaceStub + : public virtual CommonAPI::Stub<RootInterfaceStubAdapter, RootInterfaceStubRemoteEvent> +{ +public: + typedef std::function<void (RootInterface::testRootMethodError _error, int32_t _outInt, std::string _outString)> testRootMethodReply_t; + + virtual ~RootInterfaceStub() {} + virtual const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) = 0; + + + /// This is the method that will be called on remote calls on the method testRootMethod. + virtual void testRootMethod(const std::shared_ptr<CommonAPI::ClientId> _client, int32_t _inInt, std::string _inString, testRootMethodReply_t _reply) = 0; + + virtual bool registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub>, const std::string&) = 0; + virtual bool deregisterManagedStubLeafInterface(const std::string&) = 0; + virtual std::set<std::string>& getLeafInterfaceInstances() = 0; + virtual bool registerManagedStubBranchInterface(std::shared_ptr<BranchInterfaceStub>, const std::string&) = 0; + virtual bool deregisterManagedStubBranchInterface(const std::string&) = 0; + virtual std::set<std::string>& getBranchInterfaceInstances() = 0; + using CommonAPI::Stub<RootInterfaceStubAdapter, RootInterfaceStubRemoteEvent>::initStubAdapter; + typedef CommonAPI::Stub<RootInterfaceStubAdapter, RootInterfaceStubRemoteEvent>::StubAdapterType StubAdapterType; + typedef CommonAPI::Stub<RootInterfaceStubAdapter, RootInterfaceStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType; + typedef RootInterfaceStubRemoteEvent RemoteEventType; + typedef RootInterface StubInterface; +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Root_Interface_STUB_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceStubDefault.cpp b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceStubDefault.cpp new file mode 100644 index 0000000..59bcd88 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceStubDefault.cpp @@ -0,0 +1,92 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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/RootInterfaceStubDefault.hpp> +#include <assert.h> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +RootInterfaceStubDefault::RootInterfaceStubDefault(): + remoteEventHandler_(this), + autoInstanceCounter_(0), + interfaceVersion_(RootInterface::getInterfaceVersion()) { +} + +const CommonAPI::Version& RootInterfaceStubDefault::getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client) { + return interfaceVersion_; +} + +RootInterfaceStubRemoteEvent* RootInterfaceStubDefault::initStubAdapter(const std::shared_ptr<RootInterfaceStubAdapter> &_adapter) { + CommonAPI::Stub<RootInterfaceStubAdapter, RootInterfaceStubRemoteEvent>::stubAdapter_ = _adapter; + return &remoteEventHandler_; +} + + +void RootInterfaceStubDefault::testRootMethod(const std::shared_ptr<CommonAPI::ClientId> _client, int32_t _inInt, std::string _inString, testRootMethodReply_t _reply) { + RootInterface::testRootMethodError error; + int32_t outInt; + std::string outString; + _reply(error, outInt, outString); +} + + + +bool RootInterfaceStubDefault::registerManagedStubLeafInterfaceAutoInstance(std::shared_ptr<LeafInterfaceStub> _stub) { + autoInstanceCounter_++; + std::stringstream ss; + ss << stubAdapter_->getAddress().getInstance() << ".i" << autoInstanceCounter_; + std::string instance = ss.str(); + assert(stubAdapter_ !=NULL); + return stubAdapter_->registerManagedStubLeafInterface(_stub, instance); +} +bool RootInterfaceStubDefault::registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub> _stub, const std::string &_instance) { + assert(stubAdapter_ !=NULL); + return stubAdapter_->registerManagedStubLeafInterface(_stub, _instance); +} +bool RootInterfaceStubDefault::deregisterManagedStubLeafInterface(const std::string &_instance) { + assert(stubAdapter_ !=NULL); + return stubAdapter_->deregisterManagedStubLeafInterface(_instance); +} +std::set<std::string>& RootInterfaceStubDefault::getLeafInterfaceInstances() { + assert(stubAdapter_ !=NULL); + return stubAdapter_->getLeafInterfaceInstances(); +} +bool RootInterfaceStubDefault::registerManagedStubBranchInterfaceAutoInstance(std::shared_ptr<BranchInterfaceStub> _stub) { + autoInstanceCounter_++; + std::stringstream ss; + ss << stubAdapter_->getAddress().getInstance() << ".i" << autoInstanceCounter_; + std::string instance = ss.str(); + assert(stubAdapter_ !=NULL); + return stubAdapter_->registerManagedStubBranchInterface(_stub, instance); +} +bool RootInterfaceStubDefault::registerManagedStubBranchInterface(std::shared_ptr<BranchInterfaceStub> _stub, const std::string &_instance) { + assert(stubAdapter_ !=NULL); + return stubAdapter_->registerManagedStubBranchInterface(_stub, _instance); +} +bool RootInterfaceStubDefault::deregisterManagedStubBranchInterface(const std::string &_instance) { + assert(stubAdapter_ !=NULL); + return stubAdapter_->deregisterManagedStubBranchInterface(_instance); +} +std::set<std::string>& RootInterfaceStubDefault::getBranchInterfaceInstances() { + assert(stubAdapter_ !=NULL); + return stubAdapter_->getBranchInterfaceInstances(); +} + +RootInterfaceStubDefault::RemoteEventHandler::RemoteEventHandler(RootInterfaceStubDefault *_defaultStub) + : + defaultStub_(_defaultStub) { +} + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceStubDefault.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceStubDefault.hpp new file mode 100644 index 0000000..e5935a6 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/RootInterfaceStubDefault.hpp @@ -0,0 +1,76 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_STUB_DEFAULT_HPP_ +#define COMMONAPI_TESTS_MANAGED_Root_Interface_STUB_DEFAULT_HPP_ + + +#include <v1_0/commonapi/tests/managed/RootInterfaceStub.hpp> +#include <sstream> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +/** + * Provides a default implementation for RootInterfaceStubRemoteEvent and + * RootInterfaceStub. Method callbacks have an empty implementation, + * remote set calls on attributes will always change the value of the attribute + * to the one received. + * + * Override this stub if you only want to provide a subset of the functionality + * that would be defined for this service, and/or if you do not need any non-default + * behaviour. + */ +class RootInterfaceStubDefault + : public virtual RootInterfaceStub { +public: + RootInterfaceStubDefault(); + + RootInterfaceStubRemoteEvent* initStubAdapter(const std::shared_ptr<RootInterfaceStubAdapter> &_adapter); + + const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client); + + + virtual void testRootMethod(const std::shared_ptr<CommonAPI::ClientId> _client, int32_t _inInt, std::string _inString, testRootMethodReply_t _reply); + + + bool registerManagedStubLeafInterfaceAutoInstance(std::shared_ptr<LeafInterfaceStub>); + bool registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub>, const std::string&); + bool deregisterManagedStubLeafInterface(const std::string&); + std::set<std::string>& getLeafInterfaceInstances(); + bool registerManagedStubBranchInterfaceAutoInstance(std::shared_ptr<BranchInterfaceStub>); + bool registerManagedStubBranchInterface(std::shared_ptr<BranchInterfaceStub>, const std::string&); + bool deregisterManagedStubBranchInterface(const std::string&); + std::set<std::string>& getBranchInterfaceInstances(); + +protected: + class RemoteEventHandler: public virtual RootInterfaceStubRemoteEvent { + public: + RemoteEventHandler(RootInterfaceStubDefault *_defaultStub); + + + private: + RootInterfaceStubDefault *defaultStub_; + }; +private: + RootInterfaceStubDefault::RemoteEventHandler remoteEventHandler_; + uint32_t autoInstanceCounter_; + + + CommonAPI::Version interfaceVersion_; +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Root_Interface_STUB_DEFAULT diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRoot.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRoot.hpp new file mode 100644 index 0000000..4884f4a --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRoot.hpp @@ -0,0 +1,55 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_HPP_ +#define COMMONAPI_TESTS_MANAGED_SECOND_ROOT_HPP_ + + +#include <set> + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/Types.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +class SecondRoot { +public: + virtual ~SecondRoot() { } + + static inline const char* getInterface(); + static inline CommonAPI::Version getInterfaceVersion(); +}; + +const char* SecondRoot::getInterface() { + return ("commonapi.tests.managed.SecondRoot"); +} + +CommonAPI::Version SecondRoot::getInterfaceVersion() { + return CommonAPI::Version(1, 0); +} + + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +namespace CommonAPI { +} + +#endif // COMMONAPI_TESTS_MANAGED_SECOND_ROOT_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootDBusProxy.cpp b/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootDBusProxy.cpp new file mode 100644 index 0000000..87b1a66 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/managed/SecondRootDBusProxy.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootDBusProxy.hpp new file mode 100644 index 0000000..6ef5d20 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/managed/SecondRootDBusStubAdapter.cpp b/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootDBusStubAdapter.cpp new file mode 100644 index 0000000..33dd268 --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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/v1_0/commonapi/tests/managed/SecondRootDBusStubAdapter.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootDBusStubAdapter.hpp new file mode 100644 index 0000000..fb1714e --- /dev/null +++ b/src/test/src-gen/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.1.v201505270851. +* 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_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootProxy.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootProxy.hpp new file mode 100644 index 0000000..0047b37 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootProxy.hpp @@ -0,0 +1,129 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_PROXY_HPP_ +#define COMMONAPI_TESTS_MANAGED_Second_Root_PROXY_HPP_ + +#include <v1_0/commonapi/tests/managed/SecondRootProxyBase.hpp> + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +template <typename ... _AttributeExtensions> +class SecondRootProxy + : virtual public SecondRoot, + virtual public SecondRootProxyBase, + public _AttributeExtensions... { +public: + SecondRootProxy(std::shared_ptr<CommonAPI::Proxy> delegate); + ~SecondRootProxy(); + + typedef SecondRoot InterfaceType; + + + + + + virtual CommonAPI::ProxyManager& getProxyManagerLeafInterface(); + + /** + * Returns the CommonAPI address of the remote partner this proxy communicates with. + */ + virtual const CommonAPI::Address &getAddress() const; + + /** + * Returns true if the remote partner for this proxy is currently known to be available. + */ + virtual bool isAvailable() const; + + /** + * Returns true if the remote partner for this proxy is available. + */ + virtual bool isAvailableBlocking() const; + + /** + * Returns the wrapper class that is used to (de-)register for notifications about + * the availability of the remote partner of this proxy. + */ + virtual CommonAPI::ProxyStatusEvent& getProxyStatusEvent(); + + /** + * Returns the wrapper class that is used to access version information of the remote + * partner of this proxy. + */ + virtual CommonAPI::InterfaceVersionAttribute& getInterfaceVersionAttribute(); + + private: + std::shared_ptr<SecondRootProxyBase> delegate_; +}; + +typedef SecondRootProxy<> SecondRootProxyDefault; + + +// +// SecondRootProxy Implementation +// +template <typename ... _AttributeExtensions> +SecondRootProxy<_AttributeExtensions...>::SecondRootProxy(std::shared_ptr<CommonAPI::Proxy> delegate): + _AttributeExtensions(*(std::dynamic_pointer_cast<SecondRootProxyBase>(delegate)))..., + delegate_(std::dynamic_pointer_cast<SecondRootProxyBase>(delegate)) { +} + +template <typename ... _AttributeExtensions> +SecondRootProxy<_AttributeExtensions...>::~SecondRootProxy() { +} + + +template <typename ... _AttributeExtensions> +const CommonAPI::Address &SecondRootProxy<_AttributeExtensions...>::getAddress() const { + return delegate_->getAddress(); +} + +template <typename ... _AttributeExtensions> +bool SecondRootProxy<_AttributeExtensions...>::isAvailable() const { + return delegate_->isAvailable(); +} + +template <typename ... _AttributeExtensions> +bool SecondRootProxy<_AttributeExtensions...>::isAvailableBlocking() const { + return delegate_->isAvailableBlocking(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::ProxyStatusEvent& SecondRootProxy<_AttributeExtensions...>::getProxyStatusEvent() { + return delegate_->getProxyStatusEvent(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::InterfaceVersionAttribute& SecondRootProxy<_AttributeExtensions...>::getInterfaceVersionAttribute() { + return delegate_->getInterfaceVersionAttribute(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::ProxyManager& SecondRootProxy<_AttributeExtensions...>::getProxyManagerLeafInterface() { + return delegate_->getProxyManagerLeafInterface(); +} + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + + +#endif // COMMONAPI_TESTS_MANAGED_Second_Root_PROXY_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootProxyBase.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootProxyBase.hpp new file mode 100644 index 0000000..dbcc3f1 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootProxyBase.hpp @@ -0,0 +1,48 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_PROXY_BASE_HPP_ +#define COMMONAPI_TESTS_MANAGED_Second_Root_PROXY_BASE_HPP_ + +#include <v1_0/commonapi/tests/managed/SecondRoot.hpp> + + +#include <v1_0/commonapi/tests/managed/LeafInterfaceStub.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + + +#include <CommonAPI/ProxyManager.hpp> +#include <CommonAPI/Proxy.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +class SecondRootProxyBase + : virtual public CommonAPI::Proxy { +public: + + + + + virtual CommonAPI::ProxyManager& getProxyManagerLeafInterface() = 0; +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Second_Root_PROXY_BASE_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootStub.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootStub.hpp new file mode 100644 index 0000000..d23acf6 --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootStub.hpp @@ -0,0 +1,109 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_STUB_HPP_ +#define COMMONAPI_TESTS_MANAGED_Second_Root_STUB_HPP_ + +#include <functional> + + + +#include <v1_0/commonapi/tests/managed/LeafInterfaceStub.hpp> + +#include <v1_0/commonapi/tests/managed/SecondRoot.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + + +#include <CommonAPI/Stub.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +/** + * Receives messages from remote and handles all dispatching of deserialized calls + * to a stub for the service SecondRoot. Also provides means to send broadcasts + * and attribute-changed-notifications of observable attributes as defined by this service. + * An application developer should not need to bother with this class. + */ +class SecondRootStubAdapter + : virtual public CommonAPI::StubAdapter, + public SecondRoot { + public: + + + virtual bool registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub>, const std::string&) = 0; + virtual bool deregisterManagedStubLeafInterface(const std::string&) = 0; + virtual std::set<std::string>& getLeafInterfaceInstances() = 0; + + virtual void deactivateManagedInstances() = 0; +protected: + /** + * Defines properties for storing the ClientIds of clients / proxies that have + * subscribed to the selective broadcasts + */ +}; + +/** + * Defines the necessary callbacks to handle remote set events related to the attributes + * defined in the IDL description for SecondRoot. + * For each attribute two callbacks are defined: + * - a verification callback that allows to verify the requested value and to prevent setting + * e.g. an invalid value ("onRemoteSet<AttributeName>"). + * - an action callback to do local work after the attribute value has been changed + * ("onRemote<AttributeName>Changed"). + * + * This class and the one below are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class SecondRootStubRemoteEvent +{ +public: + virtual ~SecondRootStubRemoteEvent() { } + +}; + +/** + * Defines the interface that must be implemented by any class that should provide + * the service SecondRoot to remote clients. + * This class and the one above are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class SecondRootStub + : public virtual CommonAPI::Stub<SecondRootStubAdapter, SecondRootStubRemoteEvent> +{ +public: + + virtual ~SecondRootStub() {} + virtual const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) = 0; + + + + virtual bool registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub>, const std::string&) = 0; + virtual bool deregisterManagedStubLeafInterface(const std::string&) = 0; + virtual std::set<std::string>& getLeafInterfaceInstances() = 0; + using CommonAPI::Stub<SecondRootStubAdapter, SecondRootStubRemoteEvent>::initStubAdapter; + typedef CommonAPI::Stub<SecondRootStubAdapter, SecondRootStubRemoteEvent>::StubAdapterType StubAdapterType; + typedef CommonAPI::Stub<SecondRootStubAdapter, SecondRootStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType; + typedef SecondRootStubRemoteEvent RemoteEventType; + typedef SecondRoot StubInterface; +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Second_Root_STUB_HPP_ diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootStubDefault.cpp b/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootStubDefault.cpp new file mode 100644 index 0000000..f1b7b0b --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootStubDefault.cpp @@ -0,0 +1,65 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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/SecondRootStubDefault.hpp> +#include <assert.h> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +SecondRootStubDefault::SecondRootStubDefault(): + remoteEventHandler_(this), + autoInstanceCounter_(0), + interfaceVersion_(SecondRoot::getInterfaceVersion()) { +} + +const CommonAPI::Version& SecondRootStubDefault::getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client) { + return interfaceVersion_; +} + +SecondRootStubRemoteEvent* SecondRootStubDefault::initStubAdapter(const std::shared_ptr<SecondRootStubAdapter> &_adapter) { + CommonAPI::Stub<SecondRootStubAdapter, SecondRootStubRemoteEvent>::stubAdapter_ = _adapter; + return &remoteEventHandler_; +} + + + + +bool SecondRootStubDefault::registerManagedStubLeafInterfaceAutoInstance(std::shared_ptr<LeafInterfaceStub> _stub) { + autoInstanceCounter_++; + std::stringstream ss; + ss << stubAdapter_->getAddress().getInstance() << ".i" << autoInstanceCounter_; + std::string instance = ss.str(); + assert(stubAdapter_ !=NULL); + return stubAdapter_->registerManagedStubLeafInterface(_stub, instance); +} +bool SecondRootStubDefault::registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub> _stub, const std::string &_instance) { + assert(stubAdapter_ !=NULL); + return stubAdapter_->registerManagedStubLeafInterface(_stub, _instance); +} +bool SecondRootStubDefault::deregisterManagedStubLeafInterface(const std::string &_instance) { + assert(stubAdapter_ !=NULL); + return stubAdapter_->deregisterManagedStubLeafInterface(_instance); +} +std::set<std::string>& SecondRootStubDefault::getLeafInterfaceInstances() { + assert(stubAdapter_ !=NULL); + return stubAdapter_->getLeafInterfaceInstances(); +} + +SecondRootStubDefault::RemoteEventHandler::RemoteEventHandler(SecondRootStubDefault *_defaultStub) + : + defaultStub_(_defaultStub) { +} + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootStubDefault.hpp b/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootStubDefault.hpp new file mode 100644 index 0000000..d84f20a --- /dev/null +++ b/src/test/src-gen/v1_0/commonapi/tests/managed/SecondRootStubDefault.hpp @@ -0,0 +1,71 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.1.v201505270851. +* 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_STUB_DEFAULT_HPP_ +#define COMMONAPI_TESTS_MANAGED_Second_Root_STUB_DEFAULT_HPP_ + + +#include <v1_0/commonapi/tests/managed/SecondRootStub.hpp> +#include <sstream> + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + +/** + * Provides a default implementation for SecondRootStubRemoteEvent and + * SecondRootStub. Method callbacks have an empty implementation, + * remote set calls on attributes will always change the value of the attribute + * to the one received. + * + * Override this stub if you only want to provide a subset of the functionality + * that would be defined for this service, and/or if you do not need any non-default + * behaviour. + */ +class SecondRootStubDefault + : public virtual SecondRootStub { +public: + SecondRootStubDefault(); + + SecondRootStubRemoteEvent* initStubAdapter(const std::shared_ptr<SecondRootStubAdapter> &_adapter); + + const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client); + + + + + bool registerManagedStubLeafInterfaceAutoInstance(std::shared_ptr<LeafInterfaceStub>); + bool registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub>, const std::string&); + bool deregisterManagedStubLeafInterface(const std::string&); + std::set<std::string>& getLeafInterfaceInstances(); + +protected: + class RemoteEventHandler: public virtual SecondRootStubRemoteEvent { + public: + RemoteEventHandler(SecondRootStubDefault *_defaultStub); + + + private: + SecondRootStubDefault *defaultStub_; + }; +private: + SecondRootStubDefault::RemoteEventHandler remoteEventHandler_; + uint32_t autoInstanceCounter_; + + + CommonAPI::Version interfaceVersion_; +}; + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_MANAGED_Second_Root_STUB_DEFAULT |