OLD | NEW |
| (Empty) |
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 #elif defined(_MSC_VER) | |
9 #pragma warning(push) | |
10 #pragma warning(disable:4056) | |
11 #pragma warning(disable:4756) | |
12 #endif | |
13 | |
14 #include "{{module.path}}.h" | |
15 | |
16 #include <math.h> | |
17 | |
18 #include "mojo/public/cpp/bindings/lib/array_serialization.h" | |
19 #include "mojo/public/cpp/bindings/lib/bindings_serialization.h" | |
20 #include "mojo/public/cpp/bindings/lib/bounds_checker.h" | |
21 #include "mojo/public/cpp/bindings/lib/map_data_internal.h" | |
22 #include "mojo/public/cpp/bindings/lib/map_serialization.h" | |
23 #include "mojo/public/cpp/bindings/lib/message_builder.h" | |
24 #include "mojo/public/cpp/bindings/lib/string_serialization.h" | |
25 #include "mojo/public/cpp/bindings/lib/validate_params.h" | |
26 #include "mojo/public/cpp/bindings/lib/validation_errors.h" | |
27 #include "mojo/public/cpp/environment/logging.h" | |
28 | |
29 {%- for namespace in namespaces_as_array %} | |
30 namespace {{namespace}} { | |
31 {%- endfor %} | |
32 | |
33 {#--- Constants #} | |
34 {% for constant in module.constants %} | |
35 const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant|constant_val
ue}}; | |
36 {%- endfor %} | |
37 | |
38 namespace internal { | |
39 namespace { | |
40 | |
41 #pragma pack(push, 1) | |
42 | |
43 {#--- Interface parameter definitions #} | |
44 {%- for interface in interfaces %} | |
45 {%- for method in interface.methods %} | |
46 {%- set method_name = "k%s_%s_Name"|format(interface.name, method.name) %} | |
47 const uint32_t {{method_name}} = {{method.ordinal}}; | |
48 {% set struct = method|struct_from_method %} | |
49 {%- include "params_definition.tmpl" %} | |
50 {%- if method.response_parameters != None %} | |
51 {%- set struct = method|response_struct_from_method %} | |
52 {%- include "params_definition.tmpl" %} | |
53 {%- endif %} | |
54 {%- endfor %} | |
55 {%- endfor %} | |
56 | |
57 #pragma pack(pop) | |
58 | |
59 } // namespace | |
60 | |
61 {#--- Struct definitions #} | |
62 {% for struct in structs %} | |
63 {%- include "struct_definition.tmpl" %} | |
64 {%- endfor %} | |
65 | |
66 } // namespace internal | |
67 | |
68 {#--- Struct Constants #} | |
69 {%- for struct in structs %} | |
70 {% for constant in struct.constants %} | |
71 const {{constant.kind|cpp_pod_type}} {{struct.name}}::{{constant.name}} = {{cons
tant|constant_value}}; | |
72 {%- endfor %} | |
73 {%- endfor %} | |
74 | |
75 {#--- Struct builder definitions #} | |
76 {%- for struct in structs %} | |
77 {%- include "wrapper_class_definition.tmpl" %} | |
78 {%- endfor %} | |
79 | |
80 {#--- Interface definitions #} | |
81 {%- for interface in interfaces %} | |
82 {%- include "interface_definition.tmpl" %} | |
83 {%- endfor %} | |
84 | |
85 {#--- Struct Serialization Helpers #} | |
86 {%- for struct in structs %} | |
87 {%- include "struct_serialization_definition.tmpl" %} | |
88 {%- endfor %} | |
89 | |
90 {%- for namespace in namespaces_as_array|reverse %} | |
91 } // namespace {{namespace}} | |
92 {%- endfor %} | |
93 | |
94 #if defined(__clang__) | |
95 #pragma clang diagnostic pop | |
96 #elif defined(_MSC_VER) | |
97 #pragma warning(pop) | |
98 #endif | |
OLD | NEW |