1{%- import "interface_macros.tmpl" as interface_macros %} 2class {{interface.name}}Proxy; 3class {{interface.name}}Stub; 4 5class {{interface.name}}RequestValidator; 6{%- if interface|has_callbacks %} 7class {{interface.name}}ResponseValidator; 8{%- endif %} 9{% if interface.client %} 10class {{interface.client}}; 11{% endif %} 12 13class {{interface.name}} { 14 public: 15 static const char* Name_; 16 17 typedef {{interface.name}}Proxy Proxy_; 18 typedef {{interface.name}}Stub Stub_; 19 20 typedef {{interface.name}}RequestValidator RequestValidator_; 21{%- if interface|has_callbacks %} 22 typedef {{interface.name}}ResponseValidator ResponseValidator_; 23{%- else %} 24 typedef mojo::PassThroughFilter ResponseValidator_; 25{%- endif %} 26{% if interface.client %} 27 typedef {{interface.client}} Client; 28{% else %} 29 typedef mojo::NoInterface Client; 30{% endif %} 31 32{#--- Constants #} 33{%- for constant in interface.constants %} 34 static const {{constant.kind|cpp_pod_type}} {{constant.name}}; 35{%- endfor %} 36 37{#--- Enums #} 38{%- for enum in interface.enums %} 39{% macro enum_def() %}{% include "enum_declaration.tmpl" %}{% endmacro %} 40 {{enum_def()|indent(2)}} 41{%- endfor %} 42 43{#--- Methods #} 44 virtual ~{{interface.name}}() {} 45 46{%- for method in interface.methods %} 47 virtual void {{method.name}}({{interface_macros.declare_request_params("", method)}}) = 0; 48{%- endfor %} 49}; 50