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> |
Vishwanatha Subbanna | 2c4425e | 2017-09-29 22:53:53 +0530 | [diff] [blame] | 8 | #include "config.h" |
Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 9 | % for iface in interfaces: |
| 10 | #include <${iface.header()}> |
| 11 | % endfor |
| 12 | |
Vishwanatha Subbanna | 2c4425e | 2017-09-29 22:53:53 +0530 | [diff] [blame] | 13 | % for iface in interfaces: |
| 14 | <% properties = interface_composite.names(str(iface)) %>\ |
| 15 | CEREAL_CLASS_VERSION(${iface.namespace()}, CLASS_VERSION); |
| 16 | % endfor |
| 17 | |
Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 18 | namespace cereal |
| 19 | { |
| 20 | |
| 21 | % for iface in interfaces: |
| 22 | <% properties = interface_composite.names(str(iface)) %>\ |
| 23 | template<class Archive> |
| 24 | void save(Archive& a, |
Vishwanatha Subbanna | 2c4425e | 2017-09-29 22:53:53 +0530 | [diff] [blame] | 25 | const ${iface.namespace()}& object, |
| 26 | const std::uint32_t version) |
Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 27 | { |
| 28 | <% |
Brad Bishop | 3864659 | 2019-04-12 18:05:45 +0000 | [diff] [blame] | 29 | props = ["object." + p.camelCase + "()" for p in properties] |
Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 30 | props = ', '.join(props) |
| 31 | %>\ |
| 32 | a(${props}); |
| 33 | } |
| 34 | |
| 35 | |
| 36 | template<class Archive> |
| 37 | void load(Archive& a, |
Vishwanatha Subbanna | 2c4425e | 2017-09-29 22:53:53 +0530 | [diff] [blame] | 38 | ${iface.namespace()}& object, |
| 39 | const std::uint32_t version) |
Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 40 | { |
| 41 | % for p in properties: |
Brad Bishop | 3864659 | 2019-04-12 18:05:45 +0000 | [diff] [blame] | 42 | <% t = "object." + p.camelCase + "()" %>\ |
| 43 | decltype(${t}) ${p.CamelCase}{}; |
Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 44 | % endfor |
| 45 | <% |
Brad Bishop | 3864659 | 2019-04-12 18:05:45 +0000 | [diff] [blame] | 46 | props = ', '.join([p.CamelCase for p in properties]) |
Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 47 | %>\ |
| 48 | a(${props}); |
| 49 | % for p in properties: |
Brad Bishop | 3864659 | 2019-04-12 18:05:45 +0000 | [diff] [blame] | 50 | <% t = "object." + p.camelCase + "(" + p.CamelCase + ")" %>\ |
Deepak Kodihalli | f7b0399 | 2017-08-04 11:25:41 -0500 | [diff] [blame] | 51 | ${t}; |
| 52 | % endfor |
| 53 | } |
| 54 | |
| 55 | % endfor |
| 56 | } // namespace cereal |