1 // Copyright (C) 2014-2018 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_SD_OPTION_IMPL_HPP_ 7 #define VSOMEIP_V3_SD_OPTION_IMPL_HPP_ 8 9 #include <cstdint> 10 #include <memory> 11 12 #include "enumeration_types.hpp" 13 #include "message_element_impl.hpp" 14 15 namespace vsomeip_v3 { 16 17 class serializer; 18 class deserializer; 19 20 namespace sd { 21 22 class message_impl; 23 24 class option_impl: public message_element_impl { 25 public: 26 option_impl(); 27 virtual ~option_impl(); 28 29 virtual bool operator ==(const option_impl &_other) const; 30 bool equals(const std::shared_ptr<option_impl> &_other) const; 31 32 uint16_t get_length() const; 33 option_type_e get_type() const; 34 get_size() const35 inline uint32_t get_size() const { 36 return static_cast<uint32_t>(length_) + 3; 37 } 38 39 virtual bool serialize(vsomeip_v3::serializer *_to) const; 40 virtual bool deserialize(vsomeip_v3::deserializer *_from); 41 42 protected: 43 uint16_t length_; 44 option_type_e type_; 45 }; 46 47 } // namespace sd 48 } // namespace vsomeip_v3 49 50 #endif // VSOMEIP_V3_SD_OPTION_IMPL_HPP_ 51