Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 1 | ## This file is a template. The comment below is emitted |
| 2 | ## into the rendered file; feel free to edit this file. |
| 3 | // This file was auto generated. Do not edit. |
| 4 | |
| 5 | #include <cereal/types/string.hpp> |
Brad Bishop | 1f4c70a | 2019-04-12 19:17:11 +0000 | [diff] [blame] | 6 | #include <cereal/types/tuple.hpp> |
Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 7 | #include <cereal/types/vector.hpp> |
Patrick Williams | 84b99d9 | 2020-10-14 10:09:31 -0500 | [diff] [blame] | 8 | #include <cereal/types/map.hpp> |
Vishwanatha Subbanna | 2c4425e | 2017-09-29 22:53:53 +0530 | [diff] [blame] | 9 | #include "config.h" |
Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 10 | % for iface in interfaces: |
| 11 | #include <${iface.header()}> |
| 12 | % endfor |
| 13 | |
Vishwanatha Subbanna | 2c4425e | 2017-09-29 22:53:53 +0530 | [diff] [blame] | 14 | % for iface in interfaces: |
| 15 | <% properties = interface_composite.names(str(iface)) %>\ |
| 16 | CEREAL_CLASS_VERSION(${iface.namespace()}, CLASS_VERSION); |
| 17 | % endfor |
| 18 | |
Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 19 | namespace cereal |
| 20 | { |
| 21 | |
| 22 | % for iface in interfaces: |
| 23 | <% properties = interface_composite.names(str(iface)) %>\ |
| 24 | template<class Archive> |
| 25 | void save(Archive& a, |
Vishwanatha Subbanna | 2c4425e | 2017-09-29 22:53:53 +0530 | [diff] [blame] | 26 | const ${iface.namespace()}& object, |
| 27 | const std::uint32_t version) |
Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 28 | { |
| 29 | <% |
Brad Bishop | 3864659 | 2019-04-12 18:05:45 +0000 | [diff] [blame] | 30 | props = ["object." + p.camelCase + "()" for p in properties] |
Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 31 | props = ', '.join(props) |
| 32 | %>\ |
| 33 | a(${props}); |
| 34 | } |
| 35 | |
| 36 | |
| 37 | template<class Archive> |
| 38 | void load(Archive& a, |
Vishwanatha Subbanna | 2c4425e | 2017-09-29 22:53:53 +0530 | [diff] [blame] | 39 | ${iface.namespace()}& object, |
| 40 | const std::uint32_t version) |
Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 41 | { |
| 42 | % for p in properties: |
Brad Bishop | 3864659 | 2019-04-12 18:05:45 +0000 | [diff] [blame] | 43 | <% t = "object." + p.camelCase + "()" %>\ |
| 44 | decltype(${t}) ${p.CamelCase}{}; |
Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 45 | % endfor |
| 46 | <% |
Brad Bishop | 3864659 | 2019-04-12 18:05:45 +0000 | [diff] [blame] | 47 | props = ', '.join([p.CamelCase for p in properties]) |
Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 48 | %>\ |
| 49 | a(${props}); |
| 50 | % for p in properties: |
Brad Bishop | 3864659 | 2019-04-12 18:05:45 +0000 | [diff] [blame] | 51 | <% t = "object." + p.camelCase + "(" + p.CamelCase + ")" %>\ |
Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 52 | ${t}; |
| 53 | % endfor |
| 54 | } |
| 55 | |
| 56 | % endfor |
| 57 | } // namespace cereal |