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

build_info.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_SERIALIZE_TYPE_BUILD_INFO_HPP
10 #define EAGINE_SERIALIZE_TYPE_BUILD_INFO_HPP
11 
12 #include "../../build_info.hpp"
13 #include "../read.hpp"
14 #include "../write.hpp"
15 
16 namespace eagine {
17 //------------------------------------------------------------------------------
18 template <>
19 struct serializer<build_info> : common_serializer<build_info> {
20  template <typename Backend>
21  auto write(const build_info& value, Backend& backend) const {
22  return _serializer.write(value._data, backend);
23  }
24 
25 private:
26  serializer<typename build_info::_data_tuple> _serializer{};
27 };
28 //------------------------------------------------------------------------------
29 template <>
30 struct deserializer<build_info> : common_deserializer<build_info> {
31  template <typename Backend>
32  auto read(build_info& value, Backend& backend) const {
33  typename build_info::_data_tuple temp{};
34  const auto errors{_deserializer.read(temp, backend)};
35  if(EAGINE_LIKELY(!errors)) {
36  value = {std::move(temp)};
37  }
38  return errors;
39  }
40 
41 private:
42  deserializer<typename build_info::_data_tuple> _deserializer{};
43 };
44 //------------------------------------------------------------------------------
45 } // namespace eagine
46 
47 #endif
48 
Common code is placed in this namespace.
Definition: eagine.hpp:21
@ build_info
The build information has appeared or changed.

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