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.
6 #pragma clang diagnostic push
7 #pragma clang diagnostic ignored "-Wunused-private-field"
8 #elif defined(_MSC_VER)
10 #pragma warning(disable:4056)
11 #pragma warning(disable:4756)
14 #include "{{module.path}}.h"
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"
28 {%- for namespace in namespaces_as_array %}
29 namespace {{namespace}} {
33 {% for constant in module.constants %}
34 const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant|constant_value}};
42 {#--- Interface parameter definitions #}
43 {%- for interface in interfaces %}
44 {%- for method in interface.methods %}
45 {%- set method_name = "k%s_%s_Name"|format(interface.name, method.name) %}
46 const uint32_t {{method_name}} = {{method.ordinal}};
47 {% set struct = method|struct_from_method %}
48 {%- include "params_definition.tmpl" %}
49 {%- if method.response_parameters != None %}
50 {%- set struct = method|response_struct_from_method %}
51 {%- include "params_definition.tmpl" %}
60 {#--- Struct definitions #}
61 {% for struct in structs %}
62 {%- include "struct_definition.tmpl" %}
65 } // namespace internal
67 {#--- Struct Constants #}
68 {%- for struct in structs %}
69 {% for constant in struct.constants %}
70 const {{constant.kind|cpp_pod_type}} {{struct.name}}::{{constant.name}} = {{constant|constant_value}};
74 {#--- Struct builder definitions #}
75 {%- for struct in structs %}
76 {%- include "wrapper_class_definition.tmpl" %}
79 {#--- Interface definitions #}
80 {%- for interface in interfaces %}
81 {%- include "interface_definition.tmpl" %}
84 {#--- Struct Serialization Helpers #}
85 {%- for struct in structs %}
86 {%- include "struct_serialization_definition.tmpl" %}
89 {%- for namespace in namespaces_as_array|reverse %}
90 } // namespace {{namespace}}
93 #if defined(__clang__)
94 #pragma clang diagnostic pop
95 #elif defined(_MSC_VER)