Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl

Issue 294833002: Mojo: more idiomatic C++ bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if defined(__clang__) 5 #if defined(__clang__)
6 #pragma clang diagnostic push 6 #pragma clang diagnostic push
7 #pragma clang diagnostic ignored "-Wunused-private-field" 7 #pragma clang diagnostic ignored "-Wunused-private-field"
8 #endif 8 #endif
9 9
10 #include "{{module.path}}.h" 10 #include "{{module.path}}.h"
11 11
12 #include "mojo/public/cpp/bindings/lib/array_serialization.h"
12 #include "mojo/public/cpp/bindings/lib/bindings_serialization.h" 13 #include "mojo/public/cpp/bindings/lib/bindings_serialization.h"
14 #include "mojo/public/cpp/bindings/lib/string_serialization.h"
13 #include "mojo/public/cpp/bindings/lib/message_builder.h" 15 #include "mojo/public/cpp/bindings/lib/message_builder.h"
14 16
15 {%- for namespace in namespaces_as_array %} 17 {%- for namespace in namespaces_as_array %}
16 namespace {{namespace}} { 18 namespace {{namespace}} {
17 {%- endfor %} 19 {%- endfor %}
18 20
19 {#--- Constants #} 21 {#--- Constants #}
20 {% for constant in module.constants %} 22 {% for constant in module.constants %}
21 const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant.value|expres sion_to_text(module)}}; 23 const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant.value|expres sion_to_text(module)}};
22 {%- endfor %} 24 {%- endfor %}
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 60
59 {#--- Struct Constants #} 61 {#--- Struct Constants #}
60 {%- for struct in structs %} 62 {%- for struct in structs %}
61 {% for constant in struct.constants %} 63 {% for constant in struct.constants %}
62 const {{constant.kind|cpp_pod_type}} {{struct.name}}::{{constant.name}} = {{cons tant.value|expression_to_text(module)}}; 64 const {{constant.kind|cpp_pod_type}} {{struct.name}}::{{constant.name}} = {{cons tant.value|expression_to_text(module)}};
63 {%- endfor %} 65 {%- endfor %}
64 {%- endfor %} 66 {%- endfor %}
65 67
66 {#--- Struct builder definitions #} 68 {#--- Struct builder definitions #}
67 {%- for struct in structs %} 69 {%- for struct in structs %}
68 {%- include "struct_builder_definition.tmpl" %} 70 {%- include "wrapper_class_definition.tmpl" %}
69 {%- endfor %} 71 {%- endfor %}
70 72
71 {#--- Interface definitions #} 73 {#--- Interface definitions #}
72 {%- for interface in interfaces %} 74 {%- for interface in interfaces %}
73 {%- include "interface_definition.tmpl" %} 75 {%- include "interface_definition.tmpl" %}
74 {%- endfor %} 76 {%- endfor %}
77
78 {#--- Struct Serialization Helpers #}
79 {%- for struct in structs %}
80 {%- include "struct_serialization_definition.tmpl" %}
81 {%- endfor %}
82
75 {%- for namespace in namespaces_as_array|reverse %} 83 {%- for namespace in namespaces_as_array|reverse %}
76 } // namespace {{namespace}} 84 } // namespace {{namespace}}
77 {%- endfor %} 85 {%- endfor %}
78 86
79 #if defined(__clang__) 87 #if defined(__clang__)
80 #pragma clang diagnostic pop 88 #pragma clang diagnostic pop
81 #endif 89 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698