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
|
Modules and partitions usually their components in separate source files. The
initial lines of those source files are identical: they specify the module or
the partition to which they belong. Since these source files do not include
(internal) header files, they may also declare namespaces. E.g., the member
implementations of the tt(Math:Add) partition (cf. section ref(PARTITIONS))
all start with
verb( module Math;
import :Add;
)
Since the tt(Math:Add) partition interface unit declares a tt(class Add)
most or all of its source files implement a member of tt(class Add). In these
cases it's convenient to have a predefined tt(frame) file containing the
essential elements of its source files. E.g., for tt(Math::Add) sources this
could be
verb( module Math;
import :Add;
using namespace std;
void Add::()
{
}
)
When implementing a member copy the tt(frame) to the intended source file,
specify the member's name, define its body and maybe change its return type.
|