/* * This file was generated by the CommonAPI Generators. * Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. * 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_H_ #define COMMONAPI_TESTS_MANAGED_Leaf_Interface_PROXY_H_ #include "LeafInterfaceProxyBase.h" #if !defined (COMMONAPI_INTERNAL_COMPILATION) #define COMMONAPI_INTERNAL_COMPILATION #endif #undef COMMONAPI_INTERNAL_COMPILATION namespace commonapi { namespace tests { namespace managed { template class LeafInterfaceProxy: virtual public LeafInterface, virtual public LeafInterfaceProxyBase , public _AttributeExtensions... { public: LeafInterfaceProxy(std::shared_ptr 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& callStatus, LeafInterface::testLeafMethodError& methodError, int32_t& outInt, std::string& outString); /** * 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 testLeafMethodAsync(const int32_t& inInt, const std::string& inString, TestLeafMethodAsyncCallback callback); /** * Returns the CommonAPI address of the remote partner this proxy communicates with. */ virtual std::string getAddress() const; /** * Returns the domain of the remote partner this proxy communicates with. */ virtual const std::string& getDomain() const; /** * Returns the service ID of the remote partner this proxy communicates with. */ virtual const std::string& getServiceId() const; /** * Returns the instance ID of the remote partner this proxy communicates with. */ virtual const std::string& getInstanceId() 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 delegate_; }; // // LeafInterfaceProxy Implementation // template LeafInterfaceProxy<_AttributeExtensions...>::LeafInterfaceProxy(std::shared_ptr delegate): delegate_(std::dynamic_pointer_cast(delegate)), _AttributeExtensions(*(std::dynamic_pointer_cast(delegate)))... { } template LeafInterfaceProxy<_AttributeExtensions...>::~LeafInterfaceProxy() { } template void LeafInterfaceProxy<_AttributeExtensions...>::testLeafMethod(const int32_t& inInt, const std::string& inString, CommonAPI::CallStatus& callStatus, LeafInterface::testLeafMethodError& methodError, int32_t& outInt, std::string& outString) { delegate_->testLeafMethod(inInt, inString, callStatus, methodError, outInt, outString); } template std::future LeafInterfaceProxy<_AttributeExtensions...>::testLeafMethodAsync(const int32_t& inInt, const std::string& inString, TestLeafMethodAsyncCallback callback) { return delegate_->testLeafMethodAsync(inInt, inString, callback); } template std::string LeafInterfaceProxy<_AttributeExtensions...>::getAddress() const { return delegate_->getAddress(); } template const std::string& LeafInterfaceProxy<_AttributeExtensions...>::getDomain() const { return delegate_->getDomain(); } template const std::string& LeafInterfaceProxy<_AttributeExtensions...>::getServiceId() const { return delegate_->getServiceId(); } template const std::string& LeafInterfaceProxy<_AttributeExtensions...>::getInstanceId() const { return delegate_->getInstanceId(); } template bool LeafInterfaceProxy<_AttributeExtensions...>::isAvailable() const { return delegate_->isAvailable(); } template bool LeafInterfaceProxy<_AttributeExtensions...>::isAvailableBlocking() const { return delegate_->isAvailableBlocking(); } template CommonAPI::ProxyStatusEvent& LeafInterfaceProxy<_AttributeExtensions...>::getProxyStatusEvent() { return delegate_->getProxyStatusEvent(); } template CommonAPI::InterfaceVersionAttribute& LeafInterfaceProxy<_AttributeExtensions...>::getInterfaceVersionAttribute() { return delegate_->getInterfaceVersionAttribute(); } } // namespace managed } // namespace tests } // namespace commonapi #endif // COMMONAPI_TESTS_MANAGED_Leaf_Interface_PROXY_H_