Index: TODO =================================================================== diff -u -reaf3e9fdf5dd9b17e58f4d31e9c6a43e0cf907e7 -ra74bd5cdede9d48d0a225a27e1d710a7189b65d1 --- TODO (.../TODO) (revision eaf3e9fdf5dd9b17e58f4d31e9c6a43e0cf907e7) +++ TODO (.../TODO) (revision a74bd5cdede9d48d0a225a27e1d710a7189b65d1) @@ -12,7 +12,7 @@ - as collateral damage, parts of the regression test don't work currently -- added refounting in ObjectDispatch() to make sure, obj survives until +- added refcounting in ObjectDispatch() to make sure, obj survives until the end of the function - added existence test for slot extractor (needed for 8.5.8) @@ -1591,6 +1591,10 @@ - fix potential crash in ::nx::Object info method definition ::nsf::methods::object::instvar +- "info method submethods": return all submethods, independent + from protection +- serializer: experimental code to serialize submethods + TODO: - handing of xo::at_cleanup in serializer (either generailization or move to OpenACS/aolserver init/naviserver init) Index: library/serialize/serializer.tcl =================================================================== diff -u -r39e9833e7aed8f7c61300b9123f2ffdcddbde0fc -ra74bd5cdede9d48d0a225a27e1d710a7189b65d1 --- library/serialize/serializer.tcl (.../serializer.tcl) (revision 39e9833e7aed8f7c61300b9123f2ffdcddbde0fc) +++ library/serialize/serializer.tcl (.../serializer.tcl) (revision a74bd5cdede9d48d0a225a27e1d710a7189b65d1) @@ -610,6 +610,36 @@ return [:[:classify $x]-needsNothing $x $s] } + :method submethods {x where name} { + set methods [list] + set submethods [$x ::nsf::methods::${where}::info::method submethods $name] + #puts stderr "subm of $x $where $name => $submethods" + if {[llength $submethods] == 0} { + # no submethods, therefore we have a leaf method + lappend methods $name + } else { + foreach m $submethods { + lappend methods {*}[:submethods $x $where "$name $m"] + } + } + return $methods + } + + :method ensembleMethods {x where} { + # todo: don't check for name "slot" + if {[$x ::nsf::methods::object::info::hastype ::nx::EnsembleObject] || [namespace tail $x] eq "slot"} { + # don't return the ensemble objects as ensembleMethods + return [list] + } + set methods [list] + foreach m [$x ::nsf::methods::${where}::info::methods -methodtype object -callprotection all] { + if {$m eq "slot"} continue + lappend methods {*}[:submethods $x $where $m] + } + #puts stderr "ensembleMethods for $x $where $methods" + return $methods + } + :method alias-dependency {x where} { set handle :alias_dependency($x,$where) if {[info exists $handle]} { @@ -702,6 +732,10 @@ ############################### :method Object-serialize {o s} { + if {[$o ::nsf::methods::object::info::hastype ::nx::EnsembleObject]} { + return "" + } + :collect-var-traces $o $s append cmd [list [$o info class] create \ [::nsf::dispatch $o -objscope ::nsf::current object]] @@ -710,6 +744,10 @@ foreach i [lsort [$o ::nsf::methods::object::info::methods -callprotection all]] { append cmd [:method-serialize $o $i "class-object"] "\n" } + foreach i [:ensembleMethods $o object] { + append cmd [:method-serialize $o $i "class-object"] "\n" + } + set vars [:collectVars $o] if {[llength $vars]>0} {append cmd [list $o eval [join $vars "\n "]]\n} @@ -737,6 +775,10 @@ foreach i [lsort [$o ::nsf::methods::class::info::methods -callprotection all]] { append cmd [:method-serialize $o $i ""] "\n" } + foreach i [:ensembleMethods $o class] { + append cmd [:method-serialize $o $i ""] "\n" + } + append cmd \ [:frameWorkCmd ::nsf::relation $o superclass -unless ${:rootClass}] \ [:frameWorkCmd ::nsf::relation $o class-mixin] \