File: utility.yo

package info (click to toggle)
c%2B%2B-annotations 13.02.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,576 kB
  • sloc: cpp: 25,297; makefile: 1,523; ansic: 165; sh: 126; perl: 90; fortran: 27
file content (31 lines) | stat: -rw-r--r-- 1,662 bytes parent folder | download | duplicates (2)
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
The tt(Math:Utility) partition is the most basic of the two tt(Math)
partitions. It does not depend on features of either the tt(Math) module or
the tt(Math:Add) partition. Since it em(does) use the tt(size_t) type, it
specifies tt(export import <cstddef>). Here, because of its tt(export)
specification, the definitions in tt(cstddef) are also available when
tt(Utility) is imported, and since the tt(Math) module itself exports
tt(:Utility) also to software importing tt(Math).

As tt(Utility) is a tt(Math) partition its partition interface unit starts by
specifing this:
    verb(    export module Math:Utility;)
    The colon indicates that this is not a plain module but a partition (note
that the first line em(must) start by specifying tt(export)). It contains
em(only) non-exported components, but as it's a partition of a module, all the
partition's components are fully available to its module and its sibling
partitions. Its tt(class Utility) has two simple members, both very simple,
never changing one-liners. Because of that they're implemented in-line. Here's
the tt(Utility) partition interface unit:
    verbinsert(-as4 examples/partition/math/utility/modutility.cc)

Defining members inline is not required, but is an option. For example, its
constructor could very well also have been defined inline, but (for
illustration purposes) is defined in a separate source file. As tt(Utility's)
constructor is a partition source file it starts by specifying its module
(tt(Math)), followed by importing the partition component (tt(:Utility)) which
is defined in this source file:
    verbinsert(-as4 examples/partition/math/utility/utility1.cc)