Home | History | Annotate | Download | only in cpp_templates
      1 // Copyright 2016 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(_MSC_VER)
      6 #pragma warning(push)
      7 #pragma warning(disable:4065)
      8 #endif
      9 
     10 #include "{{module.path}}-shared.h"
     11 
     12 #include <utility>
     13 
     14 #include "base/logging.h"
     15 #include "mojo/public/cpp/bindings/lib/validate_params.h"
     16 #include "mojo/public/cpp/bindings/lib/validation_context.h"
     17 #include "mojo/public/cpp/bindings/lib/validation_errors.h"
     18 #include "mojo/public/cpp/bindings/lib/validation_util.h"
     19 
     20 {%- for header in extra_traits_headers %}
     21 #include "{{header}}"
     22 {%- endfor %}
     23 
     24 {%- for namespace in namespaces_as_array %}
     25 namespace {{namespace}} {
     26 {%- endfor %}
     27 
     28 namespace internal {
     29 
     30 {#--- Union definitions #}
     31 {%- for union in unions %}
     32 {%    include "union_definition.tmpl" %}
     33 {%- endfor %}
     34 
     35 {#--- Struct definitions #}
     36 {%- for struct in structs %}
     37 {%-   if not struct|is_native_only_kind %}
     38 {%      include "struct_definition.tmpl" %}
     39 {%-   endif %}
     40 {%- endfor %}
     41 
     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 {%-     set struct = method.param_struct %}
     47 {%      include "struct_definition.tmpl" %}
     48 {%-     if method.response_parameters != None %}
     49 {%-       set struct = method.response_param_struct %}
     50 {%        include "struct_definition.tmpl" %}
     51 {%-     endif %}
     52 {%-   endfor %}
     53 {%- endfor %}
     54 
     55 }  // namespace internal
     56 
     57 {%- for namespace in namespaces_as_array|reverse %}
     58 }  // namespace {{namespace}}
     59 {%- endfor %}
     60 
     61 #if defined(_MSC_VER)
     62 #pragma warning(pop)
     63 #endif
     64 
     65