blob: eaf2cfeeba2e87be773a6606308ce7b108fa122c [file] [log] [blame] [edit]
{{/*
// Copyright 2021 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:Header" -}}
{{- .LibrarySlashes }}/cpp/fidl_v2.h
{{- end }}
{{- define "File:Header" -}}
{{- UseUnified -}}
// WARNING: This file is machine generated by fidlgen_cpp.
#pragma once
{{ "" }}
{{- /* Include library headers from dependencies. */}}
{{ range .Dependencies -}}
#include <{{ . | Filename "Header" }}>
{{ end -}}
{{- /* Import the natural types from the HLCPP bindings. */}}
#include <{{ .LegacyIncludeDir }}/natural_types.h>
{{- /* Import the wire types and messaging API from the LLCPP bindings. */}}
#include <{{ .UnifiedIncludeDir }}/wire.h>
{{ "" }}
{{- /* When the library name only has one component, the natural types are trivially
available in our namespace. */}}
{{- if not .SingleComponentLibraryName }}
{{- /* Bring the natural domain object types into our namespace. */}}
{{- range .Decls }}
{{- if Eq .Kind Kinds.Bits }}{{ template "NaturalTypeAlias" . }}{{- end }}
{{- if Eq .Kind Kinds.Enum }}{{ template "NaturalTypeAlias" . }}{{- end }}
{{- if Eq .Kind Kinds.Struct }}{{ template "NaturalTypeAlias" . }}{{- end }}
{{- if Eq .Kind Kinds.Table }}{{ template "NaturalTypeAlias" . }}{{- end }}
{{- if Eq .Kind Kinds.Union }}{{ template "NaturalTypeAlias" . }}{{- end }}
{{- end }}
{{- /* Constants are global variables; declare them instead. */}}
{{- range .Decls }}
{{- if Eq .Kind Kinds.Const }}{{ template "ConstDeclaration" . }}{{- end }}
{{- end }}
{{- end }}
{{ "" }}
{{ EndOfFile }}
{{ end }}