home *** CD-ROM | disk | FTP | other *** search
- # 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 : @(#)persobject.tcl /main/titanic/1
- # Author : H. Broeze
- # Original date : 6 Sep 1996
- # Description :
- #
- #---------------------------------------------------------------------------
- #
- # @(#)persobject.tcl /main/titanic/1 12 Jun 1997 Copyright 1996 Cayenne Software
-
- # Start user added include file section
- # End user added include file section
-
-
- Class PersObject : {Object} {
- constructor
- method destructor
- method save
- method getInstanceName
- method getDefinition
- method getState
- }
-
- constructor PersObject {class this name} {
- set this [Object::constructor $class $this $name]
- # Start constructor user section
- # End constructor user section
- return $this
- }
-
- method PersObject::destructor {this} {
- # Start destructor user section
- # End destructor user section
- }
-
- method PersObject::save {this fd } {
- puts $fd [$this getDefinition]
- puts $fd [$this getState]
- }
-
- method PersObject::getInstanceName {this} {
- return $this
- }
-
- method PersObject::getDefinition {this {currentClass ""}} {
- if {$currentClass == "" } {
- set currentClass [$this objType]
- }
- return "$currentClass new [$this getInstanceName] \n"
- }
-
- method PersObject::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
-
-