OGLplus  (0.59.0) a C++ wrapper for rendering APIs

sudoku.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_SERIALIZE_TYPE_SUDOKU_HPP
10 #define EAGINE_SERIALIZE_TYPE_SUDOKU_HPP
11 
12 #include "../../sudoku.hpp"
13 #include "../data_buffer.hpp"
14 #include "../read.hpp"
15 #include "../write.hpp"
16 
17 namespace eagine {
18 //------------------------------------------------------------------------------
19 template <identifier_t Sid, unsigned S, bool T, typename Selector>
20 struct get_serialize_buffer_size<Sid, basic_sudoku_board<S, T>, Selector>
21  : get_serialize_buffer_size<
22  Sid,
23  typename basic_sudoku_board<S, T>::blocks_type,
24  Selector> {};
25 //------------------------------------------------------------------------------
26 template <unsigned S, bool T>
27 struct serializer<basic_sudoku_board<S, T>>
28  : common_serializer<basic_sudoku_board<S, T>> {
29  template <typename Backend>
30  auto write(const basic_sudoku_board<S, T>& value, Backend& backend) const {
31  return _serializer.write(value._blocks, backend);
32  }
33 
34 private:
35  serializer<typename basic_sudoku_board<S, T>::blocks_type> _serializer{};
36 };
37 //------------------------------------------------------------------------------
38 template <unsigned S, bool T>
39 struct deserializer<basic_sudoku_board<S, T>>
40  : common_deserializer<basic_sudoku_board<S, T>> {
41  template <typename Backend>
42  auto read(basic_sudoku_board<S, T>& value, Backend& backend) const {
43  const auto errors{_deserializer.read(value._blocks, backend)};
44  return errors;
45  }
46 
47 private:
48  deserializer<typename basic_sudoku_board<S, T>::blocks_type> _deserializer{};
49 };
50 //------------------------------------------------------------------------------
51 } // namespace eagine
52 
53 #endif
54 
Common code is placed in this namespace.
Definition: eagine.hpp:21

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).