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