- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::nx::ObjectParameterSlot
::nx::ObjectParameterSlot create ...
Class Relations
- class: ::nx::MetaSlot
- superclass: ::nx::Slot
- subclass: ::nx::VariableSlot, ::nx::RelationSlot, ::nx::BootStrapVariableSlot
::nx::MetaSlot create ::nx::ObjectParameterSlot \ -superclass ::nx::SlotMethods (to be applied on instances)
definition (scripted)
set options [:getParameterOptions -withMultiplicity true] if {[info exists :positional]} {lappend options positional} #if {!${:configurable}} {lappend options noconfig} return [:getPropertyDefinitionOptions [:namedParameterSpec -map-private "" ${:name} $options]]destroy (scripted)
if {[info exists :domain] && ${:domain} ne ""} { # # When slot objects are destroyed, flush the parameter cache and # delete the accessors # #puts stderr "*** slot destroy of [self], domain ${:domain} per-object ${:per-object}" if {${:per-object}} { ::nsf::parameter::cache::objectinvalidate ${:domain} if {[${:domain} ::nsf::methods::object::info::method exists ${:name}]} { ::nsf::method::delete ${:domain} -per-object ${:name} } } elseif {[::nsf::is class ${:domain}]} { ::nsf::parameter::cache::classinvalidate ${:domain} if {[${:domain} ::nsf::methods::class::info::method exists ${:name}]} { ::nsf::method::delete ${:domain} ${:name} } } else { nsf::log Warning "ignore improper domain ${:domain} during destroy (maybe per-object not set?)" } } ::nsf::nextgetParameterSpec (scripted)
if {![info exists :parameterSpec]} { set prefix [expr {[info exists :positional] && ${:positional} ? "" : "-"}] set options [:getParameterOptions -withMultiplicity true -forObjectParameter true] if {[info exists :initblock]} { if {[info exists :default]} { if {[llength $options] > 0} { # # In case the parameter options contain a "slotset", this # would not be allowed by nsf::is. Therefore, we # remove this option before testing (we are already in the # slot object). # set p [lsearch -exact $options "slotset" ] if {$p > -1} { set check_options [lreplace $options $p $p] } else { set check_options $options } ::nsf::is -complain [join $check_options ,] ${:default} #puts stderr "::nsf::is -complain [join $options ,] ${:default} ==> OK" } append initblock "\n::nsf::var::set \[::nsf::self\] ${:name} [list ${:default}]\n" #puts stderr ================append-default-to-initblock-old=<${:initblock}> } lappend options initcmd append initblock ${:initblock} set :parameterSpec [list [:namedParameterSpec $prefix ${:name} $options] $initblock] } elseif {[info exists :default]} { set :parameterSpec [list [:namedParameterSpec $prefix ${:name} $options] ${:default}] } else { set :parameterSpec [list [:namedParameterSpec $prefix ${:name} $options]] } } #puts stderr [self]================${:parameterSpec} return ${:parameterSpec}getPropertyDefinitionOptions (scripted)
set mod [expr {${:per-object} ? "object" : ""}] set opts "" if {${:configurable}} { lappend opts -accessor ${:accessor} if {${:incremental}} {lappend opts -incremental} if {[info exists :default]} { return [list ${:domain} {*}$mod property {*}$opts [list $parameterSpec ${:default}]] } set methodName property } else { lappend opts -accessor ${:accessor} if {${:configurable}} {lappend opts -configurable true} if {[info exists :default]} { return [list ${:domain} {*}$mod variable {*}$opts $parameterSpec ${:default}] } set methodName variable } return [list ${:domain} {*}$mod $methodName {*}$opts $parameterSpec]onError (scripted)
puts stderr "==== DEBUG AppVeyor behavior <$cmd> <$msg>" if {[string match "%1 requires argument*" $msg]} { set template {wrong # args: use \"$cmd [join $methods |]\"} } elseif {[string match "*unknown for slot*" $msg]} { lassign $cmd slot calledMethod obj . regexp {=(.*)$} $calledMethod . calledMethod regexp {::([^:]+)$} $slot . slot set template {submethod $calledMethod undefined for $slot: use \"$obj $slot [join $methods |]\"} } if {[info exists template]} { set methods "" foreach m [lsort [:info lookup methods -callprotection public value=*]] { lappend methods [lindex [split $m =] end] } return -code error [subst $template] } return -code error $msg
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables