::xotcl
Class Class

Heritage:
::xotcl::Object
Direct Known Subclasses:
::xotcl::Class::Parameter, ::xox::ParseArgs, ::xox::test::B, ::xox::test::B1, ::xox::test::D, ::xox::test::D1, ::xox::test::F, ::xox::test::F1,

Class Class
superclass ::xotcl::Object,
Class is a meta-class that creates new classes.
 To make a new class use:

 Class YourClass

 You can then make instances from that class.

 set someInstance [YourClass new ]

 To make a new meta-class use:

 Class SingletonClass -superclass Class

 SingletonClass instproc getInstance { } {

     return [ my new ]
 }

 This can then be used to make new classes with special
 properties. 

 SingletonClass Server

 This can then be used to make new instances:

 set instance [ Server getInstance ]
Variables
NameDefault ValueClassComment
version    ::xotcl::Class
 
 
Methods
NameComment
allinstances {}  
classParameter {variable}  
classParameterArray {variable}  
id {{id ""}}  
instfilterappend {f}  
instmixinappend {m}  
insttclcmd {t}  
   
Methods from ::xotcl::Object
#, ., ?, ?code, ?methods, ?object, abstract, copy, coverageFilter, defaultmethod, extractConfigureArg, filterappend, get#, getClean#, hasclass, init, methodTag, mixinappend, move, profileFilter, self, setParameterDefaults, shell, tclcmd, traceFilter,
 
Instproc Detail

allinstances

Description:
 
Code:
  ::xotcl::Class instproc allinstances {}  {
   
set set [::xotcl::my info instances]
foreach sc [::xotcl::my info subclass] {
eval lappend set [$sc allinstances]}
return $set
}

classParameter

Description:
 
Arguments:
Code:
  ::xotcl::Class instproc classParameter {variable}  {
   

        my instproc $variable "{ $variable \"\" }" "

        if { \"\" == \"\$$variable\" } {

            if { ! \[ my exists $variable \] } {

                set classList \[ my info class \]

                set classList \[ concat \$classList \[ \$classList info heritage \] \]

                foreach class \$classList {

                    if \[ \$class exists $variable \] {

                        return \[ \$class set $variable \]
                    }
                }

                error \"Could not find $variable in any of \$classList!\"

            } else {

                return \[ my set $variable \]
            }
        }
            
        if { \"\" == \"\$$variable\" } { return \[ my set $variable \] }

        return \[ my set $variable \$$variable \]
    "

    
}

classParameterArray

Description:
 
Arguments:
Code:
  ::xotcl::Class instproc classParameterArray {variable}  {
   

        my instproc $variable " index { $variable \"\" }" "

        if { \"\" == \"\$$variable\" } {

            if { ! \[ my exists ${variable}(\$index) \] } {

                set classList \[ my info class \]

                set classList \[ concat \$classList \[ \$classList info heritage \] \]

                foreach class \$classList {

                    if \[ \$class exists ${variable}(\$index) \] {

                        return \[ \$class set ${variable}(\$index) \]
                    }
                }

                error \"Could not find $variable in any of \$classList!\"

            } else {

                return \[ my set ${variable}(\$index) \]
            }
        }
            
        if { \"\" == \"\$$variable\" } { return \[ my set ${variable}(\$index) \] }

        return \[ my set ${variable}(\$index) \$$variable \]
    "
    
}

id

Description:
 
Arguments:
Code:
  ::xotcl::Class instproc id {{id ""}}  {
   

        if { "$id" == "" } { return [ my set id ] }

        my set id $id
        my set version [lindex [regexp -inline {Id: \S+ (\S+) } [ my id ] ] 1]
    
}

instfilterappend

Description:
 
Arguments:
Code:
  ::xotcl::Class instproc instfilterappend {f}  {
   
set cmd [list [::xotcl::self] instfilter add $f end]
puts stderr "the method [::xotcl::self proc] is deprecated; use instead '$cmd'"
eval $cmd
}

instmixinappend

Description:
 
Arguments:
Code:
  ::xotcl::Class instproc instmixinappend {m}  {
   
set cmd [list [::xotcl::self] instmixin add $m end]
puts stderr "the method [::xotcl::self proc] is deprecated; use instead '$cmd'"
eval $cmd
}

insttclcmd

Description:
 
Arguments:
Code:
  ::xotcl::Class instproc insttclcmd {t}  {
   
set cmd [list [::xotcl::self] instforward $t -objscope]
puts stderr "the method [::xotcl::self proc] is deprecated; use instead '$cmd'"
eval $cmd
}