%3 ::nx::Object ::nx::Object __default_accessor __default_method_call_protection __object_configureparameter __resolve_method_path contains copy delete object method delete object property delete object variable destroy_on_cleanup info info info lookup parameters info lookup slots info lookup syntax info lookup variables info object method args info object method body info object method callprotection info object method debug info object method definition info object method definitionhandle info object method deprecated info object method exists info object method handle info object method origin info object method parameters info object method registrationhandle info object method returns info object method submethods info object method syntax info object method type info object slots info object variables info variable definition info variable name info variable parameter move object alias object forward object method object property object variable private protected public qn require namespace require object method require private object method require protected object method require public object method serialize ::nx::Class ::nx::Class __class_configureparameter alias delete method delete property delete variable filters forward info info info method args info method body info method callprotection info method debug info method definition info method definitionhandle info method deprecated info method exists info method handle info method origin info method parameters info method registrationhandle info method returns info method submethods info method syntax info method type info slots info variables method mixins property require method require private method require protected method require public method unknown variable ::nx::Class->::nx::Object ::xotcl::package ::xotcl::package → contains → create → extend → import → present → require → unknown → verbose ::xotcl::package->::nx::Class ::nx::MetaSlot ::nx::MetaSlot → createFromParameterSpec → optionsToValueCheckingSpec → parseParameterSpec → requireClass → substDefaultOptions ::nx::MetaSlot->::nx::Class ::xotcl::MetaSlot ::xotcl::MetaSlot init instproc proc ::xotcl::MetaSlot->::nx::MetaSlot

Class ::nx::Class

::nx::Class[i] create ...

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::nx::Object[i]
  • subclass: ::xotcl::package[i], ::nx::MetaSlot[i]
::nx::Class create ::nx::Class \
     -superclass ::nx::Object

