Upstream version 7.35.144.0
[platform/framework/web/crosswalk.git] / src / mojo / public / bindings / generators / cpp_templates / module.cc.tmpl
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
3 // found in the LICENSE file.
4
5 #if defined(__clang__)
6 #pragma clang diagnostic push
7 #pragma clang diagnostic ignored "-Wunused-private-field"
8 #endif
9
10 #include "{{module.path}}.h"
11
12 #include "mojo/public/bindings/lib/bindings_serialization.h"
13 #include "mojo/public/bindings/lib/message_builder.h"
14
15 namespace {{namespace}} {
16 namespace internal {
17 namespace {
18
19 #pragma pack(push, 1)
20
21 {#--- Interface parameter definitions #}
22 {%- for interface in interfaces %}
23 {%-   for method in interface.methods %}
24 {%-     set method_name = "k%s_%s_Name"|format(interface.name, method.name) %}
25 const uint32_t {{method_name}} = {{method.ordinal}};
26 {%      set struct = interface|struct_from_method(method) %}
27 {%-     include "params_definition.tmpl" %}
28 {%-     if method.response_parameters != None %}
29 {%-       set struct = interface|response_struct_from_method(method) %}
30 {%-       include "params_definition.tmpl" %}
31 {%-     endif %}
32 {%-   endfor %}
33 {%- endfor %}
34
35 #pragma pack(pop)
36
37 }  // namespace
38
39 {#--- Struct destructors #}
40 {%- for struct in structs %}
41 {%-   include "struct_destructor.tmpl" %}
42 {%- endfor %}
43
44 {#--- Struct definitions #}
45 {%  for struct in structs %}
46 {%-   include "struct_definition.tmpl" %}
47 {%- endfor %}
48
49 }  // namespace internal
50
51 {#--- Struct builder definitions #}
52 {%- for struct in structs %}
53 {%-   include "struct_builder_definition.tmpl" %}
54 {%- endfor %}
55
56 {#--- Interface definitions #}
57 {%- for interface in interfaces %}
58 {%-   include "interface_definition.tmpl" %}
59 {%- endfor %}
60 }  // namespace {{namespace}}
61
62 #if defined(__clang__)
63 #pragma clang diagnostic pop
64 #endif