diff options
Diffstat (limited to 'src/test/src-gen/core/v1_0')
57 files changed, 5821 insertions, 0 deletions
diff --git a/src/test/src-gen/core/v1_0/commonapi/tests/ExtendedInterface.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/ExtendedInterface.hpp new file mode 100644 index 0000000..2bf3f5c --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_EXTENDED_INTERFACE_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/core/v1_0/commonapi/tests/ExtendedInterfaceProxy.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/ExtendedInterfaceProxy.hpp new file mode 100644 index 0000000..66951e6 --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_Extended_Interface_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* getInterface() { + return(ExtendedInterface::getInterface()); + } + + + + /** + * 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/core/v1_0/commonapi/tests/ExtendedInterfaceProxyBase.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/ExtendedInterfaceProxyBase.hpp new file mode 100644 index 0000000..4b5bed2 --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_Extended_Interface_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/core/v1_0/commonapi/tests/ExtendedInterfaceStub.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/ExtendedInterfaceStub.hpp new file mode 100644 index 0000000..09d23ca --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_Extended_Interface_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/core/v1_0/commonapi/tests/ExtendedInterfaceStubDefault.cpp b/src/test/src-gen/core/v1_0/commonapi/tests/ExtendedInterfaceStubDefault.cpp new file mode 100644 index 0000000..8e81969 --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#include <v1_0/commonapi/tests/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/core/v1_0/commonapi/tests/ExtendedInterfaceStubDefault.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/ExtendedInterfaceStubDefault.hpp new file mode 100644 index 0000000..906fc03 --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_Extended_Interface_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/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterface.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterface.hpp new file mode 100644 index 0000000..7356067 --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterface.hpp @@ -0,0 +1,54 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_TEST_FREEDESKTOP_DERIVED_INTERFACE_HPP_ +#define COMMONAPI_TESTS_TEST_FREEDESKTOP_DERIVED_INTERFACE_HPP_ + + + +#include <v1_0/commonapi/tests/TestFreedesktopInterface.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 TestFreedesktopDerivedInterface +: virtual public TestFreedesktopInterface { +public: + virtual ~TestFreedesktopDerivedInterface() { } + + static inline const char* getInterface(); + static inline CommonAPI::Version getInterfaceVersion(); +}; + +const char* TestFreedesktopDerivedInterface::getInterface() { + return ("commonapi.tests.TestFreedesktopDerivedInterface"); +} + +CommonAPI::Version TestFreedesktopDerivedInterface::getInterfaceVersion() { + return CommonAPI::Version(1, 0); +} + + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +namespace CommonAPI { +} + +#endif // COMMONAPI_TESTS_TEST_FREEDESKTOP_DERIVED_INTERFACE_HPP_ diff --git a/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceProxy.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceProxy.hpp new file mode 100644 index 0000000..184de9d --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceProxy.hpp @@ -0,0 +1,169 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_Test_Freedesktop_Derived_Interface_PROXY_HPP_ +#define COMMONAPI_TESTS_Test_Freedesktop_Derived_Interface_PROXY_HPP_ + +#include <v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceProxyBase.hpp> + +#include "v1_0/commonapi/tests/TestFreedesktopInterfaceProxy.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 TestFreedesktopDerivedInterfaceProxy + : virtual public TestFreedesktopDerivedInterface, + virtual public TestFreedesktopDerivedInterfaceProxyBase, + virtual public TestFreedesktopInterfaceProxy<_AttributeExtensions...>, + public _AttributeExtensions... { +public: + TestFreedesktopDerivedInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate); + ~TestFreedesktopDerivedInterfaceProxy(); + + typedef TestFreedesktopDerivedInterface InterfaceType; + + inline static const char* getInterface() { + return(TestFreedesktopDerivedInterface::getInterface()); + } + + /** + * Returns the wrapper class that provides access to the attribute TestAttributedFromDerivedInterface. + */ + virtual TestAttributedFromDerivedInterfaceAttribute& getTestAttributedFromDerivedInterfaceAttribute() { + return delegate_->getTestAttributedFromDerivedInterfaceAttribute(); + } + + + + + /** + * 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<TestFreedesktopDerivedInterfaceProxyBase> delegate_; +}; + +typedef TestFreedesktopDerivedInterfaceProxy<> TestFreedesktopDerivedInterfaceProxyDefault; + +namespace TestFreedesktopDerivedInterfaceExtensions { + template <template <typename > class _ExtensionType> + class TestAttributedFromDerivedInterfaceAttributeExtension { + public: + typedef _ExtensionType<TestFreedesktopDerivedInterfaceProxyBase::TestAttributedFromDerivedInterfaceAttribute> extension_type; + + static_assert(std::is_base_of<typename CommonAPI::AttributeExtension<TestFreedesktopDerivedInterfaceProxyBase::TestAttributedFromDerivedInterfaceAttribute>, extension_type>::value, + "Not CommonAPI Attribute Extension!"); + #ifdef WIN32 + TestAttributedFromDerivedInterfaceAttributeExtension() {} + #endif + + TestAttributedFromDerivedInterfaceAttributeExtension(TestFreedesktopDerivedInterfaceProxyBase& proxy): attributeExtension_(proxy.getTestAttributedFromDerivedInterfaceAttribute()) { + } + + inline extension_type& getTestAttributedFromDerivedInterfaceAttributeExtension() { + return attributeExtension_; + } + + private: + extension_type attributeExtension_; + }; + +} // namespace TestFreedesktopDerivedInterfaceExtensions + +// +// TestFreedesktopDerivedInterfaceProxy Implementation +// +template <typename ... _AttributeExtensions> +TestFreedesktopDerivedInterfaceProxy<_AttributeExtensions...>::TestFreedesktopDerivedInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate): + TestFreedesktopInterfaceProxy<_AttributeExtensions...>(delegate), + _AttributeExtensions(*(std::dynamic_pointer_cast<TestFreedesktopDerivedInterfaceProxyBase>(delegate)))..., + delegate_(std::dynamic_pointer_cast<TestFreedesktopDerivedInterfaceProxyBase>(delegate)) { +} + +template <typename ... _AttributeExtensions> +TestFreedesktopDerivedInterfaceProxy<_AttributeExtensions...>::~TestFreedesktopDerivedInterfaceProxy() { +} + + +template <typename ... _AttributeExtensions> +const CommonAPI::Address &TestFreedesktopDerivedInterfaceProxy<_AttributeExtensions...>::getAddress() const { + return delegate_->getAddress(); +} + +template <typename ... _AttributeExtensions> +bool TestFreedesktopDerivedInterfaceProxy<_AttributeExtensions...>::isAvailable() const { + return delegate_->isAvailable(); +} + +template <typename ... _AttributeExtensions> +bool TestFreedesktopDerivedInterfaceProxy<_AttributeExtensions...>::isAvailableBlocking() const { + return delegate_->isAvailableBlocking(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::ProxyStatusEvent& TestFreedesktopDerivedInterfaceProxy<_AttributeExtensions...>::getProxyStatusEvent() { + return delegate_->getProxyStatusEvent(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::InterfaceVersionAttribute& TestFreedesktopDerivedInterfaceProxy<_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::TestFreedesktopDerivedInterfaceProxy, + _AttributeExtension> { + typedef typename ::v1_0::commonapi::tests::TestFreedesktopDerivedInterfaceProxy< + ::v1_0::commonapi::tests::TestFreedesktopDerivedInterfaceExtensions::TestAttributedFromDerivedInterfaceAttributeExtension<_AttributeExtension> + > class_t; +}; +} + +#endif // COMMONAPI_TESTS_Test_Freedesktop_Derived_Interface_PROXY_HPP_ diff --git a/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceProxyBase.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceProxyBase.hpp new file mode 100644 index 0000000..878fc6a --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceProxyBase.hpp @@ -0,0 +1,47 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_Test_Freedesktop_Derived_Interface_PROXY_BASE_HPP_ +#define COMMONAPI_TESTS_Test_Freedesktop_Derived_Interface_PROXY_BASE_HPP_ + +#include <v1_0/commonapi/tests/TestFreedesktopDerivedInterface.hpp> +#include <v1_0/commonapi/tests/TestFreedesktopInterfaceProxyBase.hpp> + + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + + +#include <CommonAPI/Attribute.hpp> +#include <CommonAPI/Proxy.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { + +class TestFreedesktopDerivedInterfaceProxyBase + : virtual public TestFreedesktopInterfaceProxyBase { +public: + typedef CommonAPI::ObservableAttribute<uint32_t> TestAttributedFromDerivedInterfaceAttribute; + + + virtual TestAttributedFromDerivedInterfaceAttribute& getTestAttributedFromDerivedInterfaceAttribute() = 0; + + +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Test_Freedesktop_Derived_Interface_PROXY_BASE_HPP_ diff --git a/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceStub.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceStub.hpp new file mode 100644 index 0000000..7276fd0 --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceStub.hpp @@ -0,0 +1,112 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_Test_Freedesktop_Derived_Interface_STUB_HPP_ +#define COMMONAPI_TESTS_Test_Freedesktop_Derived_Interface_STUB_HPP_ + +#include <functional> + + + +#include <v1_0/commonapi/tests/TestFreedesktopInterfaceStub.hpp> + +#include <v1_0/commonapi/tests/TestFreedesktopDerivedInterface.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 { + +/** + * Receives messages from remote and handles all dispatching of deserialized calls + * to a stub for the service TestFreedesktopDerivedInterface. 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 TestFreedesktopDerivedInterfaceStubAdapter + : virtual public CommonAPI::StubAdapter, + public TestFreedesktopDerivedInterface, + public virtual TestFreedesktopInterfaceStubAdapter { + public: + ///Notifies all remote listeners about a change of value of the attribute TestAttributedFromDerivedInterface. + virtual void fireTestAttributedFromDerivedInterfaceAttributeChanged(const uint32_t& TestAttributedFromDerivedInterface) = 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 TestFreedesktopDerivedInterface. + * 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 TestFreedesktopDerivedInterfaceStubRemoteEvent +: public virtual TestFreedesktopInterfaceStubRemoteEvent +{ +public: + virtual ~TestFreedesktopDerivedInterfaceStubRemoteEvent() { } + + /// Verification callback for remote set requests on the attribute TestAttributedFromDerivedInterface + virtual bool onRemoteSetTestAttributedFromDerivedInterfaceAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t TestAttributedFromDerivedInterface) = 0; + /// Action callback for remote set requests on the attribute TestAttributedFromDerivedInterface + virtual void onRemoteTestAttributedFromDerivedInterfaceAttributeChanged() = 0; +}; + +/** + * Defines the interface that must be implemented by any class that should provide + * the service TestFreedesktopDerivedInterface 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 TestFreedesktopDerivedInterfaceStub + : public virtual CommonAPI::Stub<TestFreedesktopDerivedInterfaceStubAdapter, TestFreedesktopDerivedInterfaceStubRemoteEvent>, + public virtual TestFreedesktopInterfaceStub +{ +public: + + virtual ~TestFreedesktopDerivedInterfaceStub() {} + virtual const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) = 0; + + /// Provides getter access to the attribute TestAttributedFromDerivedInterface + virtual const uint32_t &getTestAttributedFromDerivedInterfaceAttribute(const std::shared_ptr<CommonAPI::ClientId> _client) = 0; + + + using CommonAPI::Stub<TestFreedesktopDerivedInterfaceStubAdapter, TestFreedesktopDerivedInterfaceStubRemoteEvent>::initStubAdapter; + typedef CommonAPI::Stub<TestFreedesktopDerivedInterfaceStubAdapter, TestFreedesktopDerivedInterfaceStubRemoteEvent>::StubAdapterType StubAdapterType; + typedef CommonAPI::Stub<TestFreedesktopDerivedInterfaceStubAdapter, TestFreedesktopDerivedInterfaceStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType; + typedef TestFreedesktopDerivedInterfaceStubRemoteEvent RemoteEventType; + typedef TestFreedesktopDerivedInterface StubInterface; +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Test_Freedesktop_Derived_Interface_STUB_HPP_ diff --git a/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceStubDefault.cpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceStubDefault.cpp new file mode 100644 index 0000000..dfccb28 --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceStubDefault.cpp @@ -0,0 +1,93 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#include <v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceStubDefault.hpp> +#include <assert.h> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +TestFreedesktopDerivedInterfaceStubDefault::TestFreedesktopDerivedInterfaceStubDefault(): + remoteEventHandler_(this), + interfaceVersion_(TestFreedesktopDerivedInterface::getInterfaceVersion()) { +} + +const CommonAPI::Version& TestFreedesktopDerivedInterfaceStubDefault::getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client) { + return interfaceVersion_; +} + +TestFreedesktopDerivedInterfaceStubRemoteEvent* TestFreedesktopDerivedInterfaceStubDefault::initStubAdapter(const std::shared_ptr<TestFreedesktopDerivedInterfaceStubAdapter> &_adapter) { + TestFreedesktopInterfaceStubDefault::initStubAdapter(_adapter); + CommonAPI::Stub<TestFreedesktopDerivedInterfaceStubAdapter, TestFreedesktopDerivedInterfaceStubRemoteEvent>::stubAdapter_ = _adapter; + return &remoteEventHandler_; +} + +const uint32_t& TestFreedesktopDerivedInterfaceStubDefault::getTestAttributedFromDerivedInterfaceAttribute() { + return testAttributedFromDerivedInterfaceAttributeValue_; +} + +const uint32_t& TestFreedesktopDerivedInterfaceStubDefault::getTestAttributedFromDerivedInterfaceAttribute(const std::shared_ptr<CommonAPI::ClientId> _client) { + return getTestAttributedFromDerivedInterfaceAttribute(); +} + +void TestFreedesktopDerivedInterfaceStubDefault::setTestAttributedFromDerivedInterfaceAttribute(uint32_t _value) { + const bool valueChanged = trySetTestAttributedFromDerivedInterfaceAttribute(std::move(_value)); + if (valueChanged && stubAdapter_ != NULL) { + CommonAPI::Stub<TestFreedesktopDerivedInterfaceStubAdapter, TestFreedesktopDerivedInterfaceStubRemoteEvent>::stubAdapter_->fireTestAttributedFromDerivedInterfaceAttributeChanged(testAttributedFromDerivedInterfaceAttributeValue_); + } +} + +bool TestFreedesktopDerivedInterfaceStubDefault::trySetTestAttributedFromDerivedInterfaceAttribute(uint32_t _value) { + if (!validateTestAttributedFromDerivedInterfaceAttributeRequestedValue(_value)) + return false; + + const bool valueChanged = (testAttributedFromDerivedInterfaceAttributeValue_ != _value); + testAttributedFromDerivedInterfaceAttributeValue_ = std::move(_value); + return valueChanged; +} + +bool TestFreedesktopDerivedInterfaceStubDefault::validateTestAttributedFromDerivedInterfaceAttributeRequestedValue(const uint32_t &_value) { + return true; +} + +void TestFreedesktopDerivedInterfaceStubDefault::setTestAttributedFromDerivedInterfaceAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _value) { + setTestAttributedFromDerivedInterfaceAttribute(_value); +} + +void TestFreedesktopDerivedInterfaceStubDefault::onRemoteTestAttributedFromDerivedInterfaceAttributeChanged() { + // No operation in default +} + +void TestFreedesktopDerivedInterfaceStubDefault::RemoteEventHandler::onRemoteTestAttributedFromDerivedInterfaceAttributeChanged() { + assert(defaultStub_ !=NULL); + defaultStub_->onRemoteTestAttributedFromDerivedInterfaceAttributeChanged(); +} + +bool TestFreedesktopDerivedInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestAttributedFromDerivedInterfaceAttribute(uint32_t _value) { + assert(defaultStub_ !=NULL); + return defaultStub_->trySetTestAttributedFromDerivedInterfaceAttribute(std::move(_value)); +} + +bool TestFreedesktopDerivedInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestAttributedFromDerivedInterfaceAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _value) { + return onRemoteSetTestAttributedFromDerivedInterfaceAttribute(_value); +} + + + + + +TestFreedesktopDerivedInterfaceStubDefault::RemoteEventHandler::RemoteEventHandler(TestFreedesktopDerivedInterfaceStubDefault *_defaultStub) + : TestFreedesktopInterfaceStubDefault::RemoteEventHandler(_defaultStub), + defaultStub_(_defaultStub) { +} + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceStubDefault.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceStubDefault.hpp new file mode 100644 index 0000000..1e7554f --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceStubDefault.hpp @@ -0,0 +1,78 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_Test_Freedesktop_Derived_Interface_STUB_DEFAULT_HPP_ +#define COMMONAPI_TESTS_Test_Freedesktop_Derived_Interface_STUB_DEFAULT_HPP_ + +#include <v1_0/commonapi/tests/TestFreedesktopInterfaceStubDefault.hpp> + +#include <v1_0/commonapi/tests/TestFreedesktopDerivedInterfaceStub.hpp> +#include <sstream> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +/** + * Provides a default implementation for TestFreedesktopDerivedInterfaceStubRemoteEvent and + * TestFreedesktopDerivedInterfaceStub. 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 TestFreedesktopDerivedInterfaceStubDefault + : public virtual TestFreedesktopDerivedInterfaceStub, + public virtual TestFreedesktopInterfaceStubDefault { +public: + TestFreedesktopDerivedInterfaceStubDefault(); + + TestFreedesktopDerivedInterfaceStubRemoteEvent* initStubAdapter(const std::shared_ptr<TestFreedesktopDerivedInterfaceStubAdapter> &_adapter); + + const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client); + + virtual const uint32_t& getTestAttributedFromDerivedInterfaceAttribute(); + virtual const uint32_t& getTestAttributedFromDerivedInterfaceAttribute(const std::shared_ptr<CommonAPI::ClientId> _client); + virtual void setTestAttributedFromDerivedInterfaceAttribute(uint32_t _value); + virtual void setTestAttributedFromDerivedInterfaceAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _value); + + + + +protected: + virtual bool trySetTestAttributedFromDerivedInterfaceAttribute(uint32_t _value); + virtual bool validateTestAttributedFromDerivedInterfaceAttributeRequestedValue(const uint32_t &_value); + virtual void onRemoteTestAttributedFromDerivedInterfaceAttributeChanged(); + class RemoteEventHandler: public virtual TestFreedesktopDerivedInterfaceStubRemoteEvent, public virtual TestFreedesktopInterfaceStubDefault::RemoteEventHandler { + public: + RemoteEventHandler(TestFreedesktopDerivedInterfaceStubDefault *_defaultStub); + + virtual bool onRemoteSetTestAttributedFromDerivedInterfaceAttribute(uint32_t _value); + virtual bool onRemoteSetTestAttributedFromDerivedInterfaceAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _value); + virtual void onRemoteTestAttributedFromDerivedInterfaceAttributeChanged(); + + + private: + TestFreedesktopDerivedInterfaceStubDefault *defaultStub_; + }; +private: + TestFreedesktopDerivedInterfaceStubDefault::RemoteEventHandler remoteEventHandler_; + + uint32_t testAttributedFromDerivedInterfaceAttributeValue_; + + CommonAPI::Version interfaceVersion_; +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Test_Freedesktop_Derived_Interface_STUB_DEFAULT diff --git a/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterface.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterface.hpp new file mode 100644 index 0000000..cbfb596 --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterface.hpp @@ -0,0 +1,52 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_TEST_FREEDESKTOP_INTERFACE_HPP_ +#define COMMONAPI_TESTS_TEST_FREEDESKTOP_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 TestFreedesktopInterface { +public: + virtual ~TestFreedesktopInterface() { } + + static inline const char* getInterface(); + static inline CommonAPI::Version getInterfaceVersion(); +}; + +const char* TestFreedesktopInterface::getInterface() { + return ("commonapi.tests.TestFreedesktopInterface"); +} + +CommonAPI::Version TestFreedesktopInterface::getInterfaceVersion() { + return CommonAPI::Version(1, 0); +} + + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +namespace CommonAPI { +} + +#endif // COMMONAPI_TESTS_TEST_FREEDESKTOP_INTERFACE_HPP_ diff --git a/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterfaceProxy.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterfaceProxy.hpp new file mode 100644 index 0000000..2cd92b5 --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterfaceProxy.hpp @@ -0,0 +1,250 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_Test_Freedesktop_Interface_PROXY_HPP_ +#define COMMONAPI_TESTS_Test_Freedesktop_Interface_PROXY_HPP_ + +#include <v1_0/commonapi/tests/TestFreedesktopInterfaceProxyBase.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 TestFreedesktopInterfaceProxy + : virtual public TestFreedesktopInterface, + virtual public TestFreedesktopInterfaceProxyBase, + public _AttributeExtensions... { +public: + TestFreedesktopInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate); + ~TestFreedesktopInterfaceProxy(); + + typedef TestFreedesktopInterface 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 TestReadonlyAttribute. + */ + virtual TestReadonlyAttributeAttribute& getTestReadonlyAttributeAttribute() { + return delegate_->getTestReadonlyAttributeAttribute(); + } + /** + * 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 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<TestFreedesktopInterfaceProxyBase> delegate_; +}; + +typedef TestFreedesktopInterfaceProxy<> TestFreedesktopInterfaceProxyDefault; + +namespace TestFreedesktopInterfaceExtensions { + template <template <typename > class _ExtensionType> + class TestPredefinedTypeAttributeAttributeExtension { + public: + typedef _ExtensionType<TestFreedesktopInterfaceProxyBase::TestPredefinedTypeAttributeAttribute> extension_type; + + static_assert(std::is_base_of<typename CommonAPI::AttributeExtension<TestFreedesktopInterfaceProxyBase::TestPredefinedTypeAttributeAttribute>, extension_type>::value, + "Not CommonAPI Attribute Extension!"); + #ifdef WIN32 + TestPredefinedTypeAttributeAttributeExtension() {} + #endif + + TestPredefinedTypeAttributeAttributeExtension(TestFreedesktopInterfaceProxyBase& proxy): attributeExtension_(proxy.getTestPredefinedTypeAttributeAttribute()) { + } + + inline extension_type& getTestPredefinedTypeAttributeAttributeExtension() { + return attributeExtension_; + } + + private: + extension_type attributeExtension_; + }; + + template <template <typename > class _ExtensionType> + class TestReadonlyAttributeAttributeExtension { + public: + typedef _ExtensionType<TestFreedesktopInterfaceProxyBase::TestReadonlyAttributeAttribute> extension_type; + + static_assert(std::is_base_of<typename CommonAPI::AttributeExtension<TestFreedesktopInterfaceProxyBase::TestReadonlyAttributeAttribute>, extension_type>::value, + "Not CommonAPI Attribute Extension!"); + #ifdef WIN32 + TestReadonlyAttributeAttributeExtension() {} + #endif + + TestReadonlyAttributeAttributeExtension(TestFreedesktopInterfaceProxyBase& proxy): attributeExtension_(proxy.getTestReadonlyAttributeAttribute()) { + } + + inline extension_type& getTestReadonlyAttributeAttributeExtension() { + return attributeExtension_; + } + + private: + extension_type attributeExtension_; + }; + + template <template <typename > class _ExtensionType> + class TestDerivedStructAttributeAttributeExtension { + public: + typedef _ExtensionType<TestFreedesktopInterfaceProxyBase::TestDerivedStructAttributeAttribute> extension_type; + + static_assert(std::is_base_of<typename CommonAPI::AttributeExtension<TestFreedesktopInterfaceProxyBase::TestDerivedStructAttributeAttribute>, extension_type>::value, + "Not CommonAPI Attribute Extension!"); + #ifdef WIN32 + TestDerivedStructAttributeAttributeExtension() {} + #endif + + TestDerivedStructAttributeAttributeExtension(TestFreedesktopInterfaceProxyBase& proxy): attributeExtension_(proxy.getTestDerivedStructAttributeAttribute()) { + } + + inline extension_type& getTestDerivedStructAttributeAttributeExtension() { + return attributeExtension_; + } + + private: + extension_type attributeExtension_; + }; + + template <template <typename > class _ExtensionType> + class TestDerivedArrayAttributeAttributeExtension { + public: + typedef _ExtensionType<TestFreedesktopInterfaceProxyBase::TestDerivedArrayAttributeAttribute> extension_type; + + static_assert(std::is_base_of<typename CommonAPI::AttributeExtension<TestFreedesktopInterfaceProxyBase::TestDerivedArrayAttributeAttribute>, extension_type>::value, + "Not CommonAPI Attribute Extension!"); + #ifdef WIN32 + TestDerivedArrayAttributeAttributeExtension() {} + #endif + + TestDerivedArrayAttributeAttributeExtension(TestFreedesktopInterfaceProxyBase& proxy): attributeExtension_(proxy.getTestDerivedArrayAttributeAttribute()) { + } + + inline extension_type& getTestDerivedArrayAttributeAttributeExtension() { + return attributeExtension_; + } + + private: + extension_type attributeExtension_; + }; + +} // namespace TestFreedesktopInterfaceExtensions + +// +// TestFreedesktopInterfaceProxy Implementation +// +template <typename ... _AttributeExtensions> +TestFreedesktopInterfaceProxy<_AttributeExtensions...>::TestFreedesktopInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate): + _AttributeExtensions(*(std::dynamic_pointer_cast<TestFreedesktopInterfaceProxyBase>(delegate)))..., + delegate_(std::dynamic_pointer_cast<TestFreedesktopInterfaceProxyBase>(delegate)) { +} + +template <typename ... _AttributeExtensions> +TestFreedesktopInterfaceProxy<_AttributeExtensions...>::~TestFreedesktopInterfaceProxy() { +} + + +template <typename ... _AttributeExtensions> +const CommonAPI::Address &TestFreedesktopInterfaceProxy<_AttributeExtensions...>::getAddress() const { + return delegate_->getAddress(); +} + +template <typename ... _AttributeExtensions> +bool TestFreedesktopInterfaceProxy<_AttributeExtensions...>::isAvailable() const { + return delegate_->isAvailable(); +} + +template <typename ... _AttributeExtensions> +bool TestFreedesktopInterfaceProxy<_AttributeExtensions...>::isAvailableBlocking() const { + return delegate_->isAvailableBlocking(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::ProxyStatusEvent& TestFreedesktopInterfaceProxy<_AttributeExtensions...>::getProxyStatusEvent() { + return delegate_->getProxyStatusEvent(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::InterfaceVersionAttribute& TestFreedesktopInterfaceProxy<_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::TestFreedesktopInterfaceProxy, + _AttributeExtension> { + typedef typename ::v1_0::commonapi::tests::TestFreedesktopInterfaceProxy< + ::v1_0::commonapi::tests::TestFreedesktopInterfaceExtensions::TestPredefinedTypeAttributeAttributeExtension<_AttributeExtension>, + ::v1_0::commonapi::tests::TestFreedesktopInterfaceExtensions::TestReadonlyAttributeAttributeExtension<_AttributeExtension>, + ::v1_0::commonapi::tests::TestFreedesktopInterfaceExtensions::TestDerivedStructAttributeAttributeExtension<_AttributeExtension>, + ::v1_0::commonapi::tests::TestFreedesktopInterfaceExtensions::TestDerivedArrayAttributeAttributeExtension<_AttributeExtension> + > class_t; +}; +} + +#endif // COMMONAPI_TESTS_Test_Freedesktop_Interface_PROXY_HPP_ diff --git a/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterfaceProxyBase.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterfaceProxyBase.hpp new file mode 100644 index 0000000..0b50008 --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterfaceProxyBase.hpp @@ -0,0 +1,55 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_Test_Freedesktop_Interface_PROXY_BASE_HPP_ +#define COMMONAPI_TESTS_Test_Freedesktop_Interface_PROXY_BASE_HPP_ + +#include <v1_0/commonapi/tests/TestFreedesktopInterface.hpp> + + +#include <commonapi/tests/DerivedTypeCollection.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <cstdint> +#include <vector> + +#include <CommonAPI/Attribute.hpp> +#include <CommonAPI/Proxy.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace commonapi { +namespace tests { + +class TestFreedesktopInterfaceProxyBase + : virtual public CommonAPI::Proxy { +public: + typedef CommonAPI::ObservableAttribute<uint32_t> TestPredefinedTypeAttributeAttribute; + typedef CommonAPI::ObservableReadonlyAttribute<uint32_t> TestReadonlyAttributeAttribute; + typedef CommonAPI::ObservableAttribute<::commonapi::tests::DerivedTypeCollection::TestStructExtended> TestDerivedStructAttributeAttribute; + typedef CommonAPI::ObservableAttribute<::commonapi::tests::DerivedTypeCollection::TestArrayUInt64> TestDerivedArrayAttributeAttribute; + + + virtual TestPredefinedTypeAttributeAttribute& getTestPredefinedTypeAttributeAttribute() = 0; + virtual TestReadonlyAttributeAttribute& getTestReadonlyAttributeAttribute() = 0; + virtual TestDerivedStructAttributeAttribute& getTestDerivedStructAttributeAttribute() = 0; + virtual TestDerivedArrayAttributeAttribute& getTestDerivedArrayAttributeAttribute() = 0; + + +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Test_Freedesktop_Interface_PROXY_BASE_HPP_ diff --git a/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterfaceStub.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterfaceStub.hpp new file mode 100644 index 0000000..740b733 --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterfaceStub.hpp @@ -0,0 +1,131 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_Test_Freedesktop_Interface_STUB_HPP_ +#define COMMONAPI_TESTS_Test_Freedesktop_Interface_STUB_HPP_ + +#include <functional> + + + +#include <commonapi/tests/DerivedTypeCollection.hpp> + +#include <v1_0/commonapi/tests/TestFreedesktopInterface.hpp> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <cstdint> +#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 TestFreedesktopInterface. 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 TestFreedesktopInterfaceStubAdapter + : virtual public CommonAPI::StubAdapter, + public TestFreedesktopInterface { + 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 TestReadonlyAttribute. + virtual void fireTestReadonlyAttributeAttributeChanged(const uint32_t& TestReadonlyAttribute) = 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; + + + + 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 TestFreedesktopInterface. + * 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 TestFreedesktopInterfaceStubRemoteEvent +{ +public: + virtual ~TestFreedesktopInterfaceStubRemoteEvent() { } + + /// 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 TestFreedesktopInterface 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 TestFreedesktopInterfaceStub + : public virtual CommonAPI::Stub<TestFreedesktopInterfaceStubAdapter, TestFreedesktopInterfaceStubRemoteEvent> +{ +public: + + virtual ~TestFreedesktopInterfaceStub() {} + 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 TestReadonlyAttribute + virtual const uint32_t &getTestReadonlyAttributeAttribute(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; + + + using CommonAPI::Stub<TestFreedesktopInterfaceStubAdapter, TestFreedesktopInterfaceStubRemoteEvent>::initStubAdapter; + typedef CommonAPI::Stub<TestFreedesktopInterfaceStubAdapter, TestFreedesktopInterfaceStubRemoteEvent>::StubAdapterType StubAdapterType; + typedef CommonAPI::Stub<TestFreedesktopInterfaceStubAdapter, TestFreedesktopInterfaceStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType; + typedef TestFreedesktopInterfaceStubRemoteEvent RemoteEventType; + typedef TestFreedesktopInterface StubInterface; +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Test_Freedesktop_Interface_STUB_HPP_ diff --git a/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterfaceStubDefault.cpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterfaceStubDefault.cpp new file mode 100644 index 0000000..89b004d --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterfaceStubDefault.cpp @@ -0,0 +1,221 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#include <v1_0/commonapi/tests/TestFreedesktopInterfaceStubDefault.hpp> +#include <assert.h> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +TestFreedesktopInterfaceStubDefault::TestFreedesktopInterfaceStubDefault(): + remoteEventHandler_(this), + interfaceVersion_(TestFreedesktopInterface::getInterfaceVersion()) { +} + +const CommonAPI::Version& TestFreedesktopInterfaceStubDefault::getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client) { + return interfaceVersion_; +} + +TestFreedesktopInterfaceStubRemoteEvent* TestFreedesktopInterfaceStubDefault::initStubAdapter(const std::shared_ptr<TestFreedesktopInterfaceStubAdapter> &_adapter) { + CommonAPI::Stub<TestFreedesktopInterfaceStubAdapter, TestFreedesktopInterfaceStubRemoteEvent>::stubAdapter_ = _adapter; + return &remoteEventHandler_; +} + +const uint32_t& TestFreedesktopInterfaceStubDefault::getTestPredefinedTypeAttributeAttribute() { + return testPredefinedTypeAttributeAttributeValue_; +} + +const uint32_t& TestFreedesktopInterfaceStubDefault::getTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client) { + return getTestPredefinedTypeAttributeAttribute(); +} + +void TestFreedesktopInterfaceStubDefault::setTestPredefinedTypeAttributeAttribute(uint32_t _value) { + const bool valueChanged = trySetTestPredefinedTypeAttributeAttribute(std::move(_value)); + if (valueChanged && stubAdapter_ != NULL) { + stubAdapter_->fireTestPredefinedTypeAttributeAttributeChanged(testPredefinedTypeAttributeAttributeValue_); + } +} + +bool TestFreedesktopInterfaceStubDefault::trySetTestPredefinedTypeAttributeAttribute(uint32_t _value) { + if (!validateTestPredefinedTypeAttributeAttributeRequestedValue(_value)) + return false; + + const bool valueChanged = (testPredefinedTypeAttributeAttributeValue_ != _value); + testPredefinedTypeAttributeAttributeValue_ = std::move(_value); + return valueChanged; +} + +bool TestFreedesktopInterfaceStubDefault::validateTestPredefinedTypeAttributeAttributeRequestedValue(const uint32_t &_value) { + return true; +} + +void TestFreedesktopInterfaceStubDefault::setTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _value) { + setTestPredefinedTypeAttributeAttribute(_value); +} + +void TestFreedesktopInterfaceStubDefault::onRemoteTestPredefinedTypeAttributeAttributeChanged() { + // No operation in default +} + +void TestFreedesktopInterfaceStubDefault::RemoteEventHandler::onRemoteTestPredefinedTypeAttributeAttributeChanged() { + assert(defaultStub_ !=NULL); + defaultStub_->onRemoteTestPredefinedTypeAttributeAttributeChanged(); +} + +bool TestFreedesktopInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestPredefinedTypeAttributeAttribute(uint32_t _value) { + assert(defaultStub_ !=NULL); + return defaultStub_->trySetTestPredefinedTypeAttributeAttribute(std::move(_value)); +} + +bool TestFreedesktopInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestPredefinedTypeAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, uint32_t _value) { + return onRemoteSetTestPredefinedTypeAttributeAttribute(_value); +} + +const uint32_t& TestFreedesktopInterfaceStubDefault::getTestReadonlyAttributeAttribute() { + return testReadonlyAttributeAttributeValue_; +} + +const uint32_t& TestFreedesktopInterfaceStubDefault::getTestReadonlyAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client) { + return getTestReadonlyAttributeAttribute(); +} + +void TestFreedesktopInterfaceStubDefault::setTestReadonlyAttributeAttribute(uint32_t _value) { + const bool valueChanged = trySetTestReadonlyAttributeAttribute(std::move(_value)); + if (valueChanged && stubAdapter_ != NULL) { + stubAdapter_->fireTestReadonlyAttributeAttributeChanged(testReadonlyAttributeAttributeValue_); + } +} + +bool TestFreedesktopInterfaceStubDefault::trySetTestReadonlyAttributeAttribute(uint32_t _value) { + if (!validateTestReadonlyAttributeAttributeRequestedValue(_value)) + return false; + + const bool valueChanged = (testReadonlyAttributeAttributeValue_ != _value); + testReadonlyAttributeAttributeValue_ = std::move(_value); + return valueChanged; +} + +bool TestFreedesktopInterfaceStubDefault::validateTestReadonlyAttributeAttributeRequestedValue(const uint32_t &_value) { + return true; +} + + +const ::commonapi::tests::DerivedTypeCollection::TestStructExtended& TestFreedesktopInterfaceStubDefault::getTestDerivedStructAttributeAttribute() { + return testDerivedStructAttributeAttributeValue_; +} + +const ::commonapi::tests::DerivedTypeCollection::TestStructExtended& TestFreedesktopInterfaceStubDefault::getTestDerivedStructAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client) { + return getTestDerivedStructAttributeAttribute(); +} + +void TestFreedesktopInterfaceStubDefault::setTestDerivedStructAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestStructExtended _value) { + const bool valueChanged = trySetTestDerivedStructAttributeAttribute(std::move(_value)); + if (valueChanged && stubAdapter_ != NULL) { + stubAdapter_->fireTestDerivedStructAttributeAttributeChanged(testDerivedStructAttributeAttributeValue_); + } +} + +bool TestFreedesktopInterfaceStubDefault::trySetTestDerivedStructAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestStructExtended _value) { + if (!validateTestDerivedStructAttributeAttributeRequestedValue(_value)) + return false; + + const bool valueChanged = (testDerivedStructAttributeAttributeValue_ != _value); + testDerivedStructAttributeAttributeValue_ = std::move(_value); + return valueChanged; +} + +bool TestFreedesktopInterfaceStubDefault::validateTestDerivedStructAttributeAttributeRequestedValue(const ::commonapi::tests::DerivedTypeCollection::TestStructExtended &_value) { + return true; +} + +void TestFreedesktopInterfaceStubDefault::setTestDerivedStructAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestStructExtended _value) { + setTestDerivedStructAttributeAttribute(_value); +} + +void TestFreedesktopInterfaceStubDefault::onRemoteTestDerivedStructAttributeAttributeChanged() { + // No operation in default +} + +void TestFreedesktopInterfaceStubDefault::RemoteEventHandler::onRemoteTestDerivedStructAttributeAttributeChanged() { + assert(defaultStub_ !=NULL); + defaultStub_->onRemoteTestDerivedStructAttributeAttributeChanged(); +} + +bool TestFreedesktopInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedStructAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestStructExtended _value) { + assert(defaultStub_ !=NULL); + return defaultStub_->trySetTestDerivedStructAttributeAttribute(std::move(_value)); +} + +bool TestFreedesktopInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedStructAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestStructExtended _value) { + return onRemoteSetTestDerivedStructAttributeAttribute(_value); +} + +const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64& TestFreedesktopInterfaceStubDefault::getTestDerivedArrayAttributeAttribute() { + return testDerivedArrayAttributeAttributeValue_; +} + +const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64& TestFreedesktopInterfaceStubDefault::getTestDerivedArrayAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client) { + return getTestDerivedArrayAttributeAttribute(); +} + +void TestFreedesktopInterfaceStubDefault::setTestDerivedArrayAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value) { + const bool valueChanged = trySetTestDerivedArrayAttributeAttribute(std::move(_value)); + if (valueChanged && stubAdapter_ != NULL) { + stubAdapter_->fireTestDerivedArrayAttributeAttributeChanged(testDerivedArrayAttributeAttributeValue_); + } +} + +bool TestFreedesktopInterfaceStubDefault::trySetTestDerivedArrayAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value) { + if (!validateTestDerivedArrayAttributeAttributeRequestedValue(_value)) + return false; + + const bool valueChanged = (testDerivedArrayAttributeAttributeValue_ != _value); + testDerivedArrayAttributeAttributeValue_ = std::move(_value); + return valueChanged; +} + +bool TestFreedesktopInterfaceStubDefault::validateTestDerivedArrayAttributeAttributeRequestedValue(const ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 &_value) { + return true; +} + +void TestFreedesktopInterfaceStubDefault::setTestDerivedArrayAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value) { + setTestDerivedArrayAttributeAttribute(_value); +} + +void TestFreedesktopInterfaceStubDefault::onRemoteTestDerivedArrayAttributeAttributeChanged() { + // No operation in default +} + +void TestFreedesktopInterfaceStubDefault::RemoteEventHandler::onRemoteTestDerivedArrayAttributeAttributeChanged() { + assert(defaultStub_ !=NULL); + defaultStub_->onRemoteTestDerivedArrayAttributeAttributeChanged(); +} + +bool TestFreedesktopInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedArrayAttributeAttribute(::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value) { + assert(defaultStub_ !=NULL); + return defaultStub_->trySetTestDerivedArrayAttributeAttribute(std::move(_value)); +} + +bool TestFreedesktopInterfaceStubDefault::RemoteEventHandler::onRemoteSetTestDerivedArrayAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 _value) { + return onRemoteSetTestDerivedArrayAttributeAttribute(_value); +} + + + + + +TestFreedesktopInterfaceStubDefault::RemoteEventHandler::RemoteEventHandler(TestFreedesktopInterfaceStubDefault *_defaultStub) + : + defaultStub_(_defaultStub) { +} + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterfaceStubDefault.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterfaceStubDefault.hpp new file mode 100644 index 0000000..a45fcd7 --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/TestFreedesktopInterfaceStubDefault.hpp @@ -0,0 +1,107 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_Test_Freedesktop_Interface_STUB_DEFAULT_HPP_ +#define COMMONAPI_TESTS_Test_Freedesktop_Interface_STUB_DEFAULT_HPP_ + + +#include <v1_0/commonapi/tests/TestFreedesktopInterfaceStub.hpp> +#include <sstream> + +namespace v1_0 { +namespace commonapi { +namespace tests { + +/** + * Provides a default implementation for TestFreedesktopInterfaceStubRemoteEvent and + * TestFreedesktopInterfaceStub. 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 TestFreedesktopInterfaceStubDefault + : public virtual TestFreedesktopInterfaceStub { +public: + TestFreedesktopInterfaceStubDefault(); + + TestFreedesktopInterfaceStubRemoteEvent* initStubAdapter(const std::shared_ptr<TestFreedesktopInterfaceStubAdapter> &_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 uint32_t& getTestReadonlyAttributeAttribute(); + virtual const uint32_t& getTestReadonlyAttributeAttribute(const std::shared_ptr<CommonAPI::ClientId> _client); + virtual void setTestReadonlyAttributeAttribute(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); + + + + +protected: + virtual bool trySetTestPredefinedTypeAttributeAttribute(uint32_t _value); + virtual bool validateTestPredefinedTypeAttributeAttributeRequestedValue(const uint32_t &_value); + virtual void onRemoteTestPredefinedTypeAttributeAttributeChanged(); + virtual bool trySetTestReadonlyAttributeAttribute(uint32_t _value); + virtual bool validateTestReadonlyAttributeAttributeRequestedValue(const uint32_t &_value); + 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 TestFreedesktopInterfaceStubRemoteEvent { + public: + RemoteEventHandler(TestFreedesktopInterfaceStubDefault *_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: + TestFreedesktopInterfaceStubDefault *defaultStub_; + }; +private: + TestFreedesktopInterfaceStubDefault::RemoteEventHandler remoteEventHandler_; + + uint32_t testPredefinedTypeAttributeAttributeValue_; + uint32_t testReadonlyAttributeAttributeValue_; + ::commonapi::tests::DerivedTypeCollection::TestStructExtended testDerivedStructAttributeAttributeValue_; + ::commonapi::tests::DerivedTypeCollection::TestArrayUInt64 testDerivedArrayAttributeAttributeValue_; + + CommonAPI::Version interfaceVersion_; +}; + +} // namespace tests +} // namespace commonapi +} // namespace v1_0 + +#endif // COMMONAPI_TESTS_Test_Freedesktop_Interface_STUB_DEFAULT diff --git a/src/test/src-gen/core/v1_0/commonapi/tests/TestInterface.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestInterface.hpp new file mode 100644 index 0000000..f651daf --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_TEST_INTERFACE_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/core/v1_0/commonapi/tests/TestInterfaceProxy.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestInterfaceProxy.hpp new file mode 100644 index 0000000..669f62a --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_Test_Interface_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/core/v1_0/commonapi/tests/TestInterfaceProxyBase.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestInterfaceProxyBase.hpp new file mode 100644 index 0000000..4fc7e7f --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_Test_Interface_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/core/v1_0/commonapi/tests/TestInterfaceStub.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestInterfaceStub.hpp new file mode 100644 index 0000000..b079d8a --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_Test_Interface_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/core/v1_0/commonapi/tests/TestInterfaceStubDefault.cpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestInterfaceStubDefault.cpp new file mode 100644 index 0000000..e51777c --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#include <v1_0/commonapi/tests/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 = 0; + 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/core/v1_0/commonapi/tests/TestInterfaceStubDefault.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/TestInterfaceStubDefault.hpp new file mode 100644 index 0000000..c475a56 --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_Test_Interface_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/core/v1_0/commonapi/tests/managed/BranchInterface.cpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/BranchInterface.cpp new file mode 100644 index 0000000..3af84f9 --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/managed/BranchInterface.cpp @@ -0,0 +1,22 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#include "BranchInterface.hpp" + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + + + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/core/v1_0/commonapi/tests/managed/BranchInterface.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/BranchInterface.hpp new file mode 100644 index 0000000..812e409 --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/managed/BranchInterface.hpp @@ -0,0 +1,81 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_BRANCH_INTERFACE_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> { + enum Literal : int32_t { + OK = 0, + NOTOK = 1 + }; + + testBranchMethodError() = default; + testBranchMethodError(const Literal &_value) + : CommonAPI::Enumeration<int32_t>(static_cast<int32_t>(_value)) {} + + inline bool operator==(const testBranchMethodError &_other) const { return (value_ == _other.value_); } + inline bool operator!=(const testBranchMethodError &_other) const { return (value_ != _other.value_); } + inline bool operator<=(const testBranchMethodError &_other) const { return (value_ <= _other.value_); } + inline bool operator>=(const testBranchMethodError &_other) const { return (value_ >= _other.value_); } + inline bool operator<(const testBranchMethodError &_other) const { return (value_ < _other.value_); } + inline bool operator>(const testBranchMethodError &_other) const { return (value_ > _other.value_); } + + inline bool operator==(const Literal &_value) const { return (value_ == static_cast<int32_t>(_value)); } + inline bool operator!=(const Literal &_value) const { return (value_ != static_cast<int32_t>(_value)); } + inline bool operator<=(const Literal &_value) const { return (value_ <= static_cast<int32_t>(_value)); } + inline bool operator>=(const Literal &_value) const { return (value_ >= static_cast<int32_t>(_value)); } + inline bool operator<(const Literal &_value) const { return (value_ < static_cast<int32_t>(_value)); } + inline bool operator>(const Literal &_value) const { return (value_ > static_cast<int32_t>(_value)); } + }; +}; + +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/core/v1_0/commonapi/tests/managed/BranchInterfaceProxy.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/BranchInterfaceProxy.hpp new file mode 100644 index 0000000..12c7ce9 --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_Branch_Interface_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/core/v1_0/commonapi/tests/managed/BranchInterfaceProxyBase.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/BranchInterfaceProxyBase.hpp new file mode 100644 index 0000000..1aea848 --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_Branch_Interface_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/core/v1_0/commonapi/tests/managed/BranchInterfaceStub.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/BranchInterfaceStub.hpp new file mode 100644 index 0000000..a277f1d --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_Branch_Interface_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/core/v1_0/commonapi/tests/managed/BranchInterfaceStubDefault.cpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/BranchInterfaceStubDefault.cpp new file mode 100644 index 0000000..c916b6c --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#include <v1_0/commonapi/tests/managed/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 = 0; + 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/core/v1_0/commonapi/tests/managed/BranchInterfaceStubDefault.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/BranchInterfaceStubDefault.hpp new file mode 100644 index 0000000..0885835 --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_Branch_Interface_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/core/v1_0/commonapi/tests/managed/LeafInterface.cpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/LeafInterface.cpp new file mode 100644 index 0000000..1e88326 --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/managed/LeafInterface.cpp @@ -0,0 +1,22 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#include "LeafInterface.hpp" + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + + + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/core/v1_0/commonapi/tests/managed/LeafInterface.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/LeafInterface.hpp new file mode 100644 index 0000000..3072907 --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/managed/LeafInterface.hpp @@ -0,0 +1,81 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_LEAF_INTERFACE_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> { + enum Literal : int32_t { + OK = 0, + NOTOK = 1 + }; + + testLeafMethodError() = default; + testLeafMethodError(const Literal &_value) + : CommonAPI::Enumeration<int32_t>(static_cast<int32_t>(_value)) {} + + inline bool operator==(const testLeafMethodError &_other) const { return (value_ == _other.value_); } + inline bool operator!=(const testLeafMethodError &_other) const { return (value_ != _other.value_); } + inline bool operator<=(const testLeafMethodError &_other) const { return (value_ <= _other.value_); } + inline bool operator>=(const testLeafMethodError &_other) const { return (value_ >= _other.value_); } + inline bool operator<(const testLeafMethodError &_other) const { return (value_ < _other.value_); } + inline bool operator>(const testLeafMethodError &_other) const { return (value_ > _other.value_); } + + inline bool operator==(const Literal &_value) const { return (value_ == static_cast<int32_t>(_value)); } + inline bool operator!=(const Literal &_value) const { return (value_ != static_cast<int32_t>(_value)); } + inline bool operator<=(const Literal &_value) const { return (value_ <= static_cast<int32_t>(_value)); } + inline bool operator>=(const Literal &_value) const { return (value_ >= static_cast<int32_t>(_value)); } + inline bool operator<(const Literal &_value) const { return (value_ < static_cast<int32_t>(_value)); } + inline bool operator>(const Literal &_value) const { return (value_ > static_cast<int32_t>(_value)); } + }; +}; + +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/core/v1_0/commonapi/tests/managed/LeafInterfaceProxy.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/LeafInterfaceProxy.hpp new file mode 100644 index 0000000..5e49c09 --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_Leaf_Interface_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/core/v1_0/commonapi/tests/managed/LeafInterfaceProxyBase.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/LeafInterfaceProxyBase.hpp new file mode 100644 index 0000000..7c9fa8f --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_Leaf_Interface_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/core/v1_0/commonapi/tests/managed/LeafInterfaceStub.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/LeafInterfaceStub.hpp new file mode 100644 index 0000000..fb2336a --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_Leaf_Interface_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/core/v1_0/commonapi/tests/managed/LeafInterfaceStubDefault.cpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/LeafInterfaceStubDefault.cpp new file mode 100644 index 0000000..4d35c2c --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#include <v1_0/commonapi/tests/managed/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 = 0; + 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/core/v1_0/commonapi/tests/managed/LeafInterfaceStubDefault.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/LeafInterfaceStubDefault.hpp new file mode 100644 index 0000000..d9b1d07 --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_Leaf_Interface_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/core/v1_0/commonapi/tests/managed/RootInterface.cpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/RootInterface.cpp new file mode 100644 index 0000000..7442064 --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/managed/RootInterface.cpp @@ -0,0 +1,22 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#include "RootInterface.hpp" + +namespace v1_0 { +namespace commonapi { +namespace tests { +namespace managed { + + + +} // namespace managed +} // namespace tests +} // namespace commonapi +} // namespace v1_0 diff --git a/src/test/src-gen/core/v1_0/commonapi/tests/managed/RootInterface.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/RootInterface.hpp new file mode 100644 index 0000000..8eada5e --- /dev/null +++ b/src/test/src-gen/core/v1_0/commonapi/tests/managed/RootInterface.hpp @@ -0,0 +1,82 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_ROOT_INTERFACE_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> { + enum Literal : int32_t { + OK = 0, + NOTOK = 1 + }; + + testRootMethodError() = default; + testRootMethodError(const Literal &_value) + : CommonAPI::Enumeration<int32_t>(static_cast<int32_t>(_value)) {} + + inline bool operator==(const testRootMethodError &_other) const { return (value_ == _other.value_); } + inline bool operator!=(const testRootMethodError &_other) const { return (value_ != _other.value_); } + inline bool operator<=(const testRootMethodError &_other) const { return (value_ <= _other.value_); } + inline bool operator>=(const testRootMethodError &_other) const { return (value_ >= _other.value_); } + inline bool operator<(const testRootMethodError &_other) const { return (value_ < _other.value_); } + inline bool operator>(const testRootMethodError &_other) const { return (value_ > _other.value_); } + + inline bool operator==(const Literal &_value) const { return (value_ == static_cast<int32_t>(_value)); } + inline bool operator!=(const Literal &_value) const { return (value_ != static_cast<int32_t>(_value)); } + inline bool operator<=(const Literal &_value) const { return (value_ <= static_cast<int32_t>(_value)); } + inline bool operator>=(const Literal &_value) const { return (value_ >= static_cast<int32_t>(_value)); } + inline bool operator<(const Literal &_value) const { return (value_ < static_cast<int32_t>(_value)); } + inline bool operator>(const Literal &_value) const { return (value_ > static_cast<int32_t>(_value)); } + }; +}; + +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/core/v1_0/commonapi/tests/managed/RootInterfaceProxy.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/RootInterfaceProxy.hpp new file mode 100644 index 0000000..61f6722 --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_Root_Interface_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/core/v1_0/commonapi/tests/managed/RootInterfaceProxyBase.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/RootInterfaceProxyBase.hpp new file mode 100644 index 0000000..3c93161 --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_Root_Interface_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/core/v1_0/commonapi/tests/managed/RootInterfaceStub.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/RootInterfaceStub.hpp new file mode 100644 index 0000000..c8912e0 --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_Root_Interface_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/core/v1_0/commonapi/tests/managed/RootInterfaceStubDefault.cpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/RootInterfaceStubDefault.cpp new file mode 100644 index 0000000..dfda3aa --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#include <v1_0/commonapi/tests/managed/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 = 0; + 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/core/v1_0/commonapi/tests/managed/RootInterfaceStubDefault.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/RootInterfaceStubDefault.hpp new file mode 100644 index 0000000..70c1f6d --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_Root_Interface_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/core/v1_0/commonapi/tests/managed/SecondRoot.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/SecondRoot.hpp new file mode 100644 index 0000000..c55881b --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_SECOND_ROOT_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/core/v1_0/commonapi/tests/managed/SecondRootProxy.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/SecondRootProxy.hpp new file mode 100644 index 0000000..c79b601 --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_Second_Root_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/core/v1_0/commonapi/tests/managed/SecondRootProxyBase.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/SecondRootProxyBase.hpp new file mode 100644 index 0000000..ceb80a9 --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_Second_Root_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/core/v1_0/commonapi/tests/managed/SecondRootStub.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/SecondRootStub.hpp new file mode 100644 index 0000000..2f07c1c --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_Second_Root_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/core/v1_0/commonapi/tests/managed/SecondRootStubDefault.cpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/SecondRootStubDefault.cpp new file mode 100644 index 0000000..a42a8ac --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#include <v1_0/commonapi/tests/managed/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/core/v1_0/commonapi/tests/managed/SecondRootStubDefault.hpp b/src/test/src-gen/core/v1_0/commonapi/tests/managed/SecondRootStubDefault.hpp new file mode 100644 index 0000000..55d0741 --- /dev/null +++ b/src/test/src-gen/core/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.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef COMMONAPI_TESTS_MANAGED_Second_Root_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 diff --git a/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterface.hpp b/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterface.hpp new file mode 100644 index 0000000..e9efaf6 --- /dev/null +++ b/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterface.hpp @@ -0,0 +1,54 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef FAKE_LEGACY_SERVICE_LEGACY_INTERFACE_HPP_ +#define FAKE_LEGACY_SERVICE_LEGACY_INTERFACE_HPP_ + + + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/Types.hpp> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace fake { +namespace legacy { +namespace service { + +class LegacyInterface { +public: + virtual ~LegacyInterface() { } + + static inline const char* getInterface(); + static inline CommonAPI::Version getInterfaceVersion(); +}; + +const char* LegacyInterface::getInterface() { + return ("fake.legacy.service.LegacyInterface"); +} + +CommonAPI::Version LegacyInterface::getInterfaceVersion() { + return CommonAPI::Version(1, 0); +} + + +} // namespace service +} // namespace legacy +} // namespace fake +} // namespace v1_0 + +namespace CommonAPI { +} + +#endif // FAKE_LEGACY_SERVICE_LEGACY_INTERFACE_HPP_ diff --git a/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterfaceProxy.hpp b/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterfaceProxy.hpp new file mode 100644 index 0000000..d163090 --- /dev/null +++ b/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterfaceProxy.hpp @@ -0,0 +1,211 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef FAKE_LEGACY_SERVICE_Legacy_Interface_PROXY_HPP_ +#define FAKE_LEGACY_SERVICE_Legacy_Interface_PROXY_HPP_ + +#include <v1_0/fake/legacy/service/LegacyInterfaceProxyBase.hpp> + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace v1_0 { +namespace fake { +namespace legacy { +namespace service { + +template <typename ... _AttributeExtensions> +class LegacyInterfaceProxy + : virtual public LegacyInterface, + virtual public LegacyInterfaceProxyBase, + public _AttributeExtensions... { +public: + LegacyInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate); + ~LegacyInterfaceProxy(); + + typedef LegacyInterface InterfaceType; + + + + + /** + * Calls TestMethod 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 TestMethod(const int32_t &_input, CommonAPI::CallStatus &_status, int32_t &_val1, int32_t &_val2, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls TestMethod 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> TestMethodAsync(const int32_t &_input, TestMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls OtherTestMethod with synchronous semantics. + * + * 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 OtherTestMethod(CommonAPI::CallStatus &_status, std::string &_greeting, int32_t &_identifier, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls OtherTestMethod 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> OtherTestMethodAsync(OtherTestMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls finish 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 finish(CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr); + /** + * Calls finish 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> finishAsync(FinishAsyncCallback _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<LegacyInterfaceProxyBase> delegate_; +}; + +typedef LegacyInterfaceProxy<> LegacyInterfaceProxyDefault; + + +// +// LegacyInterfaceProxy Implementation +// +template <typename ... _AttributeExtensions> +LegacyInterfaceProxy<_AttributeExtensions...>::LegacyInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate): + _AttributeExtensions(*(std::dynamic_pointer_cast<LegacyInterfaceProxyBase>(delegate)))..., + delegate_(std::dynamic_pointer_cast<LegacyInterfaceProxyBase>(delegate)) { +} + +template <typename ... _AttributeExtensions> +LegacyInterfaceProxy<_AttributeExtensions...>::~LegacyInterfaceProxy() { +} + +template <typename ... _AttributeExtensions> +void LegacyInterfaceProxy<_AttributeExtensions...>::TestMethod(const int32_t &_input, CommonAPI::CallStatus &_status, int32_t &_val1, int32_t &_val2, const CommonAPI::CallInfo *_info) { + delegate_->TestMethod(_input, _status, _val1, _val2, _info); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> LegacyInterfaceProxy<_AttributeExtensions...>::TestMethodAsync(const int32_t &_input, TestMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return delegate_->TestMethodAsync(_input, _callback, _info); +} +template <typename ... _AttributeExtensions> +void LegacyInterfaceProxy<_AttributeExtensions...>::OtherTestMethod(CommonAPI::CallStatus &_status, std::string &_greeting, int32_t &_identifier, const CommonAPI::CallInfo *_info) { + delegate_->OtherTestMethod(_status, _greeting, _identifier, _info); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> LegacyInterfaceProxy<_AttributeExtensions...>::OtherTestMethodAsync(OtherTestMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return delegate_->OtherTestMethodAsync(_callback, _info); +} +template <typename ... _AttributeExtensions> +void LegacyInterfaceProxy<_AttributeExtensions...>::finish(CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info) { + delegate_->finish(_status, _info); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> LegacyInterfaceProxy<_AttributeExtensions...>::finishAsync(FinishAsyncCallback _callback, const CommonAPI::CallInfo *_info) { + return delegate_->finishAsync(_callback, _info); +} + +template <typename ... _AttributeExtensions> +const CommonAPI::Address &LegacyInterfaceProxy<_AttributeExtensions...>::getAddress() const { + return delegate_->getAddress(); +} + +template <typename ... _AttributeExtensions> +bool LegacyInterfaceProxy<_AttributeExtensions...>::isAvailable() const { + return delegate_->isAvailable(); +} + +template <typename ... _AttributeExtensions> +bool LegacyInterfaceProxy<_AttributeExtensions...>::isAvailableBlocking() const { + return delegate_->isAvailableBlocking(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::ProxyStatusEvent& LegacyInterfaceProxy<_AttributeExtensions...>::getProxyStatusEvent() { + return delegate_->getProxyStatusEvent(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::InterfaceVersionAttribute& LegacyInterfaceProxy<_AttributeExtensions...>::getInterfaceVersionAttribute() { + return delegate_->getInterfaceVersionAttribute(); +} + + +} // namespace service +} // namespace legacy +} // namespace fake +} // namespace v1_0 + + +#endif // FAKE_LEGACY_SERVICE_Legacy_Interface_PROXY_HPP_ diff --git a/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterfaceProxyBase.hpp b/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterfaceProxyBase.hpp new file mode 100644 index 0000000..62d43e5 --- /dev/null +++ b/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterfaceProxyBase.hpp @@ -0,0 +1,57 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef FAKE_LEGACY_SERVICE_Legacy_Interface_PROXY_BASE_HPP_ +#define FAKE_LEGACY_SERVICE_Legacy_Interface_PROXY_BASE_HPP_ + +#include <v1_0/fake/legacy/service/LegacyInterface.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 fake { +namespace legacy { +namespace service { + +class LegacyInterfaceProxyBase + : virtual public CommonAPI::Proxy { +public: + + typedef std::function<void(const CommonAPI::CallStatus&, const int32_t&, const int32_t&)> TestMethodAsyncCallback; + typedef std::function<void(const CommonAPI::CallStatus&, const std::string&, const int32_t&)> OtherTestMethodAsyncCallback; + typedef std::function<void(const CommonAPI::CallStatus&)> FinishAsyncCallback; + + + + virtual void TestMethod(const int32_t &_input, CommonAPI::CallStatus &_status, int32_t &_val1, int32_t &_val2, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual std::future<CommonAPI::CallStatus> TestMethodAsync(const int32_t &_input, TestMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual void OtherTestMethod(CommonAPI::CallStatus &_status, std::string &_greeting, int32_t &_identifier, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual std::future<CommonAPI::CallStatus> OtherTestMethodAsync(OtherTestMethodAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual void finish(CommonAPI::CallStatus &_status, const CommonAPI::CallInfo *_info = nullptr) = 0; + virtual std::future<CommonAPI::CallStatus> finishAsync(FinishAsyncCallback _callback, const CommonAPI::CallInfo *_info = nullptr) = 0; +}; + +} // namespace service +} // namespace legacy +} // namespace fake +} // namespace v1_0 + +#endif // FAKE_LEGACY_SERVICE_Legacy_Interface_PROXY_BASE_HPP_ diff --git a/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterfaceStub.hpp b/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterfaceStub.hpp new file mode 100644 index 0000000..f38834c --- /dev/null +++ b/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterfaceStub.hpp @@ -0,0 +1,112 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef FAKE_LEGACY_SERVICE_Legacy_Interface_STUB_HPP_ +#define FAKE_LEGACY_SERVICE_Legacy_Interface_STUB_HPP_ + +#include <functional> + + + + +#include <v1_0/fake/legacy/service/LegacyInterface.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 fake { +namespace legacy { +namespace service { + +/** + * Receives messages from remote and handles all dispatching of deserialized calls + * to a stub for the service LegacyInterface. 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 LegacyInterfaceStubAdapter + : virtual public CommonAPI::StubAdapter, + public LegacyInterface { + 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 LegacyInterface. + * 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 LegacyInterfaceStubRemoteEvent +{ +public: + virtual ~LegacyInterfaceStubRemoteEvent() { } + +}; + +/** + * Defines the interface that must be implemented by any class that should provide + * the service LegacyInterface 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 LegacyInterfaceStub + : public virtual CommonAPI::Stub<LegacyInterfaceStubAdapter, LegacyInterfaceStubRemoteEvent> +{ +public: + typedef std::function<void (int32_t _val1, int32_t _val2)>TestMethodReply_t; + typedef std::function<void (std::string _greeting, int32_t _identifier)>OtherTestMethodReply_t; + typedef std::function<void ()>finishReply_t; + + virtual ~LegacyInterfaceStub() {} + 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 TestMethod. + virtual void TestMethod(const std::shared_ptr<CommonAPI::ClientId> _client, int32_t _input, TestMethodReply_t _reply) = 0; + /// This is the method that will be called on remote calls on the method OtherTestMethod. + virtual void OtherTestMethod(const std::shared_ptr<CommonAPI::ClientId> _client, OtherTestMethodReply_t _reply) = 0; + /// This is the method that will be called on remote calls on the method finish. + virtual void finish(const std::shared_ptr<CommonAPI::ClientId> _client, finishReply_t _reply) = 0; + + using CommonAPI::Stub<LegacyInterfaceStubAdapter, LegacyInterfaceStubRemoteEvent>::initStubAdapter; + typedef CommonAPI::Stub<LegacyInterfaceStubAdapter, LegacyInterfaceStubRemoteEvent>::StubAdapterType StubAdapterType; + typedef CommonAPI::Stub<LegacyInterfaceStubAdapter, LegacyInterfaceStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType; + typedef LegacyInterfaceStubRemoteEvent RemoteEventType; + typedef LegacyInterface StubInterface; +}; + +} // namespace service +} // namespace legacy +} // namespace fake +} // namespace v1_0 + +#endif // FAKE_LEGACY_SERVICE_Legacy_Interface_STUB_HPP_ diff --git a/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterfaceStubDefault.cpp b/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterfaceStubDefault.cpp new file mode 100644 index 0000000..e9e58f0 --- /dev/null +++ b/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterfaceStubDefault.cpp @@ -0,0 +1,60 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#include <v1_0/fake/legacy/service/LegacyInterfaceStubDefault.hpp> +#include <assert.h> + +namespace v1_0 { +namespace fake { +namespace legacy { +namespace service { + +LegacyInterfaceStubDefault::LegacyInterfaceStubDefault(): + remoteEventHandler_(this), + interfaceVersion_(LegacyInterface::getInterfaceVersion()) { +} + +const CommonAPI::Version& LegacyInterfaceStubDefault::getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client) { + return interfaceVersion_; +} + +LegacyInterfaceStubRemoteEvent* LegacyInterfaceStubDefault::initStubAdapter(const std::shared_ptr<LegacyInterfaceStubAdapter> &_adapter) { + CommonAPI::Stub<LegacyInterfaceStubAdapter, LegacyInterfaceStubRemoteEvent>::stubAdapter_ = _adapter; + return &remoteEventHandler_; +} + + +void LegacyInterfaceStubDefault::TestMethod(const std::shared_ptr<CommonAPI::ClientId> _client, int32_t _input, TestMethodReply_t _reply) { + int32_t val1 = 0; + int32_t val2 = 0; + _reply(val1, val2); +} + +void LegacyInterfaceStubDefault::OtherTestMethod(const std::shared_ptr<CommonAPI::ClientId> _client, OtherTestMethodReply_t _reply) { + std::string greeting = ""; + int32_t identifier = 0; + _reply(greeting, identifier); +} + +void LegacyInterfaceStubDefault::finish(const std::shared_ptr<CommonAPI::ClientId> _client, finishReply_t _reply) { + _reply(); +} + + + + +LegacyInterfaceStubDefault::RemoteEventHandler::RemoteEventHandler(LegacyInterfaceStubDefault *_defaultStub) + : + defaultStub_(_defaultStub) { +} + +} // namespace service +} // namespace legacy +} // namespace fake +} // namespace v1_0 diff --git a/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterfaceStubDefault.hpp b/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterfaceStubDefault.hpp new file mode 100644 index 0000000..4326894 --- /dev/null +++ b/src/test/src-gen/core/v1_0/fake/legacy/service/LegacyInterfaceStubDefault.hpp @@ -0,0 +1,69 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 3.1.2.v201506150834. +* Used org.franca.core 0.9.1.201412191134. +* +* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +* If a copy of the MPL was not distributed with this file, You can obtain one at +* http://mozilla.org/MPL/2.0/. +*/ +#ifndef FAKE_LEGACY_SERVICE_Legacy_Interface_STUB_DEFAULT_HPP_ +#define FAKE_LEGACY_SERVICE_Legacy_Interface_STUB_DEFAULT_HPP_ + + +#include <v1_0/fake/legacy/service/LegacyInterfaceStub.hpp> +#include <sstream> + +namespace v1_0 { +namespace fake { +namespace legacy { +namespace service { + +/** + * Provides a default implementation for LegacyInterfaceStubRemoteEvent and + * LegacyInterfaceStub. 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 LegacyInterfaceStubDefault + : public virtual LegacyInterfaceStub { +public: + LegacyInterfaceStubDefault(); + + LegacyInterfaceStubRemoteEvent* initStubAdapter(const std::shared_ptr<LegacyInterfaceStubAdapter> &_adapter); + + const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> _client); + + + virtual void TestMethod(const std::shared_ptr<CommonAPI::ClientId> _client, int32_t _input, TestMethodReply_t _reply); + virtual void OtherTestMethod(const std::shared_ptr<CommonAPI::ClientId> _client, OtherTestMethodReply_t _reply); + virtual void finish(const std::shared_ptr<CommonAPI::ClientId> _client, finishReply_t _reply); + + + +protected: + class RemoteEventHandler: public virtual LegacyInterfaceStubRemoteEvent { + public: + RemoteEventHandler(LegacyInterfaceStubDefault *_defaultStub); + + + private: + LegacyInterfaceStubDefault *defaultStub_; + }; +private: + LegacyInterfaceStubDefault::RemoteEventHandler remoteEventHandler_; + + + CommonAPI::Version interfaceVersion_; +}; + +} // namespace service +} // namespace legacy +} // namespace fake +} // namespace v1_0 + +#endif // FAKE_LEGACY_SERVICE_Legacy_Interface_STUB_DEFAULT |