1 // Copyright (C) 2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
2 // This Source Code Form is subject to the terms of the Mozilla Public
3 // License, v. 2.0. If a copy of the MPL was not distributed with this
4 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 
6 #ifndef VSOMEIP_COMPAT_PAYLOAD_IMPL_HPP_
7 #define VSOMEIP_COMPAT_PAYLOAD_IMPL_HPP_
8 
9 #include <compat/vsomeip/payload.hpp>
10 #include <vsomeip/payload.hpp>
11 
12 namespace vsomeip {
13 
14 class payload_impl
15         : public payload {
16 
17 public:
18     payload_impl(const std::shared_ptr<vsomeip_v3::payload> &_impl);
19     ~payload_impl();
20 
21     bool operator ==(const payload &_other);
22 
23     byte_t * get_data();
24     const byte_t * get_data() const;
25 
26     void set_data(const byte_t *_data, length_t _length);
27     void set_data(const std::vector<byte_t> &_data);
28     void set_data(std::vector<byte_t> &&_data);
29 
30     length_t get_length() const;
31     void set_capacity(length_t _length);
32 
33     bool deserialize(deserializer *_from);
34     bool serialize(serializer *_to) const;
35 
36     // Wraps
get_impl() const37     inline std::shared_ptr<vsomeip_v3::payload> get_impl() const { return impl_; }
38 
39 private:
40     std::shared_ptr<vsomeip_v3::payload> impl_;
41 };
42 
43 } // namespace vsomeip
44 
45 #endif // VSOMEIP_COMPAT_PAYLOAD_IMPL_HPP_
46