| {{/* |
| // Copyright 2018 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| */}} |
| |
| {{- define "Filename:TestBase" -}} |
| {{- .LibrarySlashes }}/cpp/fidl_test_base.h |
| {{- end }} |
| |
| {{- define "File:TestBase" -}} |
| {{- UseHLCPP -}} |
| // WARNING: This file is machine generated by fidlgen. |
| {{ range $experiment := .Experiments }} |
| // fidl_experiment = {{ $experiment }} |
| {{- end }} |
| |
| #pragma once |
| |
| {{ range .Dependencies -}} |
| #include <{{ . | Filename "Header" }}> |
| {{ end -}} |
| |
| #include <{{ .Library | Filename "Header" }}> |
| |
| {{- range .Decls }} |
| {{- if Eq .Kind Kinds.Protocol }}{{ $protocol := .}} |
| {{- range $transport, $_ := .Transports }}{{- if eq $transport "Channel" }} |
| {{ EnsureNamespace $protocol.TestBase }} |
| class {{ $protocol.TestBase.Name }} : public {{ $protocol }} { |
| public: |
| virtual ~{{ $protocol.TestBase.Name }}() { } |
| virtual void NotImplemented_(const std::string& name) = 0; |
| |
| {{- range $protocol.Methods }} |
| {{- if .HasRequest }} |
| void {{ template "RequestMethodSignature" . }} override { |
| NotImplemented_("{{ .Name }}"); |
| } |
| {{- end }} |
| {{- end }} |
| |
| {{- if $protocol.HandlesTwoWayUnknownInteractions }} |
| void handle_unknown_method(uint64_t ordinal, bool method_has_response) override { |
| NotImplemented_("handle_unknown_method"); |
| } |
| {{- else if $protocol.HandlesOneWayUnknownInteractions }} |
| void handle_unknown_method(uint64_t ordinal) override { |
| NotImplemented_("handle_unknown_method"); |
| } |
| {{- end }} |
| }; |
| {{- end }} |
| {{- end }}{{ end }}{{ end -}} |
| |
| {{ EndOfFile }} |
| {{ end }} |