Called in |
Picture::output(). It determines whether a
Shape can be output. If it can, and an
for the type of the
Shape exists, a
containing a pointer to the
Shape is returned.
On the other
hand, it is possible to define a type derived from
output() function of its own, and not derived from a type that
has one. It may then consist of one or more objects of types that do
output() functions. In this case, the
extract() will contain pointers to all of these
Picture::output() will treat them
as independent objects. In particular, if any one of them cannot be
projected using the arguments passed to
will have no effect on whether the others are outputted or not.
Currently, there are no
Shapes without an
function, either belonging to the class, or inherited. However, it's
useful to be able to define
Shapes in this way, so that they can
be tested without having to define an
output() function first.