summaryrefslogtreecommitdiff
path: root/src/test/src-gen/core/v1_0/commonapi/tests/managed/LeafInterfaceProxy.hpp
blob: 5e49c0979d7da42e5c8b25e096872e1ab4ca1cbe (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
/*
* 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_