summaryrefslogtreecommitdiff
path: root/tools/build/v2/doc/src/typed-target.xml
blob: 2a7d7c98c7aed6958be104a2f3ada30e6e30c41c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE section PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
  "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">

<section id="bbv2.reference.class.typed-target">

  <title>Class typed-target</title>
  <indexterm>
    <primary>typed-target</primary>
  </indexterm>

<programlisting language="jam">
class typed-target : <link linkend="bbv2.reference.class.basic-target">basic-target</link> {
    rule <link linkend="bbv2.reference.class.typed-target.__init__">__init__</link> ( name : project : type : sources * : requirements * : default-build * : usage-requirements * ) 
    rule <link linkend="bbv2.reference.class.typed-target.type">type</link> ( )
    rule <link linkend="bbv2.reference.class.typed-target.construct">construct</link> ( name : source-targets * : property-set )

    # Methods inherited from <link linkend="bbv2.reference.class.abstract-target">abstract-target</link>
    rule <link linkend="bbv2.reference.class.abstract-target.name">name</link> ( )
    rule <link linkend="bbv2.reference.class.abstract-target.project">project</link> ( )
    rule <link linkend="bbv2.reference.class.abstract-target.location">location</link> ( )
    rule <link linkend="bbv2.reference.class.abstract-target.full-name">full-name</link> ( )
    
    # Methods inherited from <link linkend="bbv2.reference.class.basic-target">basic-target</link>
    rule <link linkend="bbv2.reference.class.basic-target.generate">generate</link> ( property-set )
  }
</programlisting>

  <para>
    <link linkend="bbv2.reference.class.typed-target">typed-target</link>
    is the most common kind of target alternative.  Rules for creating
    typed targets are defined automatically for each type.
  </para>

  <orderedlist>

    <listitem id="bbv2.reference.class.typed-target.__init__">
      <code language="jam">rule __init__ ( name : project : type : sources * : requirements * : default-build * : usage-requirements * )</code>
      <para>
        <variablelist>
          <varlistentry>
            <term><literal>name</literal></term>
            <listitem><para>The name of the target</para></listitem>
          </varlistentry>
          <varlistentry>
            <term><literal>project</literal></term>
            <listitem>
              <para>
                The <link linkend="bbv2.reference.class.project-target">project</link>
                in which the target is declared.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term><literal>type</literal></term>
            <listitem>
              <para>
                The <link linkend="bbv2.reference.modules.type">type</link>
                of the target.
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </para>
    </listitem>

    <listitem id="bbv2.reference.class.typed-target.type">
      <indexterm zone="bbv2.reference.class.typed-target.type">
        <primary>type</primary>
        <secondary>Typed Target Method</secondary>
      </indexterm>
      <code language="jam">rule type ( )</code>
      <para>
        Returns the <link linkend="bbv2.reference.modules.type">type</link>
        of the target.
      </para>
    </listitem>

    <listitem id="bbv2.reference.class.typed-target.construct">
      <indexterm zone="bbv2.reference.class.typed-target.construct">
        <primary>construct</primary>
        <secondary>Typed Target Method</secondary>
      </indexterm>
      <code language="jam">rule construct ( name : source-targets * : property-set )</code>
      <para>
        Implements <link linkend="bbv2.reference.class.basic-target.construct">
        basic-target.construct</link>.  Attempts to create a target of
        the correct type using generators appropriate for the given
        <link linkend="bbv2.reference.class.property-set">property-set</link>.
        Returns a <link linkend="bbv2.reference.class.property-set">
        property-set</link> containing the usage requirements
        and a list of virtual targets.
        
        <note>
          <para>
            This function is invoked automatically by
            <link linkend="bbv2.reference.class.basic-target.generate">basic-target.generate</link>
            and should not be called directly by users.
          </para>
        </note>
      </para>
    </listitem>
    
  </orderedlist>
  
</section>