Methods (to be applied on instances)

  • alias (scripted)

    set pathData  [:__resolve_method_path $methodName]
    set object [dict get $pathData object]
    
    #puts "class alias $object.[dict get $pathData methodName] $cmd"
    set r [::nsf::method::alias $object [dict get $pathData methodName] -frame $frame $cmd]
    ::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
  • create (alias)

  • delete method (scripted)

    ::nsf::method::delete [self$name
  • delete property (scripted)

    set slot [:info slots $name]
    if {$slot eq ""} {
          return -code error "[self]: cannot delete property '$name'"
    }
    $slot destroy
  • delete variable (scripted)

    set slot [:info slots $name]
    if {$slot eq ""} {
          return -code error "[self]: cannot delete variable '$name'"
    }
    $slot destroy
  • filters (forward)

  • forward (scripted)

    set pathData  [:__resolve_method_path $methodName]
    set arguments [lrange [::nsf::current args] 1 end]
    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]}]
      # search for "-returns" in the arguments before $args and remove it
      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 [dict get $pathData methodName] {*}$arguments]
    
    ::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
  • info filters (alias)

  • info heritage (alias)

  • info info (scripted)

    ::nx::internal::infoOptions -asList=$asList ::nx::Class::slot::__info [next {info -asList}]
  • info instances (alias)

  • info method args (scripted)

    : ::nsf::methods::class::info::method args $name
  • info method body (scripted)

    : ::nsf::methods::class::info::method body $name
  • info method callprotection (scripted)

    if {[::nsf::method::property [self$name call-protected]} {
      return protected
    } elseif {[::nsf::method::property [self$name call-private]} {
      return private
    } else {
      return public
    }
  • info method debug (scripted)

    ::nsf::method::property [self$name debug
  • info method definition (scripted)

    : ::nsf::methods::class::info::method definition $name
  • info method definitionhandle (scripted)

    : ::nsf::methods::class::info::method definitionhandle $name
  • info method deprecated (scripted)

    ::nsf::method::property [self$name deprecated
  • info method exists (scripted)

    : ::nsf::methods::class::info::method exists $name
  • info method handle (scripted)

    : ::nsf::methods::class::info::method definitionhandle $name
  • info method origin (scripted)

    : ::nsf::methods::class::info::method origin $name
  • info method parameters (scripted)

    set defs [: ::nsf::methods::class::info::method parameter $name]
    if {[info exists pattern]} {return [::nsf::parameter::filter $defs $pattern]}
    return $defs
  • info method registrationhandle (scripted)

    : ::nsf::methods::class::info::method registrationhandle $name
  • info method returns (scripted)

    : ::nsf::methods::class::info::method returns $name
  • info method submethods (scripted)

    : ::nsf::methods::class::info::method submethods $name
  • info method syntax (scripted)

    return [string trimright "/cls/ [namespace tail $name] [: ::nsf::methods::class::info::method syntax $name]" { }]
  • info method type (scripted)

    : ::nsf::methods::class::info::method type $name
  • info methods (alias)

  • info mixinof (alias)

  • info mixins (alias)

  • info slots (scripted)

    set cmd [list ::nsf::methods::class::info::slotobjects -type $type]
    if {[info exists source]} {lappend cmd -source $source}
    if {$closure} {lappend cmd -closure}
    if {[info exists pattern]} {lappend cmd $pattern}
    return [: {*}$cmd]
  • info subclasses (alias)

  • info superclasses (alias)

  • info variables (scripted)

    set cmd {info slots -type ::nx::VariableSlot}
    if {[info exists pattern]} {lappend cmd $pattern}
    return [: {*}$cmd]
  • method (scripted)

    set p [:__resolve_method_path $name]
    set p [dict filter $p script {k v} {expr {$k in {object regObject methodName}}}]
    dict with p {
      #puts "class method $object.$methodName [list $arguments] {...}"
      set r [::nsf::method::create $object  -checkalways=$checkalways  {*}[expr {$regObject ne "" ? "-reg-object [list $regObject]" : ""}]  $methodName $arguments $body]
      if {$r ne ""} {
        # the method was not deleted
        ::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)

  • new (alias)

  • property (scripted)

    if {$accessor eq ""} {
      set accessor [::nsf::dispatch [self] __default_accessor]
    }
    set traceSpec [expr {[info exists trace] ? [list -trace $trace] : ""}]
    
    set r [[self] ::nsf::classes::nx::Class::variable  -accessor $accessor  -incremental=$incremental  -class $class  -configurable $configurable  -initblock $initblock  {*}$traceSpec  {*}$spec]
    return $r
  • require method (scripted)

    return [::nsf::method::require [::nsf::self$methodName 0]
  • require private method (scripted)

    set result [:require method $methodName]
    ::nsf::method::property [self$result call-private true
    return $result
  • require protected method (scripted)

    set result [:require method $methodName]
    ::nsf::method::property [self$result call-protected true
    return $result
  • require public method (scripted)

    set result [:require method $methodName]
    ::nsf::method::property [self$result call-protected false
    return $result
  • variable (scripted)

    set defaultopts [list -accessor $accessor -configurable $configurable]
    if {[info exists trace]} {
      foreach t $trace {
        if {$t ni {none get set default}} {
          return -code error "invalid value '$t' for trace: '$trace'"
        }
      }
      lappend defaultopts -trace $trace
    }
    
    lassign [::nx::MetaSlot parseParameterSpec -class $class -target [self$spec]  pname parameterOptions _ options
    
    if {[info exists defaultValue]
        && [dict exists $options -substdefault]
        && [string match {*\[*\]*} $defaultValue]
        && ![info complete $defaultValue]
      } {
      return -code error "substdefault: default '$defaultValue' is not a complete script"
    }
    
    set slot [::nx::MetaSlot createFromParameterSpec [::nsf::self]  -class $class  -initblock $initblock  -incremental=$incremental  -private=[expr {$accessor eq "private"}]  -defaultopts $defaultopts  $spec  {*}[expr {[info exists defaultValue] ? [list $defaultValue] : ""}]]
    if {[$slot eval {info exists :settername}]} {
      set name [$slot cget -settername]
    } else {
      set name [$slot cget -name]
    }
    #puts stderr handle=[::nsf::directdispatch [self] ::nsf::methods::class::info::method registrationhandle $name]
    return [::nsf::directdispatch [self] ::nsf::methods::class::info::method registrationhandle $name]