SerializableSectionPairRow.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-11
  6. * Changed: 2023-02-13
  7. *
  8. * */
  9. #ifndef LS_STD_SERIALIZABLE_SECTION_PAIR_ROW_HPP
  10. #define LS_STD_SERIALIZABLE_SECTION_PAIR_ROW_HPP
  11. #include <ls-std/core/Class.hpp>
  12. #include <ls-std/core/interface/ISerializable.hpp>
  13. #include <memory>
  14. #include <string>
  15. namespace ls::std::io
  16. {
  17. class SerializableSectionPairRow : public ls::std::core::interface_type::ISerializable
  18. {
  19. public:
  20. explicit SerializableSectionPairRow(const ::std::shared_ptr<ls::std::core::Class> &_value);
  21. ~SerializableSectionPairRow() override;
  22. [[nodiscard]] ::std::shared_ptr<ls::std::core::Class> getValue();
  23. [[nodiscard]] ls::std::core::type::byte_field marshal() override;
  24. void unmarshal(const ls::std::core::type::byte_field &_data) override;
  25. private:
  26. ::std::shared_ptr<ls::std::core::Class> value{};
  27. [[nodiscard]] ::std::string _marshalKey();
  28. void _setValue(const ::std::shared_ptr<ls::std::core::Class> &_value);
  29. void _unmarshalListValue(const ls::std::core::type::byte_field &_data);
  30. void _unmarshalSingleValue(const ls::std::core::type::byte_field &_data);
  31. };
  32. }
  33. #endif