OLD | NEW |
| (Empty) |
1 {% import "struct_macros.tmpl" as struct_macros -%} | |
2 {% import "interface_macros.tmpl" as interface_macros -%} | |
3 {%- set header_guard = "%s_SYNC_H_"| | |
4 format(module.path|upper|replace("/","_")|replace(".","_")) -%} | |
5 | |
6 // NOTE: This file was generated by the Mojo bindings generator. | |
7 #ifndef {{header_guard}} | |
8 #define {{header_guard}} | |
9 | |
10 #include <stdint.h> | |
11 | |
12 #include "mojo/public/cpp/bindings/array.h" | |
13 #include "mojo/public/cpp/bindings/callback.h" | |
14 #include "mojo/public/cpp/bindings/interface_handle.h" | |
15 #include "mojo/public/cpp/bindings/interface_request.h" | |
16 #include "mojo/public/cpp/bindings/map.h" | |
17 #include "mojo/public/cpp/bindings/message_validator.h" | |
18 #include "mojo/public/cpp/bindings/string.h" | |
19 #include "mojo/public/cpp/bindings/struct_ptr.h" | |
20 #include "mojo/public/cpp/bindings/lib/synchronous_connector.h" | |
21 #include "{{module.path}}-internal.h" | |
22 #include "{{module.path}}-common.h" | |
23 | |
24 {%- for import in imports %} | |
25 #include "{{import.module.path}}.h" | |
26 {%- endfor %} | |
27 | |
28 {% for namespace in namespaces_as_array %} | |
29 namespace {{namespace}} { | |
30 {%- endfor %} | |
31 | |
32 // --- Synchronous interface declaration --- | |
33 {% for interface in interfaces %} | |
34 class {{interface.name}}_SynchronousProxy; | |
35 class {{interface.name}}_Synchronous | |
36 : public internal::{{interface.name}}_Base { | |
37 public: | |
38 virtual ~{{interface.name}}_Synchronous() override {} | |
39 | |
40 using Proxy_ = {{interface.name}}_SynchronousProxy; | |
41 | |
42 {%- for method in interface.methods %} | |
43 virtual bool {{method.name}}( | |
44 {{interface_macros.declare_sync_request_params(method)}}) | |
45 {%- if method.response_parameters == None -%} const {%- endif -%} | |
46 = 0; | |
47 {%- endfor %} | |
48 }; | |
49 | |
50 class {{interface.name}}_SynchronousProxy | |
51 : public {{interface.name}}_Synchronous { | |
52 public: | |
53 explicit {{interface.name}}_SynchronousProxy( | |
54 mojo::internal::SynchronousConnector* connector, | |
55 mojo::internal::MessageValidatorList&& validators); | |
56 | |
57 {%- for method in interface.methods %} | |
58 bool {{method.name}}({{interface_macros.declare_sync_request_params(method)}}) | |
59 {%- if method.response_parameters == None %} const {% endif %} override; | |
60 {%- endfor %} | |
61 | |
62 private: | |
63 // |connector_| is passed to us, and is not owned by us. | |
64 mojo::internal::SynchronousConnector* const connector_; | |
65 mojo::internal::MessageValidatorList const validators_; | |
66 }; | |
67 {% endfor %} | |
68 | |
69 {%- for namespace in namespaces_as_array|reverse %} | |
70 } // namespace {{namespace}} | |
71 {%- endfor %} | |
72 | |
73 #endif // {{header_guard}} | |
OLD | NEW |