DocBook 5.2: The Definitive Guide  (Version 5.2.6 for DocBook 5.2b09a)

V5.2templateid

templateid — The identifier for a template, in the generic programming sense.

Synopsis

templateid ::= [-]

Description

A templateid, as the name implies, is an identifier for a template. For example, a template in a programming language.

Processing expectations

Formatted inline.

Children

The following elements occur in templateid: text, abbrev, acronym, alt, anchor, annotation, biblioref, coref, date, emphasis (db._emphasis), firstterm (db._firstterm), footnote, footnoteref, foreignphrase (db._foreignphrase), glossterm (db._glossterm), indexterm (db.indexterm.endofrange), indexterm (db.indexterm.singular), indexterm (db.indexterm.startofrange), inlinemediaobject, link, olink, phrase (db._phrase), quote (db._quote), remark, replaceable, subscript, superscript, trademark, wordasword, xref.

Examples

<article xmlns='http://docbook.org/ns/docbook'
         xmlns:xlink="http://www.w3.org/1999/xlink"
         version="5.2">
<title>Java generics</title>

<para>An example inspired by
<link xlink:href="https://docs.julialang.org/en/v1/manual/types/index.html#Parametric-Types-1">Julia’s documentation</link>.</para>
    
<classsynopsis>
  <classname>Point</classname>
  <template>
    <templateid>T</templateid>
  </template>
        
  <fieldsynopsis>
    <templateid>T</templateid>
    <varname>x</varname>
  </fieldsynopsis>
        
  <fieldsynopsis>
    <templateid>T</templateid>
    <varname>y</varname>
  </fieldsynopsis>
        
  <para>Class Point.</para>
</classsynopsis>
    
<classsynopsis>
  <classname>Point</classname>
  <template>
    <specializedtemplate>Float64</specializedtemplate>
  </template>
        
  <fieldsynopsis>
    <type>Float64</type>
    <varname>x</varname>
  </fieldsynopsis>
        
  <fieldsynopsis>
    <type>Float64</type>
    <varname>y</varname>
  </fieldsynopsis>
        
  <para>Specialized class Point.</para>
</classsynopsis>
    
<methodsynopsis>
  <methodname>translate_point</methodname>
  <methodparam>
    <type>
      <classname>Point</classname>{<templateid>T</templateid>}
    </type>
    <parameter>p</parameter>
  </methodparam>
  <template>
    where <templateid>T</templateid>
  </template>
</methodsynopsis>
</article>

An example inspired by Julia’s documentation.

 {
  T;
  T;
}
 {
  Float64 ;
  Float64 ;
}
translate_point( Point{T}  p);