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

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

Issue 1770493002: Remove MOJO_STATIC_CONST_MEMBER_DEFINITION. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 {%- import "interface_macros.tmpl" as interface_macros %} 1 {%- import "interface_macros.tmpl" as interface_macros %}
2 {%- import "struct_macros.tmpl" as struct_macros %} 2 {%- import "struct_macros.tmpl" as struct_macros %}
3 {%- from "enum_macros.tmpl" import is_valid_enum_def %} 3 {%- from "enum_macros.tmpl" import is_valid_enum_def %}
4 {%- from "enum_macros.tmpl" import global_enum_operators_def %} 4 {%- from "enum_macros.tmpl" import global_enum_operators_def %}
5 5
6 {%- set class_name = interface.name %} 6 {%- set class_name = interface.name %}
7 {%- set proxy_name = interface.name ~ "Proxy" %} 7 {%- set proxy_name = interface.name ~ "Proxy" %}
8 8
9 {%- macro alloc_params(struct) %} 9 {%- macro alloc_params(struct) %}
10 {%- for param in struct.packed.packed_fields_in_ordinal_order %} 10 {%- for param in struct.packed.packed_fields_in_ordinal_order %}
(...skipping 13 matching lines...) Expand all
24 {%- endfor %} 24 {%- endfor %}
25 {%- endmacro %} 25 {%- endmacro %}
26 26
27 {%- macro build_message(struct, struct_display_name) -%} 27 {%- macro build_message(struct, struct_display_name) -%}
28 {{struct_macros.serialize(struct, struct_display_name, "in_%s", "params", "bui lder.buffer()", false)}} 28 {{struct_macros.serialize(struct, struct_display_name, "in_%s", "params", "bui lder.buffer()", false)}}
29 params->EncodePointersAndHandles(builder.message()->mutable_handles()); 29 params->EncodePointersAndHandles(builder.message()->mutable_handles());
30 {%- endmacro %} 30 {%- endmacro %}
31 31
32 {#--- Begin #} 32 {#--- Begin #}
33 {%- if interface.service_name %} 33 {%- if interface.service_name %}
34 MOJO_STATIC_CONST_MEMBER_DEFINITION const char {{class_name}}::Name_[] = "{{inte rface.service_name}}"; 34 const char {{class_name}}::Name_[] = "{{interface.service_name}}";
35 {%- endif %} 35 {%- endif %}
36 MOJO_STATIC_CONST_MEMBER_DEFINITION const uint32_t {{class_name}}::Version_; 36 const uint32_t {{class_name}}::Version_;
37 37
38 {#--- Constants #} 38 {#--- Constants #}
39 {%- for constant in interface.constants %} 39 {%- for constant in interface.constants %}
40 {%- if constant.kind|is_integral_kind %} 40 {%- if constant.kind|is_integral_kind %}
41 MOJO_STATIC_CONST_MEMBER_DEFINITION const {{constant.kind|cpp_pod_type}} {{inter face.name}}::{{constant.name}}; 41 const {{constant.kind|cpp_pod_type}} {{interface.name}}::{{constant.name}};
42 {%- else %} 42 {%- else %}
43 MOJO_STATIC_CONST_MEMBER_DEFINITION const {{constant.kind|cpp_pod_type}} {{inter face.name}}::{{constant.name}} = {{constant|constant_value}}; 43 const {{constant.kind|cpp_pod_type}} {{interface.name}}::{{constant.name}} = {{c onstant|constant_value}};
44 {%- endif %} 44 {%- endif %}
45 {%- endfor %} 45 {%- endfor %}
46 46
47 {#--- Enums #} 47 {#--- Enums #}
48 {%- for enum in interface.enums %} 48 {%- for enum in interface.enums %}
49 {{is_valid_enum_def(enum, class_name=interface.name)}} 49 {{is_valid_enum_def(enum, class_name=interface.name)}}
50 {{global_enum_operators_def(enum, class_name=interface.name)}} 50 {{global_enum_operators_def(enum, class_name=interface.name)}}
51 {%- endfor %} 51 {%- endfor %}
52 52
53 {#--- ForwardToCallback definition #} 53 {#--- ForwardToCallback definition #}
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 // Unrecognized message. 383 // Unrecognized message.
384 MOJO_INTERNAL_DEBUG_SET_ERROR_MSG(err) << "unknown response message name '" 384 MOJO_INTERNAL_DEBUG_SET_ERROR_MSG(err) << "unknown response message name '"
385 << message->header()->name 385 << message->header()->name
386 << "' for interface " 386 << "' for interface "
387 "'{{interface.name}}'"; 387 "'{{interface.name}}'";
388 ReportValidationError( 388 ReportValidationError(
389 mojo::internal::ValidationError::MESSAGE_HEADER_UNKNOWN_METHOD, err); 389 mojo::internal::ValidationError::MESSAGE_HEADER_UNKNOWN_METHOD, err);
390 return mojo::internal::ValidationError::MESSAGE_HEADER_UNKNOWN_METHOD; 390 return mojo::internal::ValidationError::MESSAGE_HEADER_UNKNOWN_METHOD;
391 } 391 }
392 {%- endif -%} 392 {%- endif -%}
OLDNEW
« no previous file with comments | « mojo/public/cpp/system/tests/macros_unittest.cc ('k') | mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698