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> |
| 7 | % for iface in interfaces: |
| 8 | #include <${iface.header()}> |
| 9 | % endfor |
| 10 | |
| 11 | namespace cereal |
| 12 | { |
| 13 | |
| 14 | % for iface in interfaces: |
| 15 | <% properties = interface_composite.names(str(iface)) %>\ |
| 16 | template<class Archive> |
| 17 | void save(Archive& a, |
| 18 | const ${iface.namespace()}& object) |
| 19 | { |
| 20 | <% |
| 21 | props = ["object." + p[:1].lower() + p[1:] + "()" for p in properties] |
| 22 | props = ', '.join(props) |
| 23 | %>\ |
| 24 | a(${props}); |
| 25 | } |
| 26 | |
| 27 | |
| 28 | template<class Archive> |
| 29 | void load(Archive& a, |
| 30 | ${iface.namespace()}& object) |
| 31 | { |
| 32 | % for p in properties: |
| 33 | <% t = "object." + p[:1].lower() + p[1:] + "()" %>\ |
| 34 | decltype(${t}) ${p}{}; |
| 35 | % endfor |
| 36 | <% |
| 37 | props = ', '.join(properties) |
| 38 | %>\ |
| 39 | a(${props}); |
| 40 | % for p in properties: |
| 41 | <% t = "object." + p[:1].lower() + p[1:] + "(" + p + ")" %>\ |
| 42 | ${t}; |
| 43 | % endfor |
| 44 | } |
| 45 | |
| 46 | % endfor |
| 47 | } // namespace cereal |