home *** CD-ROM | disk | FTP | other *** search
/ PC World 1998 October / PCWorld_1998-10_cd.bin / software / prehled / komix / DATA.Z / cmucdmodel.tcl < prev    next >
Text File  |  1996-09-12  |  2KB  |  79 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cayenne Software Inc.    1996
  4. #
  5. #      File:           @(#)cmucdmodel.tcl    /main/titanic/1
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)cmucdmodel.tcl    /main/titanic/1   12 Sep 1996 Copyright 1996 Cayenne Software Inc.
  10.  
  11. # Start user added include file section
  12. require cmusecase.tcl
  13. # End user added include file section
  14.  
  15.  
  16. Class CMUcdModel : {SMPhaseModel} {
  17.     method destructor
  18.     constructor
  19.     method defineSMTypes
  20.     method makeSMTypeName
  21.     method mcheck
  22. }
  23.  
  24. method CMUcdModel::destructor {this} {
  25.     # Start destructor user section
  26.     # End destructor user section
  27. }
  28.  
  29. constructor CMUcdModel {class this configV phaseV} {
  30.     set this [SMPhaseModel::constructor $class $this $configV $phaseV]
  31.  
  32.     # Define global available SMTypes
  33.     $this defineSMTypes
  34.  
  35.     # Add creator scripts to the ObjectFactory
  36.     set objFac [$this getObjectFactory]
  37.     $objFac addCreatorScript $OMT_UCD_UseCase "
  38.     return \[CMUseCase new $this]
  39.     "
  40.  
  41.     return $this
  42. }
  43.  
  44. method CMUcdModel::defineSMTypes {this} {
  45.     set typeIter [SMTypeIter new]
  46.     while {[$typeIter current] != ""} {
  47.     set smType [$typeIter current]
  48.     if {![string match UCD* [$smType name]]} {
  49.         $typeIter next
  50.         continue
  51.     }
  52.     set name [$this makeSMTypeName [$smType name]]
  53.     eval "global $name"
  54.     eval "set $name $smType"
  55.     $typeIter next
  56.     }
  57.     $typeIter delete
  58.  
  59.     global ANY; set ANY [SMTypeDB::any]
  60. }
  61.  
  62. method CMUcdModel::makeSMTypeName {this type} {
  63.     regsub -all "\[ \t]+" $type "_" type
  64.     return "OMT_$type"
  65. }
  66.  
  67. method CMUcdModel::mcheck {this} {
  68.     # check all Use Cases in *current* system
  69.     #
  70.     foreach uc [$this getSMObjects $OMT_UCD_UseCase] {
  71.     if {[$uc isInSystem]} {
  72.         $uc mcheck
  73.     }
  74.     }
  75. }
  76.  
  77. # Do not delete this line -- regeneration end marker
  78.  
  79.