summaryrefslogtreecommitdiff
path: root/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationProxy.h
blob: c1cc85efcacd221911e623905a617341f3455b8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
/*
* This file was generated by the CommonAPI Generators.
* Used org.genivi.commonapi.core 2.1.6.v20140519.
* Used org.franca.core 0.8.11.201401091023.
*
* 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/.
*/
/**
 * Configuration = This interface allows a client application to set and retrieve
 *  configuration options
 */
#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_PROXY_H_
#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_PROXY_H_

#include "ConfigurationProxyBase.h"


#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
#endif

#include <CommonAPI/AttributeExtension.h>
#include <CommonAPI/Factory.h>

#undef COMMONAPI_INTERNAL_COMPILATION

namespace org {
namespace genivi {
namespace EnhancedPositionService {

template <typename ... _AttributeExtensions>
class ConfigurationProxy: virtual public Configuration, virtual public ConfigurationProxyBase
, public _AttributeExtensions... {
public:
    ConfigurationProxy(std::shared_ptr<CommonAPI::Proxy> delegate);
    ~ConfigurationProxy();

    typedef Configuration InterfaceType;


    /**
     * SatSystem = satellite system (GPS, GLONASS, ...)
     */
    /**
     * Returns the wrapper class that provides access to the attribute SatSystem.
     */
    virtual SatSystemAttribute& getSatSystemAttribute() {
        return delegate_->getSatSystemAttribute();
    }
    /**
     * UpdateInterval = update interval
     */
    /**
     * Returns the wrapper class that provides access to the attribute UpdateInterval.
     */
    virtual UpdateIntervalAttribute& getUpdateIntervalAttribute() {
        return delegate_->getUpdateIntervalAttribute();
    }


    /**
     * GetVersion = This method returns the API version implemented by the server
     *  application
     * 
     * Calls GetVersion 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 GetVersion(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Version& version);
    /**
     * Calls GetVersion 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> GetVersionAsync(GetVersionAsyncCallback callback);
    /**
     * GetSupportedSatelliteSystems = This method returns a list of supported
     *  satellite systems
     * 
     * Calls GetSupportedSatelliteSystems 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 GetSupportedSatelliteSystems(CommonAPI::CallStatus& callStatus, std::vector<EnhancedPositionServiceTypes::SatelliteSystem>& satelliteSystems);
    /**
     * Calls GetSupportedSatelliteSystems 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> GetSupportedSatelliteSystemsAsync(GetSupportedSatelliteSystemsAsyncCallback 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<ConfigurationProxyBase> delegate_;
};

#ifdef WIN32
    typedef ConfigurationProxy<CommonAPI::WINDummyAttributeExtension<CommonAPI::WINDummyAttribute>> ConfigurationProxyDefault;
#else
    typedef ConfigurationProxy<> ConfigurationProxyDefault;
#endif

namespace ConfigurationExtensions {
    /**
     * SatSystem = satellite system (GPS, GLONASS, ...)
     */
    template <template <typename > class _ExtensionType>
    class SatSystemAttributeExtension {
     public:
        typedef _ExtensionType<ConfigurationProxyBase::SatSystemAttribute> extension_type;
    
        static_assert(std::is_base_of<typename CommonAPI::AttributeExtension<ConfigurationProxyBase::SatSystemAttribute>, extension_type>::value,
                      "Not CommonAPI Attribute Extension!");
    #ifdef WIN32
        SatSystemAttributeExtension() {}
    #endif
    
        SatSystemAttributeExtension(ConfigurationProxyBase& proxy): attributeExtension_(proxy.getSatSystemAttribute()) {
        }
    
        inline extension_type& getSatSystemAttributeExtension() {
            return attributeExtension_;
        }
    
     private:
        extension_type attributeExtension_;
    };

    /**
     * UpdateInterval = update interval
     */
    template <template <typename > class _ExtensionType>
    class UpdateIntervalAttributeExtension {
     public:
        typedef _ExtensionType<ConfigurationProxyBase::UpdateIntervalAttribute> extension_type;
    
        static_assert(std::is_base_of<typename CommonAPI::AttributeExtension<ConfigurationProxyBase::UpdateIntervalAttribute>, extension_type>::value,
                      "Not CommonAPI Attribute Extension!");
    #ifdef WIN32
        UpdateIntervalAttributeExtension() {}
    #endif
    
        UpdateIntervalAttributeExtension(ConfigurationProxyBase& proxy): attributeExtension_(proxy.getUpdateIntervalAttribute()) {
        }
    
        inline extension_type& getUpdateIntervalAttributeExtension() {
            return attributeExtension_;
        }
    
     private:
        extension_type attributeExtension_;
    };

} // namespace ConfigurationExtensions

//
// ConfigurationProxy Implementation
//
template <typename ... _AttributeExtensions>
ConfigurationProxy<_AttributeExtensions...>::ConfigurationProxy(std::shared_ptr<CommonAPI::Proxy> delegate):
        _AttributeExtensions(*(std::dynamic_pointer_cast<ConfigurationProxyBase>(delegate)))...,
        delegate_(std::dynamic_pointer_cast<ConfigurationProxyBase>(delegate)) {
}

template <typename ... _AttributeExtensions>
ConfigurationProxy<_AttributeExtensions...>::~ConfigurationProxy() {
}

/**
 * GetVersion = This method returns the API version implemented by the server
 *  application
 */
template <typename ... _AttributeExtensions>
void ConfigurationProxy<_AttributeExtensions...>::GetVersion(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Version& version) {
    delegate_->GetVersion(callStatus, version);
}

template <typename ... _AttributeExtensions>
std::future<CommonAPI::CallStatus> ConfigurationProxy<_AttributeExtensions...>::GetVersionAsync(GetVersionAsyncCallback callback) {
    return delegate_->GetVersionAsync(callback);
}
/**
 * GetSupportedSatelliteSystems = This method returns a list of supported
 *  satellite systems
 */
template <typename ... _AttributeExtensions>
void ConfigurationProxy<_AttributeExtensions...>::GetSupportedSatelliteSystems(CommonAPI::CallStatus& callStatus, std::vector<EnhancedPositionServiceTypes::SatelliteSystem>& satelliteSystems) {
    delegate_->GetSupportedSatelliteSystems(callStatus, satelliteSystems);
}

template <typename ... _AttributeExtensions>
std::future<CommonAPI::CallStatus> ConfigurationProxy<_AttributeExtensions...>::GetSupportedSatelliteSystemsAsync(GetSupportedSatelliteSystemsAsyncCallback callback) {
    return delegate_->GetSupportedSatelliteSystemsAsync(callback);
}

template <typename ... _AttributeExtensions>
std::string ConfigurationProxy<_AttributeExtensions...>::getAddress() const {
    return delegate_->getAddress();
}

template <typename ... _AttributeExtensions>
const std::string& ConfigurationProxy<_AttributeExtensions...>::getDomain() const {
    return delegate_->getDomain();
}

template <typename ... _AttributeExtensions>
const std::string& ConfigurationProxy<_AttributeExtensions...>::getServiceId() const {
    return delegate_->getServiceId();
}

template <typename ... _AttributeExtensions>
const std::string& ConfigurationProxy<_AttributeExtensions...>::getInstanceId() const {
    return delegate_->getInstanceId();
}

template <typename ... _AttributeExtensions>
bool ConfigurationProxy<_AttributeExtensions...>::isAvailable() const {
    return delegate_->isAvailable();
}

template <typename ... _AttributeExtensions>
bool ConfigurationProxy<_AttributeExtensions...>::isAvailableBlocking() const {
    return delegate_->isAvailableBlocking();
}

template <typename ... _AttributeExtensions>
CommonAPI::ProxyStatusEvent& ConfigurationProxy<_AttributeExtensions...>::getProxyStatusEvent() {
    return delegate_->getProxyStatusEvent();
}

template <typename ... _AttributeExtensions>
CommonAPI::InterfaceVersionAttribute& ConfigurationProxy<_AttributeExtensions...>::getInterfaceVersionAttribute() {
    return delegate_->getInterfaceVersionAttribute();
}


} // namespace EnhancedPositionService
} // namespace genivi
} // namespace org

namespace CommonAPI {
template<template<typename > class _AttributeExtension>
struct DefaultAttributeProxyFactoryHelper<org::genivi::EnhancedPositionService::ConfigurationProxy,
    _AttributeExtension> {
    typedef typename org::genivi::EnhancedPositionService::ConfigurationProxy<
            org::genivi::EnhancedPositionService::ConfigurationExtensions::SatSystemAttributeExtension<_AttributeExtension>, 
            org::genivi::EnhancedPositionService::ConfigurationExtensions::UpdateIntervalAttributeExtension<_AttributeExtension>
    > class_t;
};
}

#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_PROXY_H_