Manual Pages for UNIX Darwin command on man stooop
MyWebUniversity

Manual Pages for UNIX Darwin command on man stooop

stooop(n) Simple Tcl Only Object Oriented Programming stooop(n)

NAME

stooop - Object oriented extension.

SYNOPSIS

package require TTccll 88..33 package require ssttoooooopp ??44..44..11?? ::::ssttoooooopp::::ccllaassss name body ::::ssttoooooopp::::nneeww class ?arg arg ...? ::::ssttoooooopp::::ddeelleettee object ?object ...? ::::ssttoooooopp::::vviirrttuuaall pprroocc name {tthhiiss ?arg arg ...?} ?body? ::::ssttoooooopp::::ccllaassssooff object ::::ssttoooooopp::::nneeww object ::::ssttoooooopp::::pprriinnttOObbjjeeccttss ?pattern? ::::ssttoooooopp::::rreeccoorrdd ::::ssttoooooopp::::rreeppoorrtt ?pattern?

DESCRIPTION

This package provides commands to extend Tcl in an object oriented man-

ner, using a familiar C++ like syntax and behaviour. Stooop only intro-

duces a few new commands: ccllaassss, nneeww, ddeelleettee, vviirrttuuaall and ccllaassssooff. Along with a few coding conventions, that is basically all you need to

know to use stooop. Stooop is meant to be as simple to use as possible.

This manual is very succinct and is to be used as a quick reminder for

the programmer, who should have read the thorough stooopman.html HTML

documentation at this point. ::::ssttoooooopp::::ccllaassss name body This command creates a class. The body, similar in contents to a Tcl namespace (which a class actually also is), contains member procedure definitions. Member procedures can also be defined outside the class body, by prefixing their name with ccllaassss::::, as you would proceed with namespace procedures. pprroocc class {tthhiiss ?arg arg ...?} ?base {?arg arg ...?} ...? body This is the constructor procedure for the class. It is invoked following a nneeww invocation on the class. It must have the same name as the class and a first argument named tthhiiss. Any number of base classes specifications, including arguments to be passed to their constructor, are allowed before the actual body of the procedure. pprroocc ~class {tthhiiss} body This is the destructor procedure for the class. It is invoked following a ddeelleettee invocation. Its name must be the concatenation of a single ~~ character followed by the class name (as in C++). It must have a single argument named tthhiiss. pprroocc name {tthhiiss ?arg arg ...?} body This is a member procedure of the class, as its first

argument is named tthhiiss. It allows a simple access of mem-

ber data for the object referenced by tthhiiss inside the procedure. For example:

set ($this,data) 0

pprroocc name {?arg arg ...?} body This is a static (as in C++) member procedure of the class, as its first argument is not named tthhiiss. Static (global) class data can be accessed as in: set (data) 0 pprroocc class {tthhiiss ccooppyy} body This is the optional copy procedure for the class. It

must have the same name as the class and exactly 2 argu-

ments named tthhiiss and ccooppyy. It is invoked following a nneeww invocation on an existing object of the class. ::::ssttoooooopp::::nneeww class ?arg arg ...? This command is used to create an object. The first argument is the class name and is followed by the arguments needed by the corresponding class constructor. A unique identifier for the object just created is returned. ::::ssttoooooopp::::ddeelleettee object ?object ...? This command is used to delete one or several objects. It takes one or more object identifiers as argument(s). ::::ssttoooooopp::::vviirrttuuaall pprroocc name {tthhiiss ?arg arg ...?} ?body? The vviirrttuuaall specifier may be used on member procedures to achieve dynamic binding. A procedure in a base class can then be redefined (overloaded) in the derived class(es). If the base class procedure is invoked on an object, it is actually the derived class procedure which is invoked, if it exists. If the base class procedure has no body, then it is considered to be a pure virtual and the derived class procedure is always invoked. ::::ssttoooooopp::::ccllaassssooff object This command returns the class of the existing object passed as single parameter. ::::ssttoooooopp::::nneeww object This command is used to create an object by copying an existing object. The copy constructor of the corresponding class is invoked if it exists, otherwise a simple copy of the copied object data members is performed. DDEEBBUUGGGGIINNGG Environment variables SSTTOOOOOOPPCCHHEECCKKDDAATTAA

