home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)classmaker.tcl /main/titanic/1
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)classmaker.tcl /main/titanic/1 3 Jul 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
-
- Class ClassMaker : {Object} {
- constructor
- method destructor
- }
-
- constructor ClassMaker {class this name} {
- set this [Object::constructor $class $this $name]
- # Start constructor user section
- # End constructor user section
- return $this
- }
-
- method ClassMaker::destructor {this} {
- # Start destructor user section
- # End destructor user section
- }
-
- proc ClassMaker::extend {baseClass className attributes {needsName 1}} {
- if {(! [isCommand "$baseClass"]) || [isCommand "$className"]} return
-
- set attrDef "\n"
- foreach attr $attributes {
- set attrDef [concat $attrDef "attribute $attr\n"]
- }
- set createCmd "\
- Class $className : \{$baseClass\} \{\n\
- method destructor\n\
- constructor\n\
- $attrDef\
- \}"
- if {[lsearch -exact ["$baseClass" info methods] destructor] != -1} {
- set baseDestructCmd "\$this $baseClass::destructor\n"
- } else {
- set baseDestructCmd ""
- }
- set destructorCmd "\
- method $className::destructor \{this\} \{\n\
- $baseDestructCmd \
- \}"
- if $needsName {
- set constructorCmd "\
- constructor $className \{class this name\} \{\n\
- set this \[$baseClass::constructor \$class \$this \$name\]\n\
- return \$this\n\
- \}"
- } else {
- set constructorCmd "\
- constructor $className \{class this\} \{\n\
- set this \[$baseClass::constructor \$class \$this\]\n\
- return \$this\n\
- \}"
- }
- eval $createCmd
- eval $destructorCmd
- eval $constructorCmd
- }
-
- # Do not delete this line -- regeneration end marker
-
-