Class ::nx::serializer::ObjectSystemSerializer

::nx::serializer::ObjectSystemSerializer[i] create ...

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::nx::Object[i]
::nx::Class create ::nx::serializer::ObjectSystemSerializer \
     -superclass ::nx::Object

Methods (to be applied on instances)

  • getExported (scripted)

    foreach k [Serializer exportedMethods] {
      lassign $k o p m
      if {![::nsf::object::exists $o]} {
        :warn "$o is not an object"
      } elseif {[::nsf::dispatch $o ::nsf::methods::object::info::hastype ${:rootClass}]} {
        set :exportMethods($k) 1
      }
    }
    foreach o [Serializer exportedObjects] {
      if {![::nsf::object::exists $o]} {
        :warn "$o is not an object"
      } elseif {[nsf::dispatch $o ::nsf::methods::object::info::hastype ${:rootClass}]} {
        set :exportObjects($o) 1
      }
    }
    foreach p [array names :ignorePattern] {Serializer addPattern $p}
  • instances (scripted)

    set instances [list]
    foreach i [${:rootClass} info instances -closure] {
      if {[:matchesIgnorePattern $i] && ![$s isExportedObject $i]} {
        continue
      }
      $s setObjectSystemSerializer $i [::nsf::current object]
      lappend instances $i
    }
    #:warn "[::nsf::current object] handles instances: $instances"
    return $instances
  • list_instances (scripted)

    set instances [list]
    foreach i [${:rootClass} info instances -closure] {
      if {[:matchesIgnorePattern $i]} {
        continue
      }
      lappend instances $i
    }
    #:warn "[::nsf::current object] handles instances: $instances"
    return $instances
  • needsNothing (scripted)

    return [:[:classify $x]-needsNothing $x $s]
  • registerSerializer (scripted)

    foreach i $instances {
      if {![::nsf::dispatch $i ::nsf::methods::object::info::hastype ${:rootClass}]} continue
      $s setObjectSystemSerializer $i [::nsf::current object]
    }
  • responsibleSerializer (scripted)

    return [::nsf::dispatch $object ::nsf::methods::object::info::hastype ${:rootClass}]
  • serialize (scripted)

    set :targetName [$s getTargetName $objectOrClass]
    :[:classify $objectOrClass]-serialize $objectOrClass $s
  • serialize-all-end (scripted)

    set cmd ""
    foreach o [list ${:rootClass} ${:rootMetaClass}] {
      append cmd  [:frameWorkCmd ::nsf::relation::get $o object-mixin]  [:frameWorkCmd ::nsf::relation::get $o class-mixin]  [:frameWorkCmd ::nsf::method::assertion $o object-invar]  [:frameWorkCmd ::nsf::method::assertion $o class-invar]
    }
    #puts stderr "*** array unset [nsf::current object] alias_dependency // size [array size :alias_dependency]"
    array unset :alias_dependency
    return $cmd
  • serialize-all-start (scripted)

    :getExported
    return [:serializeExportedMethods $s]