home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
persgcobje.tcl
< prev
next >
Wrap
Text File
|
1997-06-12
|
2KB
|
81 lines
# Copyright (c) 1996 by Cayenne Software Inc.
#
# This software is furnished under a license and may be used only in
# accordance with the terms of such license and with the inclusion of
# the above copyright notice. This software or any other copies thereof
# may not be provided or otherwise made available to any other person.
# No title to and ownership of the software is hereby transferred.
#
# The information in this software is subject to change without notice
# and should not be construed as a commitment by Cayenne Software Inc
#
#---------------------------------------------------------------------------
#
# File : @(#)persgcobje.tcl /main/titanic/1
# Author : H. Broeze
# Original date : 6 Sep 1996
# Description :
#
#---------------------------------------------------------------------------
#
# @(#)persgcobje.tcl /main/titanic/1 12 Jun 1997 Copyright 1996 Cayenne Software
# Start user added include file section
# End user added include file section
Class PersGCObject : {GCObject} {
constructor
method destructor
method save
method getInstanceName
method getDefinition
method getState
}
constructor PersGCObject {class this} {
set this [GCObject::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method PersGCObject::destructor {this} {
# Start destructor user section
# End destructor user section
}
method PersGCObject::save {this fd} {
puts $fd [$this getDefinition]
puts $fd [$this getState]
}
method PersGCObject::getInstanceName {this} {
return [string tolower [$this objType]]
}
method PersGCObject::getDefinition {this {currentClass ""}} {
if {$currentClass == "" } {
set currentClass [$this objType]
}
return "set [$this getInstanceName] \[$currentClass new \] \n"
}
method PersGCObject::getState {this {currentClass ""}} {
if {$currentClass == "" } {
set currentClass [$this objType]
}
set state ""
foreach attr [$currentClass info attributes] {
set state "${state}\$[$this getInstanceName] $attr \"[$this $attr]\" \n"
}
foreach superClass [$currentClass info supers] {
set state "${state}[$this getState $superClass]"
}
return $state
}
# Do not delete this line -- regeneration end marker