increased version number to 2.1.5 and regenerated code for test fidl
[profile/ivi/common-api-dbus-runtime.git] / src / test / commonapi / tests / ExtendedInterfaceProxy.h
1 /*
2 * This file was generated by the CommonAPI Generators.
3 * Used org.genivi.commonapi.core 2.1.5.qualifier.
4 * Used org.franca.core 0.8.10.201309262002.
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
7 * If a copy of the MPL was not distributed with this file, You can obtain one at
8 * http://mozilla.org/MPL/2.0/.
9 */
10 #ifndef COMMONAPI_TESTS_Extended_Interface_PROXY_H_
11 #define COMMONAPI_TESTS_Extended_Interface_PROXY_H_
12
13 #include "ExtendedInterfaceProxyBase.h"
14
15 #include "TestInterfaceProxy.h"
16
17 #if !defined (COMMONAPI_INTERNAL_COMPILATION)
18 #define COMMONAPI_INTERNAL_COMPILATION
19 #endif
20
21
22 #undef COMMONAPI_INTERNAL_COMPILATION
23
24 namespace commonapi {
25 namespace tests {
26
27 template <typename ... _AttributeExtensions>
28 class ExtendedInterfaceProxy: virtual public ExtendedInterface, virtual public ExtendedInterfaceProxyBase
29 , virtual public TestInterfaceProxy<_AttributeExtensions...>
30 , public _AttributeExtensions... {
31 public:
32     ExtendedInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate);
33     ~ExtendedInterfaceProxy();
34
35     typedef ExtendedInterface InterfaceType;
36
37     inline static const char* getInterfaceId() {
38         return(ExtendedInterface::getInterfaceId());
39     }
40
41
42
43     /**
44      * Calls TestIntMethodExtended with synchronous semantics.
45      * 
46     * All const parameters are input parameters to this method.
47      * The CallStatus will be filled when the method returns and indicate either
48      * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus
49      * will be set.
50      */
51     virtual void TestIntMethodExtended(const uint32_t& inInt, CommonAPI::CallStatus& callStatus);
52     /**
53      * Calls TestIntMethodExtended with asynchronous semantics.
54      * 
55      * The provided callback will be called when the reply to this call arrives or
56      * an error occurs during the call. The CallStatus will indicate either "SUCCESS"
57      * or which type of error has occurred. In case of any error, ONLY the CallStatus
58      * will have a defined value.
59      * The std::future returned by this method will be fulfilled at arrival of the reply.
60      * It will provide the same value for CallStatus as will be handed to the callback.
61      */
62     virtual std::future<CommonAPI::CallStatus> TestIntMethodExtendedAsync(const uint32_t& inInt, TestIntMethodExtendedAsyncCallback callback);
63
64
65     /**
66      * Returns the CommonAPI address of the remote partner this proxy communicates with.
67      */
68     virtual std::string getAddress() const;
69
70     /**
71      * Returns the domain of the remote partner this proxy communicates with.
72      */
73     virtual const std::string& getDomain() const;
74
75     /** 
76      * Returns the service ID of the remote partner this proxy communicates with.
77      */
78     virtual const std::string& getServiceId() const;
79
80     /**
81      * Returns the instance ID of the remote partner this proxy communicates with.
82      */
83     virtual const std::string& getInstanceId() const;
84
85     /**
86      * Returns true if the remote partner for this proxy is currently known to be available.
87      */
88     virtual bool isAvailable() const;
89
90     /**
91      * Returns true if the remote partner for this proxy is available.
92      */
93     virtual bool isAvailableBlocking() const;
94
95     /**
96      * Returns the wrapper class that is used to (de-)register for notifications about
97      * the availability of the remote partner of this proxy.
98      */
99     virtual CommonAPI::ProxyStatusEvent& getProxyStatusEvent();
100
101     /**
102      * Returns the wrapper class that is used to access version information of the remote
103      * partner of this proxy.
104      */
105     virtual CommonAPI::InterfaceVersionAttribute& getInterfaceVersionAttribute();
106
107  private:
108     std::shared_ptr<ExtendedInterfaceProxyBase> delegate_;
109 };
110
111
112 //
113 // ExtendedInterfaceProxy Implementation
114 //
115 template <typename ... _AttributeExtensions>
116 ExtendedInterfaceProxy<_AttributeExtensions...>::ExtendedInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate):
117         TestInterfaceProxy<_AttributeExtensions...>(delegate),
118         delegate_(std::dynamic_pointer_cast<ExtendedInterfaceProxyBase>(delegate)),
119         _AttributeExtensions(*(std::dynamic_pointer_cast<ExtendedInterfaceProxyBase>(delegate)))... {
120 }
121
122 template <typename ... _AttributeExtensions>
123 ExtendedInterfaceProxy<_AttributeExtensions...>::~ExtendedInterfaceProxy() {
124 }
125
126 template <typename ... _AttributeExtensions>
127 void ExtendedInterfaceProxy<_AttributeExtensions...>::TestIntMethodExtended(const uint32_t& inInt, CommonAPI::CallStatus& callStatus) {
128     delegate_->TestIntMethodExtended(inInt, callStatus);
129 }
130
131 template <typename ... _AttributeExtensions>
132 std::future<CommonAPI::CallStatus> ExtendedInterfaceProxy<_AttributeExtensions...>::TestIntMethodExtendedAsync(const uint32_t& inInt, TestIntMethodExtendedAsyncCallback callback) {
133     return delegate_->TestIntMethodExtendedAsync(inInt, callback);
134 }
135
136 template <typename ... _AttributeExtensions>
137 std::string ExtendedInterfaceProxy<_AttributeExtensions...>::getAddress() const {
138     return delegate_->getAddress();
139 }
140
141 template <typename ... _AttributeExtensions>
142 const std::string& ExtendedInterfaceProxy<_AttributeExtensions...>::getDomain() const {
143     return delegate_->getDomain();
144 }
145
146 template <typename ... _AttributeExtensions>
147 const std::string& ExtendedInterfaceProxy<_AttributeExtensions...>::getServiceId() const {
148     return delegate_->getServiceId();
149 }
150
151 template <typename ... _AttributeExtensions>
152 const std::string& ExtendedInterfaceProxy<_AttributeExtensions...>::getInstanceId() const {
153     return delegate_->getInstanceId();
154 }
155
156 template <typename ... _AttributeExtensions>
157 bool ExtendedInterfaceProxy<_AttributeExtensions...>::isAvailable() const {
158     return delegate_->isAvailable();
159 }
160
161 template <typename ... _AttributeExtensions>
162 bool ExtendedInterfaceProxy<_AttributeExtensions...>::isAvailableBlocking() const {
163     return delegate_->isAvailableBlocking();
164 }
165
166 template <typename ... _AttributeExtensions>
167 CommonAPI::ProxyStatusEvent& ExtendedInterfaceProxy<_AttributeExtensions...>::getProxyStatusEvent() {
168     return delegate_->getProxyStatusEvent();
169 }
170
171 template <typename ... _AttributeExtensions>
172 CommonAPI::InterfaceVersionAttribute& ExtendedInterfaceProxy<_AttributeExtensions...>::getInterfaceVersionAttribute() {
173     return delegate_->getInterfaceVersionAttribute();
174 }
175
176
177 } // namespace tests
178 } // namespace commonapi
179
180
181 #endif // COMMONAPI_TESTS_Extended_Interface_PROXY_H_