blob: 7e53c2908779467afa680478a9a31b2f2f0524d3 (
plain)
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
32
|
###
# A special class of objects that
# stores no meta data of its own
# Instead it vampires off of the master object
###
tool::class create ::tool::organelle {
constructor {master} {
my entangle $master
set final_class [my select]
if {[info commands $final_class] ne {}} {
# Safe to switch class here, we haven't initialized anything
oo::objdefine [self] class $final_class
}
my initialize
}
method entangle {master} {
my graft master $master
my forward meta $master meta
foreach {stub organ} [$master organ] {
my graft $stub $organ
}
foreach {methodname variable} [my meta branchget array_ensemble] {
my forward $methodname $master $methodname
}
}
method select {} {
return {}
}
}
|