Class Relations
- class: ::nx::EnsembleObject
::nx::EnsembleObject create ::nx::Object::slot::__object
Methods (to be applied on the object)
alias (scripted)
set pathData [:__resolve_method_path -per-object $methodName]
set object [dict get $pathData object]
set r [::nsf::method::alias $object -per-object [dict get $pathData methodName] -frame $frame $cmd]
::nsf::method::property $object -per-object $r call-protected [::nsf::dispatch $object __default_method_call_protection]
if {[info exists returns]} {::nsf::method::property $object $r returns $returns}
if {$debug} {::nsf::method::property $object $r debug true}
if {$deprecated} {::nsf::method::property $object $r deprecated true}
return $r
filters (forward)
forward (scripted)
set arguments [lrange [::nsf::current args] 1 end]
set pathData [:__resolve_method_path -per-object $methodName]
set object [dict get $pathData object]
if {[info exists target] && [string index $target 0] eq "-"} {
error "target '$target' must not start with a dash"
}
if {[info exists frame] && $frame ni {object default}} {
error "value of parameter '-frame' must be 'object' or 'default'"
}
if {[info exists returns]} {
set nrPreArgs [expr {[llength $arguments]-[llength $args]}]
set p [lsearch -exact [lrange $arguments 0 $nrPreArgs] -returns]
if {$p > -1} {set arguments [lreplace $arguments $p $p+1]}
}
set r [::nsf::method::forward $object -per-object [dict get $pathData methodName] {*}$arguments]
::nsf::method::property $object -per-object $r call-protected [::nsf::dispatch $object __default_method_call_protection]
if {[info exists returns]} {::nsf::method::property $object $r returns $returns}
if {$debug} {::nsf::method::property $object $r debug true}
if {$deprecated} {::nsf::method::property $object $r deprecated true}
return $r
method (scripted)
set pathData [:__resolve_method_path -per-object $methodName]
set object [dict get $pathData object]
set regObject [dict get $pathData regObject]
set r [::nsf::method::create $object -checkalways=$checkalways {*}[expr {$regObject ne "" ? "-reg-object [list $regObject]" : ""}] -per-object [dict get $pathData methodName] $arguments $body]
if {$r ne ""} {
::nsf::method::property $object $r call-protected [::nsf::dispatch $object __default_method_call_protection]
if {[info exists returns]} {::nsf::method::property $object $r returns $returns}
if {$debug} {::nsf::method::property $object $r debug true}
if {$deprecated} {::nsf::method::property $object $r deprecated true}
}
return $r
mixins (forward)
property (scripted)
if {$accessor eq ""} {
set accessor [::nsf::dispatch [self] __default_accessor]
}
set traceSpec [expr {[info exists trace] ? [list -trace $trace] : ""}]
set r [[self] object variable -accessor $accessor -incremental=$incremental -class $class -initblock $initblock -configurable $configurable -nocomplain=$nocomplain {*}$traceSpec {*}$spec]
return $r
variable (scripted)
lassign [::nx::MetaSlot parseParameterSpec -class $class -target [self] $spec] name parameterOptions class options
if {[dict exists $options -configurable]} {
set configurable [dict get $options -configurable]
}
if {![info exists trace] && [info exists :trace] && ${:trace} ne "none"} {
set trace ${:trace}
}
if {[info exists defaultValue]
&& [dict exists $options -substdefault]
&& [string match {*\[*\]*} $defaultValue]
} {
if {![info complete $defaultValue]} {
return -code error "substdefault: default '$defaultValue' is not a complete script"
}
set substDefaultOptions [::nx::MetaSlot substDefaultOptions [dict get $options -substdefault]]
set defaultValue [subst {*}$substDefaultOptions $defaultValue]
}
if {$initblock eq ""
&& !$configurable
&& !$incremental
&& $accessor eq "none"
&& ![info exists trace]
} {
set isSwitch [expr {[dict exists $options -type] && [dict get $options -type] eq "switch"}]
if {[info exists defaultValue]} {
if {[info exists :$name] && !$nocomplain} {
return -code error "object [self] has already an instance variable named '$name'"
}
if {$parameterOptions ne ""} {
set nspec [::nx::MetaSlot optionsToValueCheckingSpec $options]
::nsf::is -complain $nspec $defaultValue
} else {
set name $spec
}
set :$name $defaultValue
} elseif {$isSwitch} {
set :$name 0
} else {
return -code error "variable definition for '$name' (without value and accessor) is useless"
}
return
}
set defaultopts [list -accessor $accessor]
if {[info exists trace]} {lappend defaultopts -trace $trace}
set slot [::nx::MetaSlot createFromParameterSpec [self] -per-object -class $class -initblock $initblock -incremental=$incremental -private=[expr {$accessor eq "private"}] -defaultopts $defaultopts $spec {*}[expr {[info exists defaultValue] ? [list $defaultValue] : ""}]]
if {$nocomplain} {$slot eval {set :nocomplain 1}}
if {!$configurable} {$slot eval {set :configurable false}}
if {[info exists defaultValue]} {
set allowpreset [expr {"get" in [$slot cget -trace] && [nsf::var::exists [self] $name]}]
$slot setCheckedInstVar -allowpreset=$allowpreset -nocomplain=$nocomplain [self] $defaultValue
}
if {[$slot eval {info exists :settername}]} {
set name [$slot cget -settername]
} else {
set name [$slot cget -name]
}
return [::nsf::directdispatch [self] ::nsf::methods::object::info::method registrationhandle $name]