object - Online Linux Manual PageSection : n
Updated : 0.1
Source : TclOO
Note : TclOO Commands


NAMEoo::object − root class of the class hierarchy

SYNOPSISpackage require TclOO oo::object method ?arg ...?

CLASS HIERARCHYoo::object .\}

DESCRIPTIONThe oo::object class is the root class of the object hierarchy; every object is an instance of this class. Since classes are themselves objects, they are instances of this class too. Objects are always referred to by their name, and may be renamed while maintaining their identity. Instances of objects may be made with either the create or new methods of the oo::object object itself, or by invoking those methods on any of the subclass objects; see oo::class for more details. The configuration of individual objects (i.e., instance-specific methods, mixed-in classes, etc.) may be controlled with the oo::objdefine command. Each object has a unique namespace associated with it, the instance namespace. This namespace holds all the instance variables of the object, and will be the current namespace whenever a method of the object is invoked (including a method of the class of the object). When the object is destroyed, its instance namespace is deleted. The instance namespace contains the object's my command, which may be used to invoke non-exported methods of the object or to create a reference to the object for the purpose of invocation which persists across renamings of the object.

CONSTRUCTORThe oo::object class does not define an explicit constructor.

DESTRUCTORThe oo::object class does not define an explicit destructor.

EXPORTED METHODSThe oo::object class supports the following exported methods: obj destroy   This method destroys the object, obj, that it is invoked upon, invoking any destructors on the object's class in the process. It is equivalent to using rename to delete the object command. The result of this method is always the empty string.

NON-EXPORTED METHODSThe oo::object class supports the following non-exported methods: obj eval ?arg ...?   This method concatenates the arguments, arg, as if with concat, and then evaluates the resulting script in the namespace that is uniquely associated with obj, returning the result of the evaluation. obj unknown ?methodName? ?arg ...?   This method is called when an attempt to invoke the method methodName on object obj fails. The arguments that the user supplied to the method are given as arg arguments. If methodName is absent, the object was invoked with no method name at all (or any other arguments). \{.ev 2 .\} The default implementation (i.e., the one defined by the oo::object class) generates a suitable error, detailing what methods the object supports given whether the object was invoked by its public name or through the my command. obj variable ?varName ...?   This method arranges for each variable called varName to be linked from the object obj's unique namespace into the caller's context. Thus, if it is invoked from inside a procedure then the namespace variable in the object is linked to the local variable in the procedure. Each varName argument must not have any namespace separators in it. The result is the empty string. obj varname varName   This method returns the globally qualified name of the variable varName in the unique namespace for the object obj. obj <cloned> sourceObjectName  This method is used by the oo::object command to copy the state of one object to another. It is responsible for copying the procedures and variables of the namespace of the source object (sourceObjectName) to the current object. It does not copy any other types of commands or any traces on the variables; that can be added if desired by overriding this method in a subclass. \{.ev 2 .\}

EXAMPLESThis example demonstrates basic use of an object. set obj [oo::object new] $obj foo → error "unknown method foo" oo::objdefine $obj method foo {} { my variable count puts "bar[incr count]" } $obj foo → prints "bar1" $obj foo → prints "bar2" $obj variable count → error "unknown method variable" $obj destroy $obj foo → error "unknown command obj"

SEE ALSOmy(n), oo::class(n)

KEYWORDSbase class, class, object, root class
0
Johanes Gumabo
Data Size   :   16,644 byte
man-oo_object.nBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 198,366
Visitor ID   :     :  
Visitor IP   :   18.219.107.243   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (rof_escape_sequence_block|26|(null)|(null)|-1|139)         (parse_manual_page_|249|oo_object.n|289/139|══─}─══|.══─}─══ )         (htmlprn|149|oo_object.n|289/139|.══─}─══|.══─}─══ )         (rof_escape_sequence|91|oo_object.n|289/140|\}|.\} )         (parse_manual_page_|249|oo_object.n|289/140|\}|.\} )         (rof_escape_sequence|91|oo_object.n|342/157/342/158|\{.ev 2 |\{.ev 2 )         (rof_escape_sequence|91|oo_object.n|342/166|\} |.\} )         (parse_manual_page_|249|oo_object.n|342/166|\}|.\} )         (rof_escape_sequence|91|oo_object.n|369/157/369/158|\{.ev 2 |\{.ev 2 )         (rof_escape_sequence|91|oo_object.n|369/166|\} |.\} )         (parse_manual_page_|249|oo_object.n|369/166|\}|.\} )