1 // Copyright (C) 2014-2017 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_V3_MESSAGE_IMPL_HPP
7 #define VSOMEIP_V3_MESSAGE_IMPL_HPP
8 
9 #include <memory>
10 
11 #include <vsomeip/export.hpp>
12 #include <vsomeip/primitive_types.hpp>
13 #include "message_base_impl.hpp"
14 
15 #  if _MSC_VER >= 1300
16 /*
17 * Diamond inheritance is used for the vsomeip::message_base base class.
18 * The Microsoft compiler put warning (C4250) using a desired c++ feature: "Delegating to a sister class"
19 * A powerful technique that arises from using virtual inheritance is to delegate a method from a class in another class
20 * by using a common abstract base class. This is also called cross delegation.
21 */
22 #    pragma warning( disable : 4250 )
23 #  endif
24 
25 namespace vsomeip_v3 {
26 
27 class payload;
28 
29 class message_impl
30         : virtual public message,
31           virtual public message_base_impl {
32 public:
33     VSOMEIP_EXPORT message_impl();
34     VSOMEIP_EXPORT virtual ~message_impl();
35 
36     VSOMEIP_EXPORT length_t get_length() const;
37     VSOMEIP_EXPORT void set_length(length_t _length);
38 
39     VSOMEIP_EXPORT std::shared_ptr< payload > get_payload() const;
40     VSOMEIP_EXPORT void set_payload(std::shared_ptr< payload > _payload);
41 
42     VSOMEIP_EXPORT bool serialize(serializer *_to) const;
43     VSOMEIP_EXPORT bool deserialize(deserializer *_from);
44 
45     VSOMEIP_EXPORT uint8_t get_check_result() const;
46     VSOMEIP_EXPORT void set_check_result(uint8_t _check_result);
47     VSOMEIP_EXPORT bool is_valid_crc() const;
48 
49     VSOMEIP_EXPORT uid_t get_uid() const;
50     VSOMEIP_EXPORT void set_uid(uid_t _uid);
51 
52     VSOMEIP_EXPORT gid_t get_gid() const;
53     VSOMEIP_EXPORT void set_gid(gid_t _gid);
54 
55 protected: // members
56     std::shared_ptr< payload > payload_;
57     uint8_t check_result_;
58     uid_t uid_;
59     gid_t gid_;
60 };
61 
62 } // namespace vsomeip_v3
63 
64 #endif // VSOMEIP_V3_MESSAGE_IMPL_HPP
65