1 # vim: ft=tcl foldmethod=marker foldmarker=<<<,>>> ts=4 shiftwidth=4
3 class tlc
::Refcounted {
8 method object_registry
{varname
}
15 method autoscoperef
{}
22 method clear_registry
{}
27 body tlc
::Refcounted::constructor {} { #<<<
31 body tlc
::Refcounted::destructor {} { #<<<
36 body tlc
::Refcounted::autoscoperef {} { #<<<
37 #puts stderr "Refcounted::constructor callstack: [tlc::stackdump]"
38 upvar 2 _mware_msg_scoperef_
[string map
{:: //} $this] scopevar
40 trace variable scopevar u
[code
$this decref
]
44 body tlc
::Refcounted::incref {args
} { #<<<
47 #puts stderr "$this: refcount $old -> $refcount ($args)"
51 body tlc
::Refcounted::decref {args
} { #<<<
54 #puts stderr "$this: refcount $old -> $refcount ($args)"
56 #puts stderr "$this: our time has come"
63 body tlc
::Refcounted::refcount {} { #<<<
68 body tlc
::Refcounted::object_registry {varname
} { #<<<
71 set registry_var
$varname
72 upvar $registry_var var_ref
78 body tlc
::Refcounted::clear_registry {} { #<<<
79 if {[info exists registry_var
]} {
80 upvar $registry_var old_registry
81 if {[info exists old_registry
]} {