Skip to content

Commit 83da0d1

Browse files
committed
Document type Metamodel::Finalization
1 parent cd38114 commit 83da0d1

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

lib/Type/Metamodel/Finalization.pod

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
=begin pod
2+
3+
X<DESTROY>
4+
5+
=TITLE role Metamodel::Finalization
6+
7+
=SUBTITLE Metamodel role for finalization / destroyer method
8+
9+
role Metamodel::Finalization { ... }
10+
11+
This role takes care that C<DESTROY> submethods are called (if they exist)
12+
when an object is garbage-collected.
13+
14+
=head1 Methods
15+
16+
=head2 method setup_finalization
17+
18+
method setup_finalization(Metamodel::Finalization:D: $obj)
19+
20+
Collects the C<DESTROY> submethods from this class and all its superclasses,
21+
and marks the class as needing action on garbage collection.
22+
23+
A metamodel for a kind that implements finalization semantics must call this method
24+
at type composition time.
25+
26+
=head2 method destroyers
27+
28+
method destroyers(Metamodel::Finalization:D: $obj) returns List:D
29+
30+
Returns a list of all finalization methods.
31+
32+
=end pod

0 commit comments

Comments
 (0)