%3 ::nx::MethodParameterSlot ::nx::MethodParameterSlot ::nx::Slot ::nx::Slot exists getParameterOptionSubstdefault istype type=any type=cr_item_of_package type=html type=localurl type=naturalnum type=nohtml type=object_id type=range type=signed type=token ::nx::MethodParameterSlot->::nx::Slot ::nx::ObjectParameterSlot ::nx::ObjectParameterSlot createForwarder definition destroy getParameterOptions getParameterSpec getPropertyDefinitionOptions init makeForwarder namedParameterSpec onError unknown ::nx::ObjectParameterSlot->::nx::Slot ::nx::VariableSlot ::nx::VariableSlot __default_from_cmd __trace_default __trace_get __trace_set checkDefault defineIncrementalOperations getParameterOptions handleTraces init isMultivalued makeAccessor makeIncrementalOperations makeSetter needsForwarder parameter reconfigure removeTraces setCheckedInstVar setterRedefinedOptions value=add value=delete value=exists value=unset ::nx::VariableSlot->::nx::ObjectParameterSlot ::nx::RelationSlot ::nx::RelationSlot delete_value init value=add value=clear value=delete ::nx::RelationSlot->::nx::ObjectParameterSlot ::nx::BootStrapVariableSlot ::nx::BootStrapVariableSlot getParameterSpec init ::nx::BootStrapVariableSlot->::nx::ObjectParameterSlot ::xotcl::Attribute ::xotcl::Attribute __object_configureparameter createForwarder defineIncrementalOperations exists init istype multivalued needsForwarder setterRedefinedOptions ::xotcl::Attribute->::nx::VariableSlot ::xotcl::RelationSlot ::xotcl::RelationSlot ::xotcl::RelationSlot->::nx::RelationSlot

Class ::nx::ObjectParameterSlot

::nx::ObjectParameterSlot[i] create ...

Class Relations

  • class: ::nx::MetaSlot[i]
  • superclass: ::nx::Slot[i]
  • subclass: ::nx::VariableSlot[i], ::nx::RelationSlot[i], ::nx::BootStrapVariableSlot[i]
::nx::MetaSlot create ::nx::ObjectParameterSlot \
     -superclass ::nx::Slot

Methods (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::next
  • getParameterSpec (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