Setting this variable to any true value will cause stooop

to check for invalid member or class data access. SSTTOOOOOOPPCCHHEECCKKPPRROOCCEEDDUURREESS

Setting this variable to any true value will cause stooop

to check for invalid member procedure arguments and pure interface classes instanciation. SSTTOOOOOOPPCCHHEECCKKAALLLL

Setting this variable to any true value will cause stooop

to activate both procedure and data member checking. SSTTOOOOOOPPCCHHEECCKKOOBBJJEECCTTSS

Setting this variable to any true value will cause stooop

to activate object checking. The following stooop names-

pace procedures then become available for debugging: pprriinnttOObbjjeeccttss, rreeccoorrdd and rreeppoorrtt. SSTTOOOOOOPPTTRRAACCEEPPRROOCCEEDDUURREESS Setting this environment variable to either ssttddoouutt, ssttddeerrrr or a file name, activates procedure tracing. The

stooop library will then output to the specified channel

1 line of informational text for each member procedure invocation. SSTTOOOOOOPPTTRRAACCEEPPRROOCCEEDDUURREESSFFOORRMMAATT Defines the trace procedures output format. Defaults to

""ccllaassss:: %%CC,, pprroocceedduurree:: %%pp,, oobbjjeecctt:: %%OO,, aarrgguummeennttss:: %%aa"".

SSTTOOOOOOPPTTRRAACCEEDDAATTAA Setting this environment variable to either ssttddoouutt,

ssttddeerrrr or a file name, activates data tracing. The stooop

library will then output to the specified channel 1 line of informational text for each member data access. SSTTOOOOOOPPTTRRAACCEEDDAATTAAFFOORRMMAATT Defines the trace data output format. Defaults to ""ccllaassss::

%%CC,, pprroocceedduurree:: %%pp,, aarrrraayy:: %%AA,, oobbjjeecctt:: %%OO,, mmeemmbbeerr:: %%mm,,

ooppeerraattiioonn:: %%oo,, vvaalluuee:: %%vv"".

SSTTOOOOOOPPTTRRAACCEEDDAATTAAOOPPEERRAATTIIOONNSS When tracing data output, by default, all read, write and unsetting accesses are reported, but the user can set this variable to any combination of the letters rr, ww, and uu for more specific tracing (please refer to the ttrraaccee Tcl manual page for more information). SSTTOOOOOOPPTTRRAACCEEAALLLL Setting this environment variable to either ssttddoouutt, ssttddeerrrr or a file name, enables both procedure and data tracing. ::::ssttoooooopp::::pprriinnttOObbjjeeccttss ?pattern? Prints an ordered list of existing objects, in creation order, oldest first. Each output line contains the class name, object identifier and the procedure within which the creation occurred.

The optional pattern argument (as in the Tcl ssttrriinngg mmaattcchh com-

mand) can be used to limit the output to matching class names. ::::ssttoooooopp::::rreeccoorrdd

When invoked, a snapshot of all existing stooop objects is

taken. Reporting can then be used at a later time to see which objects were created or deleted in the interval. ::::ssttoooooopp::::rreeppoorrtt ?pattern? Prints the created and deleted objects since the ::::ssttoooooopp::::rreeccoorrdd procedure was invoked last. If present, the pattern argument limits the output to matching class names. EEXXAAMMPPLLEESS

Please see the full HTML documentation in stooopman.html.

KKEEYYWWOORRDDSS C++, class, object, object oriented

stooop 4.4.1 stooop(n)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™