| {{/* |
| // 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:WireTestBase" -}} |
| fidl/{{ .LibraryDots }}/cpp/wire_test_base.h |
| {{- end }} |
| |
| |
| {{- define "File:WireTestBase" -}} |
| {{- UseWire -}} |
| {{- SetTransport "Channel" -}} |
| // WARNING: This file is machine generated by fidlgen. |
| |
| #pragma once |
| |
| #include <{{ .Library | Filename "WireHeader" }}> |
| |
| {{- range (call .ProtocolsForTransport "Channel") }} |
| {{ EnsureNamespace "fidl::testing" }} |
| |
| template<> |
| class {{ .TestBase.Name }} : public {{ .WireServer }} { |
| public: |
| virtual ~{{ .TestBase.Name }}() = default; |
| virtual void NotImplemented_(const std::string& name, ::fidl::CompleterBase& completer) = 0; |
| |
| {{- range .Methods }} |
| {{- if .HasRequest }} |
| virtual void {{ .Name }}( |
| {{ .WireRequestViewArg }} request, {{ .WireCompleterArg }}& completer) override { |
| NotImplemented_("{{ .Name }}", completer); } |
| {{- end }} |
| {{- end }} |
| }; |
| |
| template<> |
| class {{ .WireSyncEventHandlerTestBase }} : public {{ .WireSyncEventHandler }} { |
| public: |
| virtual ~{{ .WireSyncEventHandlerTestBase.Name }}() = default; |
| virtual void NotImplemented_(const std::string& name) = 0; |
| |
| {{- range .Events }} |
| virtual void {{ .Name }}({{ .WireEvent }}* event) override { |
| NotImplemented_("{{ .Name }}"); |
| } |
| {{- end }} |
| }; |
| {{ end -}} |
| |
| {{ UnsetTransport -}} |
| {{ EndOfFile }} |
| {{ end }} |
| |