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