home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
chkmodel.tcl
< prev
next >
Wrap
Text File
|
1997-12-01
|
101KB
|
3,562 lines
#---------------------------------------------------------------------------
#
# Copyright (c) 1997 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 : chkmodel.tcl
# Author : heli
# Original date : November 1997
# Description : Checking local/global/usecase/target model
#
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# File: @(#)cmcmnattr.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMCmnAttr : {Object} {
constructor
method destructor
method copyAccessMode
}
constructor CMCmnAttr {class this} {
set this [Object::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMCmnAttr::destructor {this} {
# Start destructor user section
# End destructor user section
}
method CMCmnAttr::copyAccessMode {this oper rwMode} {
#
# Based on the access mode of an attribute (data/assoc), set the
# method access of a synthetic operation that is generated from
# that attribute.
#
# 'rwMode' is r if oper is a read operation, w if it's a write operation
#
if {$oper == ""} {
return
}
set rw [$this getAccessMode]
if {$rw == ""} {
set rw {Public Public}
} else {
set rw [split $rw -]
}
set rwIndex [expr {$rwMode == "r" ? "0" : "1"}]
$oper addRunTimeProperty method_access [lindex $rw $rwIndex]
if {$debug} {
puts " >>> copyAccessMode [$this getName] [$oper getName]\
[$oper getPropertyValue method_access]"
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmcmnevent.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMCmnEvent : {Object} {
constructor
method destructor
method inDiagram
}
constructor CMCmnEvent {class this} {
set this [Object::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMCmnEvent::destructor {this} {
# Start destructor user section
# End destructor user section
}
method CMCmnEvent::inDiagram {this diagram} {
#
# Return 1 if this event belongs to the given diagram, else 0.
#
set colon [string first "/" $diagram]
if {$colon != -1} {
incr colon
set diagram [string range $diagram $colon end]
}
return [expr {$diagram == "[$this getDiagramName].[$this getDiagramType]"}]
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmcmnopera.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMCmnOperation : {Object} {
constructor
method destructor
method mcheck
}
constructor CMCmnOperation {class this} {
set this [Object::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMCmnOperation::destructor {this} {
# Start destructor user section
# End destructor user section
}
method CMCmnOperation::mcheck {this class} {
my_debug "CMCmnOperation::mcheck()"
set name [$class getName]
if {[$this getName] == $name} {
# check is language dependent...
# m4_error $E_ILLEGAL_CONSTRUCTOR $name
}
foreach p [get_parameters $this] {
$p mcheck $this $class
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmcmntype.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMCmnType : {Object} {
constructor
method destructor
method prepare
}
constructor CMCmnType {class this} {
set this [Object::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMCmnType::destructor {this} {
# Start destructor user section
# End destructor user section
}
method CMCmnType::prepare {this class model forwhat} {
my_debug "CMCmnType::prepare()"
# empty
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmeventrec.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMEventReceiver : {Object} {
constructor
method destructor
method setReceivedEvents
method getReceivedEvents
attribute receivedEvents
attribute eventTypes
attribute eventDiagram
}
constructor CMEventReceiver {class this} {
set this [Object::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMEventReceiver::destructor {this} {
# Start destructor user section
# End destructor user section
}
method CMEventReceiver::setReceivedEvents {this eventTypes eventDiagram} {
$this receivedEvents {}
$this eventTypes $eventTypes
$this eventDiagram $eventDiagram
}
method CMEventReceiver::getReceivedEvents {this {eventTypes {}} {eventDiagram ""}} {
# Return the received events that are defined in (this) eventDiagram or in
# a diagram with a type that is present in (this) eventTypes
# The result is cached, if no 'eventTypes' and 'eventDiagram'
#
set cache 0
if {$eventTypes == {} && $eventDiagram == ""} {
set cache 1
if {[$this receivedEvents] != {}} {
return [$this receivedEvents]
}
}
if {$eventTypes == {}} {
set eventTypes [$this eventTypes]
}
if {$eventDiagram == ""} {
set eventDiagram [$this eventDiagram]
}
if {$eventTypes == {} && $eventDiagram == ""} {
return {}
}
set receivedEvents {}
foreach recvEv [$this receivedEventSet] {
if {$eventDiagram != "" && $eventDiagram == "[$recvEv getDiagramName].[$recvEv getDiagramType]"} {
lappend receivedEvents $recvEv
continue
}
if {$eventTypes == {} || [lsearch $eventTypes [$recvEv getDiagramType]] == -1} {
continue
}
lappend receivedEvents $recvEv
}
if {$cache} {
$this receivedEvents $receivedEvents
}
return $receivedEvents
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmodel.tcl /main/titanic/3
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CModel : {OOPLModel} {
constructor
method destructor
method mcheck
method prepare
method getDBObjectClass
method findClass
}
constructor CModel {class this} {
set this [OOPLModel::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CModel::destructor {this} {
# Start destructor user section
# End destructor user section
}
selfPromoter OOPLModel {this} {
CModel promote $this
}
method CModel::mcheck {this ooplClasses ooplSubjects} {
my_debug "CModel::mcheck()"
foreach class $ooplClasses {
if {![$class isSynthetic]} {
if {[$class isExternal]} {
puts stdout "\nClass '[$class getName]' is external, not checked."
continue
}
$class mcheck
}
}
foreach subject $ooplSubjects {
m4_message $M_CHECKING_SUBJECT [$subject getName]
$subject mcheck
}
}
method CModel::prepare {this ooplClasses ooplSubjects forwhat} {
my_debug "CModel::prepare()"
add_predefined_methods $this
foreach class $ooplClasses {
if {![$class isSynthetic]} {
$class prepare $this $forwhat
}
}
#foreach subject [$this subjectSet]
foreach subject $ooplSubjects {
$this prepare $subject $forwhat
}
foreach class $ooplClasses {
#
# add these attributes for more efficient operation of some of the
# checks; these are only needed if there are any received_events
# can only be done after all classes have been prepared, due to
# extra operations/super classes added via addOperation or
# add_super_class
#
if {[$class getReceivedEvents] != {}} {
$class addRunTimeProperty methods [$class findMethods 0]
$class addRunTimeProperty flat_methods [$class findMethods 1]
}
}
}
method CModel::getDBObjectClass {this} {
#
# Return the handle of the DBObject class for this OoplModel.
#
set dbobject [$this findClass "DBObject"]
if {$dbobject == ""} {
set dbobject [$this addClass "DBObject" db_class]
}
return $dbobject
}
method CModel::findClass {this name {feat ""}} {
#
# Given a class name and optionally an operation name, find the class
# and feature handles of the class with name 'name' and all features
# with name 'feat' in this OoplModel. 'feat' may be a glob-style
# pattern.
#
# Returns a list of one or more elements, the first being the class handle,
# the rest operation handles. If the class was not found, returns "".
#
set c [$this classByName $name]
if {"$c" == ""} {
return ""
}
if {$feat != ""} {
set flist ""
foreach f [$c featureSet] {
if [string match $feat [$f getName]] {
lappend flist $f
}
}
return "$c $flist"
}
return $c
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmparamete.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMParameter : {Object} {
constructor
method destructor
method mcheck
}
constructor CMParameter {class this} {
set this [Object::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMParameter::destructor {this} {
# Start destructor user section
# End destructor user section
}
method CMParameter::mcheck {this oper class} {
my_debug "CMParameter::mcheck()"
# empty
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmcmnclass.tcl /main/titanic/6
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMCmnClass : {CMEventReceiver} {
constructor
method destructor
method mcheck
method prepare
method checkDirectSupers
method checkClassAttributes
method checkClassOperations
method checkClassAssociations
method causesConflict
method makeKeyParamList
method isRootClass
method findDataAttrs
method findAssocAttrs
method findMethods
method findEventMethod
}
global CMCmnClass::visitedSupers
set CMCmnClass::visitedSupers {}
constructor CMCmnClass {class this} {
set this [CMEventReceiver::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMCmnClass::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMEventReceiver::destructor
}
method CMCmnClass::mcheck {this} {
my_debug "CMCmnClass::mcheck()"
m4_message $M_CHECKING_CLASS [$this getName]
$this checkDirectSupers
$this checkClassAttributes
$this checkClassOperations
$this checkClassAssociations
foreach feat [$this featureSet] {
if {![$feat isSynthetic]} {
$feat mcheck $this
}
}
foreach recvEv [$this getReceivedEvents] {
$recvEv mcheck $this
}
}
method CMCmnClass::prepare {this model forwhat} {
my_debug "CMCmnClass::prepare()"
foreach feat [$this featureSet] {
if {![$feat isSynthetic]} {
$feat prepare $this $model $forwhat
}
}
}
method CMCmnClass::checkDirectSupers {this} {
#
# Check if this class does not directly inherit from the same
# class more than once.
#
set superNames {}
foreach gen [$this genNodeSet] {
lappend superNames [$gen getSuperClassName]
}
# remove all unique names from superNames
set uniqueSupers [CheckUtil::findUniqueNames $superNames]
foreach super $uniqueSupers {
set idx [lsearch $superNames $super]
set superNames [lreplace $superNames $idx $idx]
}
# any name left indicates an error
foreach super [CheckUtil::findUniqueNames $superNames] {
m4_error $E_SAME_DIRECT_SUPERS [$this getName] $super
}
}
method CMCmnClass::checkClassAttributes {this} {
#
# check data attribute against all assoc_attribs
#
foreach attrib [$this dataAttrSet] {
set name [$attrib getName]
foreach assoc [$this genAssocAttrSet] {
if {[$assoc getName] == $name &&
[$assoc getMultiplicity] == "one"} {
m4_error $E_CONFLICTING_DATA_AND_ASSOC_ATTRIB \
[$this getName] $name [CheckUtil::getDiagram $assoc]
}
}
}
# check assoc_attribute
foreach assoc1 [$this genAssocAttrSet] {
foreach assoc2 [$this genAssocAttrSet] {
# Trick to prevent double checks.
if {$assoc1 >= $assoc2} {
continue
}
if [$this causesConflict $assoc1 $assoc2] {
m4_error $E_CONFLICTING_ASSOC_ATTRIBS \
[$this getName] [$assoc1 getName] \
[CheckUtil::getDiagram $assoc1] [CheckUtil::getDiagram $assoc2]
}
}
}
}
method CMCmnClass::checkClassOperations {this} {
# nothing to check here
}
method CMCmnClass::checkClassAssociations {this} {
#
# Check if this class has unique names for all associations.
#
# Only for assoc_attribs that have a "link", since only there the
# association name is used by the code-generator.
#
foreach a [$this genAssocAttrSet] {
set a_link [get_link $a]
if {$a_link != ""} {
foreach b [$this genAssocAttrSet] {
# Trick to prevent double checks.
if {$a >= $b} {
continue
}
set b_link [get_link $b]
if {$b_link != ""} {
set a_relation [$a_link relation]
set b_relation [$b_link relation]
if {$a_relation != $b_relation} {
# if they're the same, this class is a link class, with
# links to both association classes, but only one
# association.
set a_name [$a_relation getName]
set b_name [$b_relation getName]
if {$a_name == $b_name && $a_name != ""} {
set diags "[CheckUtil::getDiagram $a] [CheckUtil::getDiagram $b]"
if {[lindex $diags 0] == [lindex $diags 1]} {
set diags " [lindex $diags 0]"
} else {
set diags "s [join $diags " and "]"
}
m4_error $E_CONFLICTING_ASSOC_NAMES \
[$this getName] $a_name $diags
}
}
}
}
}
}
}
method CMCmnClass::causesConflict {this assoc1 assoc2} {
#
# Check if the attribute names of this class are unique; includes checking
# for duplicate assoc_attribs. Duplicate attribute names are checked for
# while loading the model, because these are certain to cause collisions.
#
# These checks see if methods generated from data_ and assoc_attribs
# will confict. This can only happen in these cases:
#
# - between a data_attrib and an assoc_attrib that have the same name,
# and where the assoc_attrib has a multiplicity of one,
#
# - between two assoc_attribs with the same name, compatible types
# and same multiplicity.
#
set type1 [$assoc1 get_obj_type]
set type2 [$assoc2 get_obj_type]
return [expr {
$assoc1 != $assoc2 &&
[$assoc1 getName] == [$assoc2 getName] &&
[$assoc1 getMultiplicity] == [$assoc2 getMultiplicity] &&
($type1 == $type2 || "db_$type1" == $type2 || $type1 == "db_$type2")
}]
}
method CMCmnClass::makeKeyParamList {this} {
#
# Create a paramList for use with add_operation. The parameters consist
# of those attributes that are key attributes of this class.
#
set params ""
foreach key [get_col_list [$this table] KEYS] {
lappend params "[$key getName] [$key getTypeStd]"
}
return $params
}
method CMCmnClass::isRootClass {this} {
#
# Check if this class is a real root class, i.e. has no non-synthetic
# superclasses
#
set supers [$this genNodeSet]
if [lempty $supers] {
return 1
}
foreach g $supers {
if {[$g isSynthetic] != "1"} {
return 0
}
}
return 1;
}
method CMCmnClass::findDataAttrs {this {super 0} {_isRecCall 0}} {
#
# Return a list of data attributes of this class.
#
# If 'super' is 1, attributes of superclasses are included as well.
# '_isRecCall' is used for *internal* purpose only
#
global CMCmnClass::visitedSupers
if {$super == 1} {
if {!$_isRecCall} {
set CMCmnClass::visitedSupers {}
} elseif {[lsearch -exact ${CMCmnClass::visitedSupers} $this] != -1} {
# been here already
return {}
}
}
set attrs [$this dataAttrSet]
if {$super == 1} {
lappend CMCmnClass::visitedSupers $this
foreach g [$this genNodeSet] {
set new [[$g superClass] findDataAttrs 1 1]
if {$new != {}} {
eval "lappend attrs $new"
}
}
}
return $attrs
}
method CMCmnClass::findAssocAttrs {this {super 0} {_isRecCall 0}} {
#
# Return a list of association attributes of this class.
#
# If 'super' is 1, attributes of superclasses are included as well.
# '_isRecCall' is used for *internal* purpose only
#
global CMCmnClass::visitedSupers
if {$super == 1} {
if {!$_isRecCall} {
set CMCmnClass::visitedSupers {}
} elseif {[lsearch -exact ${CMCmnClass::visitedSupers} $this] != -1} {
# been here already
return {}
}
}
set attrs [$this genAssocAttrSet]
if {$super == 1} {
lappend CMCmnClass::visitedSupers $this
foreach g [$this genNodeSet] {
set new [[$g superClass] findAssocAttrs 1 1]
if {$new != {}} {
eval "lappend attrs $new"
}
}
}
return $attrs
}
method CMCmnClass::findMethods {this {super 0} {_isRecCall 0}} {
#
# Return a list of methods of this class.
#
# If 'super' is 1, methods of superclasses are included as well.
# '_isRecCall' is used for *internal* purpose only
#
global CMCmnClass::visitedSupers
if {$super == 1} {
if {!$_isRecCall} {
set CMCmnClass::visitedSupers {}
} elseif {[lsearch -exact ${CMCmnClass::visitedSupers} $this] != -1} {
# been here already
return {}
}
}
set opers [$this operationSet]
if {$super == 1} {
lappend CMCmnClass::visitedSupers $this
foreach g [$this genNodeSet] {
set new [[$g superClass] findMethods 1 1]
if {$new != {}} {
eval "lappend opers $new"
}
}
}
return $opers
}
method CMCmnClass::findEventMethod {this flatView eventName nattrs access upInfo} {
my_debug "CMCmnClass::findEventMethod()"
#
# Given a single event name, see if the event is handled by
# this class. This is so if the class has an operation with the
# same name as the event. Also check if the operation found has at least
# accessibility as specified by 'access'.
#
# If 'nattrs' is >= 0, the operation must have the same number of parameters
# as the specified number, if 'nattrs' == -1 the parameter count of the
# operation is ignored.
#
# Returns:
# 0 if a matching operation is found (correct parameters and access
# rights),
# 1 if no operation is found at all,
# 2 if an operation is found with the correct name but with the wrong
# number of parameters,
# 3 if a matching operation was found, but with the wrong accessibility.
#
upvar $upInfo info
if {$flatView} {
set opers [$this getPropertyValue flat_methods]
} else {
set opers [$this operationSet]
}
set found_name 0
set bad_access 0
foreach o $opers {
if {[$o getName] != $eventName} {
continue
}
# found one, if attributes need not be checked, we're done
if {$nattrs == -1} {
if [$o checkAccess $access] {
return 0
} else {
set bad_access 1
set info [$o getPropertyValue method_access]
continue
}
}
# found one, check if parameters match attributes
if {[llength [get_parameters $o]] == $nattrs} {
if [$o checkAccess $access] {
return 0
} else {
set bad_access 1
set info [$o getPropertyValue method_access]
}
} else {
# remember that a correct name was found
set found_name 1
set info [llength [get_parameters $o]]
}
}
if $found_name {
return 2
}
if $bad_access {
return 3
}
return 1
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmspecialc.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMSpecialClass : {CMCmnClass} {
constructor
method destructor
method mcheck
method prepare
}
constructor CMSpecialClass {class this} {
set this [CMCmnClass::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMSpecialClass::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnClass::destructor
}
method CMSpecialClass::mcheck {this} {
my_debug "CMSpecialClass::mcheck()"
m4_message $M_CHECKING_CLASS [$this getName]
#
# The given class is a special class, not allowed to receive events
#
foreach recvEv [$this getReceivedEvents] {
$recvEv m4Error [$recvEv getEventType] E_CLASS_CANNOT_RECEIVE [$this getName] [$recvEv asStr] [$this get_obj_type]
}
}
method CMSpecialClass::prepare {this model forwhat} {
# empty
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmclassgen.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMClassGenericTypeDef : {CMSpecialClass OPClassGenericTypeDef} {
constructor
method destructor
}
constructor CMClassGenericTypeDef {class this} {
set this [CMSpecialClass::constructor $class $this]
set this [OPClassGenericTypeDef::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMClassGenericTypeDef::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMSpecialClass::destructor
}
selfPromoter OPClassGenericTypeDef {this} {
CMClassGenericTypeDef promote $this
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmcmnassoc.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMCmnAssocAttr : {CMCmnAttr Object} {
constructor
method destructor
method mcheck
method prepareForAssoc
method prepareForLink
method getAccessMode
}
constructor CMCmnAssocAttr {class this} {
set this [CMCmnAttr::constructor $class $this]
set this [Object::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMCmnAssocAttr::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnAttr::destructor
}
method CMCmnAssocAttr::mcheck {this class} {
# empty
}
method CMCmnAssocAttr::prepareForAssoc {this class model forwhat} {
#
# Common prepare dispatch function for associations, works also for
# database associations.
# Only prepare for method-generating parts
#
set prefix "[$this getMultiplicity]"
$this ${prefix}GetPrepare $class $model $forwhat
$this ${prefix}SetPrepare $class $model $forwhat
$this ${prefix}RemovePrepare $class $model $forwhat
}
method CMCmnAssocAttr::prepareForLink {this class model forwhat} {
#
# Common generate dispatch function for links
#
set prefix "[$this getMultiplicity]"
$this ${prefix}GetPrepare $class $model $forwhat
}
method CMCmnAssocAttr::getAccessMode {this} {
return [$this getPropertyValue assoc_access]
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmdbassoca.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMDBAssocAttr : {CMCmnAssocAttr OPDBAssocAttr} {
constructor
method destructor
method prepare
method oneGetPrepare
method oneSetPrepare
method oneRemovePrepare
method manyGetPrepare
method manySetPrepare
method manyRemovePrepare
}
constructor CMDBAssocAttr {class this} {
set this [CMCmnAssocAttr::constructor $class $this]
set this [OPDBAssocAttr::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMDBAssocAttr::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnAssocAttr::destructor
}
selfPromoter OPDBAssocAttr {this} {
CMDBAssocAttr promote $this
}
method CMDBAssocAttr::prepare {this class model forwhat} {
my_debug "CMDBAssocAttr::prepare()"
$this prepareForAssoc $class $model $forwhat
}
method CMDBAssocAttr::oneGetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [cap [$this getName]]
set op [$class addOperation get$name $type]
$this copyAccessMode $op r
}
method CMDBAssocAttr::oneSetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [cap [$this getName]]
set op [$class addOperation set$name int]
$op addParameter new$name $type
$this copyAccessMode $op w
}
method CMDBAssocAttr::oneRemovePrepare {this class model forwhat} {
if [$this isMandatory] {
return
}
if {[set opp [$this opposite]] != "" &&
[$opp get_obj_type] == "db_qual_assoc_attrib"} {
return
}
set name [cap [$this getName]]
set op [$class addOperation remove$name int]
$this copyAccessMode $op w
}
method CMDBAssocAttr::manyGetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [$this getName]
set settype [set_type_name [$this ooplType]]
set setname [cap [set_name $name]]
catch {$model addClass $settype}
set op [$class addOperation get$setname int]
$op addParameter $setname $settype
$this copyAccessMode $op r
}
method CMDBAssocAttr::manySetPrepare {this class model forwhat} {
if {[set opp [$this opposite]] != "" &&
[$opp get_obj_type] == "db_qual_assoc_attrib"} {
# Can't supply the key for a qualified assoc
return
}
set type [[$this ooplType] getName]
set name [cap [$this getName]]
set op [$class addOperation add$name int]
$op addParameter new$name $type
$this copyAccessMode $op w
}
method CMDBAssocAttr::manyRemovePrepare {this class model forwhat} {
if {[set opp [$this opposite]] != "" &&
[$opp get_obj_type] == "db_qual_assoc_attrib"} {
return
}
set type [[$this ooplType] getName]
set name [cap [$this getName]]
set op [$class addOperation remove$name int]
$op addParameter old$name $type
$this copyAccessMode $op w
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmqualifas.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMQualifAssocAttr : {CMCmnAssocAttr} {
constructor
method destructor
method mcheck
}
constructor CMQualifAssocAttr {class this} {
set this [CMCmnAssocAttr::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMQualifAssocAttr::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnAssocAttr::destructor
}
method CMQualifAssocAttr::mcheck {this class} {
$this CMCmnAssocAttr::mcheck $class
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmdbqualli.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMDBQualLinkAttr : {OPDBQualLinkAttr CMQualifAssocAttr} {
constructor
method destructor
method prepare
method oneGetPrepare
method manyGetPrepare
}
constructor CMDBQualLinkAttr {class this} {
set this [OPDBQualLinkAttr::constructor $class $this]
set this [CMQualifAssocAttr::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMDBQualLinkAttr::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMQualifAssocAttr::destructor
}
selfPromoter OPDBQualLinkAttr {this} {
CMDBQualLinkAttr promote $this
}
method CMDBQualLinkAttr::prepare {this class model forwhat} {
$this prepareForLink $class $model $forwhat
}
method CMDBQualLinkAttr::oneGetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [$this getName]
set keyname [[$this qualifier] getName]
set keytype [[[$this qualifier] ooplType] getName]
set func_name get[cap "${type}Of[cap $name]"]
set op [$class addOperation $func_name $type]
$op addParameter $keyname $keytype
$this copyAccessMode $op r
}
method CMDBQualLinkAttr::manyGetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [$this getName]
set settype [set_type_name [$this ooplType]]
set setname [cap [set_name $name]]
set keyname [[$this qualifier] getName]
set keytype [[[$this qualifier] ooplType] getName]
set func_name get[cap [set_name "${type}Of[cap $name]"]]
catch {$model addClass $settype}
set op [$class addOperation $func_name int]
$op addParameter $setname $settype
$op addParameter $keyname $keytype
$this copyAccessMode $op r
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmreceived.tcl /main/titanic/3
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMReceivedEvent : {CMCmnEvent OPReceivedEvent} {
constructor
method destructor
method init
method checkEventAttributes
method checkMethodForEvent
method m4Error
method asStr
attribute longType
attribute super
attribute accessNeeded
}
constructor CMReceivedEvent {class this} {
set this [CMCmnEvent::constructor $class $this]
set this [OPReceivedEvent::constructor $class $this]
$this super 1
$this accessNeeded "Public"
# Start constructor user section
# End constructor user section
return $this
}
method CMReceivedEvent::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnEvent::destructor
}
selfPromoter OPReceivedEvent {this} {
set type [$this getEventType]
if {$type == "internal_event"} {
CMIntEvent promote $this
} elseif {$type == "external_event"} {
CMExtEvent promote $this
} elseif {$type == "event_message"} {
CMEventMessage promote $this
} elseif {$type == "comm_message"} {
CMCommMessage promote $this
} elseif {$type == "trace_event"} {
CMTraceEvent promote $this
}
$this init
}
method CMReceivedEvent::init {this} {
$this super 1
$this accessNeeded "Public"
}
method CMReceivedEvent::checkEventAttributes {this class} {
my_debug "CMReceivedEvent::checkEventAttributes()"
#
# Check if all attributes of this received_event have distinct names.
#
if {[$this hasAttributes]} {
if {![CheckUtil::isUniqueNameList [$this getAttributes]]} {
m4_error $E_SAME_EVENT_ATTRIBUTE_NAMES [$this asStr 1] [$class getName]
}
}
}
method CMReceivedEvent::checkMethodForEvent {this class {quiet 0}} {
my_debug "CMReceivedEvent::checkMethodForEvent()"
#
# Check for this received_event received by the given class whether
# that event is handled by a method of the class.
#
# For an event to be valid, one of the following must hold:
#
# - if the received event does not have an associated MGD event,
# an operation with the same name as the event and with the same
# number of parameters as the number of event attributes must exist
# in the class' methods;
#
# - if the received event does have an associated MGD message, then
# every most decomposed message ("leaf event") in the MGD hierarchy
# with the received event as root, must have one or more parent messages
# for which an operation exists in the class' methods. This ensures
# that every type of message that can occur, is handled by the class.
#
set class_name [$class getName]
set r_type [$this getEventType]
set r_name [$this getName]
#
# Determine whether we need to consider methods of superclasses,
# and the minimum access right for an operation handling the event.
#
# done in init()
#
# If this event is sent to the class by the class itself, "Private"
# access is all that's needed. This also takes care of STD
# internal_- and external_events.
#
if {$class_name == [$this getSenderName]} {
$this accessNeeded "Private"
}
set access_needed [$this accessNeeded]
set super [$this super]
if {[$this hasAttributes]} {
set nattrs [llength [$this getAttributes]]
} else {
set nattrs -1
}
set e [$this event] ; # this is a real event (i.e. OPEvent)
if {$e == ""} {
m4_warning $W_NO_CORR_MSGDEF_FOUND [$this asStr] [$this getSenderName] $class_name
# check event
#
if {$r_name != ""} {
set info ""
set result [$class findEventMethod $super $r_name $nattrs $access_needed info]
if {$result == 1} {
if {!$quiet} {
$this m4Error E_NO_MATCHING_OPERATION1 $class_name [$this asStr]
}
return 0
} elseif {$result == 2} {
if {!$quiet} {
$this m4Error E_PARAM_ATTR_MISMATCH1 $class_name [$this asStr] $info $nattrs
}
return 0
} elseif {$result == 3} {
if {!$quiet} {
$this m4Error E_METHOD_ACCESS1 $class_name [$this asStr] $info $access_needed
}
return 0
}
}
if 0 {
# action does not to be a method of the class: NO CHECKING
# check action (actions should be objects)
#
set a_name [$r getAction]
if {$a_name != ""} {
set nattrs -1
regsub {(..ternal_)event} $r_type {\1action} a_type
switch -glob $a_type {
int* {set a_long_event_type "Internal STD Action"}
default {set a_long_event_type "External STD Action"}
}
set info ""
set result [$class findEventMethod $super $a_name $nattrs $access_needed info]
if {$result == 1} {
if {!$quiet} {
$this m4Error $a_type E_NO_MATCHING_OPERATION1 $class_name "$a_long_event_type '$action' in [CheckUtil::getDiagram $r]"
}
return 0
} elseif {$result == 2} {
if {!$quiet} {
$this m4Error $a_type E_PARAM_ATTR_MISMATCH1 $class_name "$a_long_event_type '$action' in [CheckUtil::getDiagram $r]" $info $nattrs
}
return 0
} elseif {$result == 3} {
if {!$quiet} {
$this m4Error $a_type E_METHOD_ACCESS1 $class_name "$a_long_event_type '$action' in [CheckUtil::Diagram $r]" $info $access_needed
}
return 0
}
}
} # 0
} else {
foreach leaf [$e findLeafEvents] {
set ok 0
set bad_params 0
set bad_access 0
set name_nparams 0
set name_access ""
set parents [concat $leaf [$leaf findParentEvents]]
foreach parent $parents {
set info ""
set result [$class findEventMethod $super [$parent getName] $nattrs $access_needed info]
if {$result == 0} {
set ok 1
break
} elseif {$result == 2 && !$bad_params} {
# remember the first (most derived) event found
set bad_params 1
set name [$parent getName]
set name_nparams $info
} elseif {$result == 3 && !$bad_access} {
# remember the first (most derived) event found
set bad_access 1
set name [$parent getName]
set name_access $info
}
}
if {!$ok} {
set parent_names {}
foreach parent $parents {
lappend parent_names [$parent getName]
}
if {!$quiet} {
if $bad_params {
$this m4Error E_PARAM_ATTR_MISMATCH2 $name $class_name [$this asStr] $name_nparams $nattrs
} elseif $bad_access {
$this m4Error E_METHOD_ACCESS2 $name $class_name [$this asStr] $name_access $access_needed
} else {
$this m4Error E_NO_MATCHING_OPERATION2 $class_name [$this asStr] [$leaf asStr] $parent_names
}
} else {
#
# No need to continue, since the caller is only interested
# in the correctness of this event, and here it is clear
# that it is not correct.
#
return 0
}
}
}
}
return 1
}
method CMReceivedEvent::m4Error {this errName args} {
#
# m4_error replacement that constructs an error id based on an error name.
# Used to allow for event-specific check configuration.
#
set err ${errName}_[string toupper [$this getEventType]]
eval "m4_error $[get err] $args"
}
method CMReceivedEvent::asStr {this {attrs 0} {condact 0}} {
#
# Create a string describing this event object.
# If 'attrs' is 1, the attributes of the event, if present, are added as
# well.
# If 'condact' is 0, the condition and action, if present, are not added.
#
set a ""
if {$attrs && [$this hasAttributes]} {
set first 1
foreach n [$this getAttributes] {
if {!$first} {
append a ", "
} else {
set first 0
}
lappend a $n
}
if {$a == ""} {
set a "()"
} else {
set a "( $a )"
}
}
if {$condact && [$this getEventType] == "external_event"} {
set conds [$this getConditions]
if {$conds != ""} {
set first 1
foreach cond $conds {
if {!$first} {
append a ", "
} else {
set first 0
}
append a $cond
}
}
set act [$this getAction]
if {$act != ""} {
append a {/} $act
}
}
if {$condact && [$this getEventType] == "external_event"} {
return "[$this longType] '[$this getName]' in '[$this getName]$a' in [$this getDiagramName].[$this getDiagramType]"
}
return "[$this longType] '[$this getName]$a' in [$this getDiagramName].[$this getDiagramType]"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmintevent.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMIntEvent : {CMReceivedEvent} {
constructor
method destructor
method init
method mcheck
}
constructor CMIntEvent {class this} {
set this [CMReceivedEvent::constructor $class $this]
# Start constructor user section
$this init
# End constructor user section
return $this
}
method CMIntEvent::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMReceivedEvent::destructor
}
method CMIntEvent::init {this} {
$this longType "Internal STD Event"
$this super 0
$this accessNeeded "Private"
}
method CMIntEvent::mcheck {this class} {
my_debug "CMIntEvent::mcheck()"
$this checkMethodForEvent $class
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmconstruc.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMConstructor : {CMCmnOperation OPConstructor} {
constructor
method destructor
method prepare
}
constructor CMConstructor {class this} {
set this [CMCmnOperation::constructor $class $this]
set this [OPConstructor::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMConstructor::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnOperation::destructor
}
selfPromoter OPConstructor {this} {
CMConstructor promote $this
}
method CMConstructor::prepare {this class model forwhat} {
my_debug "CMConstructor::prepare()"
foreach param [$class creationParamSet] {
$param prepare $class $model $forwhat
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmcmnsubje.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMCmnSubject : {CMEventReceiver} {
constructor
method destructor
method prepare
}
constructor CMCmnSubject {class this} {
set this [CMEventReceiver::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMCmnSubject::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMEventReceiver::destructor
}
method CMCmnSubject::prepare {this model forwhat} {
my_debug "CMCmnSubject::prepare()"
# empty
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmsubject.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMSubject : {CMCmnSubject OPSubject} {
constructor
method destructor
method mcheck
}
constructor CMSubject {class this} {
set this [CMCmnSubject::constructor $class $this]
set this [OPSubject::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMSubject::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnSubject::destructor
}
selfPromoter OPSubject {this} {
CMSubject promote $this
}
method CMSubject::mcheck {this} {
my_debug "CMSubject::mcheck()"
m4_error $E_INVALID_SUBJECT [$this getName] [$this eventDiagram]
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmdbrevers.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMDBReverseLinkAttr : {OPDBReverseLinkAttr CMCmnAssocAttr} {
constructor
method destructor
method prepare
method oneGetPrepare
method manyGetPrepare
}
constructor CMDBReverseLinkAttr {class this} {
set this [OPDBReverseLinkAttr::constructor $class $this]
set this [CMCmnAssocAttr::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMDBReverseLinkAttr::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnAssocAttr::destructor
}
selfPromoter OPDBReverseLinkAttr {this} {
CMDBReverseLinkAttr promote $this
}
method CMDBReverseLinkAttr::prepare {this class model forwhat} {
$this prepareForLink $class $model $forwhat
}
method CMDBReverseLinkAttr::oneGetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [cap [$this getName]]
set op [$class addOperation get$name $type]
$this copyAccessMode $op r
}
method CMDBReverseLinkAttr::manyGetPrepare {this class model forwhat} {
# should not occur...
puts "ERROR: reverse link attribute '[$this getName]' with multiplicity \
'many' in class '[$class getName]'"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmdatabase.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMDatabaseClass : {CMCmnClass OPDatabaseClass} {
constructor
method destructor
method prepare
}
constructor CMDatabaseClass {class this} {
set this [CMCmnClass::constructor $class $this]
set this [OPDatabaseClass::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMDatabaseClass::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnClass::destructor
}
selfPromoter OPDatabaseClass {this} {
CMDatabaseClass promote $this
}
method CMDatabaseClass::prepare {this model forwhat} {
my_debug "CMDatabaseClass::prepare()"
# $this CMClass::prepare ...
$this CMCmnClass::prepare $model $forwhat
if {$forwhat == "check"} {
prepare_db_class $this $model
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmoperpara.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMOperParameter : {CMParameter OPOperParameter} {
constructor
method destructor
method prepare
}
constructor CMOperParameter {class this} {
set this [CMParameter::constructor $class $this]
set this [OPOperParameter::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMOperParameter::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMParameter::destructor
}
selfPromoter OPOperParameter {this} {
CMOperParameter promote $this
}
method CMOperParameter::prepare {this class model forwhat} {
my_debug "CMOperParameter::prepare()"
# empty
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmtypedeft.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMTypeDefType : {OPTypeDefType CMCmnType} {
constructor
method destructor
}
constructor CMTypeDefType {class this} {
set this [OPTypeDefType::constructor $class $this]
set this [CMCmnType::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMTypeDefType::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnType::destructor
}
selfPromoter OPTypeDefType {this} {
CMTypeDefType promote $this
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmlinkattr.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMLinkAttr : {CMCmnAssocAttr OPLinkAttr} {
constructor
method destructor
method prepare
method oneGetPrepare
method manyGetPrepare
}
constructor CMLinkAttr {class this} {
set this [CMCmnAssocAttr::constructor $class $this]
set this [OPLinkAttr::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMLinkAttr::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnAssocAttr::destructor
}
selfPromoter OPLinkAttr {this} {
CMLinkAttr promote $this
}
method CMLinkAttr::prepare {this class model forwhat} {
my_debug "CMLinkAttr::prepare()"
$this prepareForLink $class $model $forwhat
}
method CMLinkAttr::oneGetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [cap "${type}Of[cap [$this getName]]"]
set op [$class addOperation get$name $type]
$this copyAccessMode $op r
}
method CMLinkAttr::manyGetPrepare {this class model forwhat} {
set ordered [$this isOrdered]
set settype [set_type_name [$this ooplType] $ordered]
set setname [cap [set_name \
"[[$this ooplType] getName]Of[cap [$this getName]]" $ordered]]
catch {$model addClass $settype}
set op [$class addOperation get$setname $settype]
$this copyAccessMode $op r
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmqualasso.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMQualAssocAttr : {CMQualifAssocAttr OPQualAssocAttr} {
constructor
method destructor
method prepare
method oneGetPrepare
method oneSetPrepare
method oneRemovePrepare
method manyGetPrepare
method manySetPrepare
method manyRemovePrepare
}
constructor CMQualAssocAttr {class this} {
set this [CMQualifAssocAttr::constructor $class $this]
set this [OPQualAssocAttr::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMQualAssocAttr::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMQualifAssocAttr::destructor
}
selfPromoter OPQualAssocAttr {this} {
CMQualAssocAttr promote $this
}
method CMQualAssocAttr::prepare {this class model forwhat} {
my_debug "CMQualAssocAttr::prepare()"
$this prepareForAssoc $class $model $forwhat
}
method CMQualAssocAttr::oneGetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [cap [$this getName]]
set keyname [[$this qualifier] getName]
set keytype [[[$this qualifier] ooplType] getName]
set op [$class addOperation get$name $type]
$op addParameter $keyname $keytype
$this copyAccessMode $op r
}
method CMQualAssocAttr::oneSetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [cap [$this getName]]
set keyname [[$this qualifier] getName]
set keytype [[[$this qualifier] ooplType] getName]
set op [$class addOperation set$name ""]
$op addParameter $keyname $keytype
$op addParameter new$name $type
$this copyAccessMode $op w
}
method CMQualAssocAttr::oneRemovePrepare {this class model forwhat} {
set name [cap [$this getName]]
set keyname [[$this qualifier] getName]
set keytype [[[$this qualifier] ooplType] getName]
set op [$class addOperation remove$name ""]
$op addParameter $keyname $keytype
$this copyAccessMode $op w
}
method CMQualAssocAttr::manyGetPrepare {this class model forwhat} {
set settype [set_type_name [$this ooplType] [$this isOrdered]]
set setname [cap [$this getName]]
set keyname [[$this qualifier] getName]
set keytype [[[$this qualifier] ooplType] getName]
catch {$model addClass $settype}
set op [$class addOperation get$setname $settype]
$op addParameter $keyname $keytype
$this copyAccessMode $op r
}
method CMQualAssocAttr::manySetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [cap [$this getName]]
set keyname [[$this qualifier] getName]
set keytype [[[$this qualifier] ooplType] getName]
set op [$class addOperation add$name ""]
$op addParameter $keyname $keytype
$op addParameter new$name $type
$this copyAccessMode $op w
}
method CMQualAssocAttr::manyRemovePrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [cap [$this getName]]
set keyname [[$this qualifier] getName]
set keytype [[[$this qualifier] ooplType] getName]
set op [$class addOperation remove$name ""]
$op addParameter $keyname $keytype
$op addParameter old$name $type
$this copyAccessMode $op w
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmbdataatt.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMbDataAttr : {CMCmnAttr} {
constructor
method destructor
method mcheck
method getAccessMode
}
constructor CMbDataAttr {class this} {
set this [CMCmnAttr::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMbDataAttr::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnAttr::destructor
}
method CMbDataAttr::mcheck {this class} {
my_debug "CMbDataAttr::mcheck()"
# empty
}
method CMbDataAttr::getAccessMode {this} {
return [$this getPropertyValue attrib_access]
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmextevent.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMExtEvent : {CMReceivedEvent} {
constructor
method destructor
method init
method mcheck
}
constructor CMExtEvent {class this} {
set this [CMReceivedEvent::constructor $class $this]
# Start constructor user section
$this init
# End constructor user section
return $this
}
method CMExtEvent::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMReceivedEvent::destructor
}
method CMExtEvent::init {this} {
$this longType "External STD Event"
$this CMReceivedEvent::init
}
method CMExtEvent::mcheck {this class} {
my_debug "CMExtEvent::mcheck()"
$this checkEventAttributes $class
$this checkMethodForEvent $class
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmoperatio.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMOperation : {CMCmnOperation OPOperation} {
constructor
method destructor
method prepare
method checkAccess
}
constructor CMOperation {class this} {
set this [CMCmnOperation::constructor $class $this]
set this [OPOperation::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMOperation::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnOperation::destructor
}
selfPromoter OPOperation {this} {
CMOperation promote $this
}
method CMOperation::prepare {this class model forwhat} {
my_debug "CMOperation::prepare()"
foreach param [get_parameters $this] {
$param prepare $class $model $forwhat
}
}
method CMOperation::checkAccess {this needed} {
my_debug "CMOperation::checkAccess()"
#
# Given an access right string ("Private", "Protected",
# "Public", or "" as synonym for "Public", return whether this operation
# can be called.
#
set access [$this getPropertyValue method_access]
switch $needed {
"Private"
{if {$access == "None"} {
return 0
} else {
return 1
}}
"Protected"
{if {$access == "Private" || $access == "None"} {
return 0
} else {
return 1
}}
"Public"
{if {$access == "Private" || $access == "Protected" || $access == "None"} {
return 0
else
return 1
}}
}
return 1
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmevent.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMEvent : {CMCmnEvent OPEvent} {
constructor
method destructor
method findLeafEvents
method findParentEvents
method asStr
}
constructor CMEvent {class this} {
set this [CMCmnEvent::constructor $class $this]
set this [OPEvent::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMEvent::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnEvent::destructor
}
selfPromoter OPEvent {this} {
CMEvent promote $this
}
method CMEvent::findLeafEvents {this} {
#
# Return a list with all Event objects that are leaves of the event
# hierarchy with this event as root.
#
set leafs {}
foreach n [$this childEventSet] {
eval "lappend leafs [$n findLeafEvents]"
}
# if no decompositions, this event is a leaf event
if {$leafs == {}} {
lappend leafs $this
}
return $leafs
}
method CMEvent::findParentEvents {this} {
#
# Return a list with all parent events of this event
#
set parents {}
set parent [$this parentEvent]
while {$parent != ""} {
lappend parents $parent
set parent [$parent parentEvent]
}
return $parents
}
method CMEvent::asStr {this {attrs 0} {condact 0}} {
return "MGD Message '[$this getName]' in [$this getDiagramName].[$this getDiagramType]"
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmdiagsubj.tcl /main/titanic/3
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMDiagSubject : {CMCmnSubject} {
constructor
method destructor
method cadCheck
method ccdCheck
}
constructor CMDiagSubject {class this} {
set this [CMCmnSubject::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMDiagSubject::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnSubject::destructor
}
method CMDiagSubject::cadCheck {this} {
#
# Check if each received event of this subject is handled by one of
# the classes in this CAD.
#
if {[M4CheckManager::errorControl $E_NO_MATCHING_OPER_IN_SUBJECT] == "off"} {
return
}
set subjectName [$this getName]
set subjectType [$this get_obj_type]
set diagramName "[$this getDiagramName].[$this getDiagramType]"
#
# Load and prepare the model for all classes in the diagram and
# check for every event received by this subject whether it is
# handled by some class.
#
if {[catch {set classes [get_diagram_classes $subjectName cad]} msg]} {
puts stdout $msg
return
}
if {[lempty $classes]} {
m4_error $E_SUBJECT_IS_EMPTY CD $subjectName $diagramName
return
}
set modelChecker [ModelChecker new $classes ccd]
$modelChecker loadModel 0 1 0
if {[$modelChecker ooModel] == ""} {
m4_message $M_LOADING_MODEL_FAILED $subjectType $subjectName
return
}
[$modelChecker ooplModel] prepare [$modelChecker ooplClasses] [$modelChecker ooplSubjects] check
foreach recvEv [$this getReceivedEvents] {
set found 0
foreach class [$modelChecker ooplClasses] {
if {[$recvEv checkMethodForEvent $class "" 1]} {
set found 1
break
}
}
if {!$found} {
m4_error $E_NO_MATCHING_OPER_IN_SUBJECT CD $subjectName [$recvEv asStr]
}
}
[$modelChecker ooModel] delete
}
method CMDiagSubject::ccdCheck {this} {
#
# Check if each received event of this subject is received by one of the
# classes in the CCD specified by this subject. This CCD should exist in
# the current system.
#
# This function assumes that all classes occurring in the CCD have been
# loaded in the current oopl model.
#
if {[M4CheckManager::errorControl $E_NO_MATCHING_OPER_IN_SUBJECT] == "off"} {
return
}
set subjectName [$this getName]
set subjectType [$this get_obj_type]
set diagramName "[$this getDiagramName].[$this getDiagramType]"
if {[catch {set classes [get_diagram_classes $subjectName ccd]} msg]} {
puts stdout $msg
return
}
foreach recvEv [$this getReceivedEvents] {
set name [$recvEv getName]
set found 0
foreach class $classes {
set ooplClass [$ooplmodel findClass $class]
if {$ooplClass != ""} {
foreach recvEv2 [$ooplClass getReceivedEvents] {
if {$name == [$recvEv2 getName]} {
set found 1
break
}
}
}
if {$found} {
break
}
}
if {!$found} {
m4_error $E_NO_MATCHING_MSG_IN_SUBJECT $recvEvName $subjectName $diagramName
}
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmccdsubje.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMCCDSubject : {CMDiagSubject OPCCDSubject} {
constructor
method destructor
method mcheck
}
constructor CMCCDSubject {class this} {
set this [CMDiagSubject::constructor $class $this]
set this [OPCCDSubject::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMCCDSubject::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMDiagSubject::destructor
}
selfPromoter OPCCDSubject {this} {
CMCCDSubject promote $this
}
method CMCCDSubject::mcheck {this} {
my_debug "CMCCDSubject::mcheck()"
$this ccdCheck
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmquallink.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMQualLinkAttr : {OPQualLinkAttr CMQualifAssocAttr} {
constructor
method destructor
method prepare
method oneGetPrepare
method manyGetPrepare
}
constructor CMQualLinkAttr {class this} {
set this [OPQualLinkAttr::constructor $class $this]
set this [CMQualifAssocAttr::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMQualLinkAttr::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMQualifAssocAttr::destructor
}
selfPromoter OPQualLinkAttr {this} {
CMQualLinkAttr promote $this
}
method CMQualLinkAttr::prepare {this class model forwhat} {
my_debug "CMQualLinkAttr::prepare()"
$this prepareForLink $class $model $forwhat
}
method CMQualLinkAttr::oneGetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [cap [[$this ooplType] getName]Of[cap [$this getName]]]
set keyname [[$this qualifier] getName]
set keytype [[[$this qualifier] ooplType] getName]
set op [$class addOperation get$name $type]
$op addParameter $keyname $keytype
$this copyAccessMode $op r
}
method CMQualLinkAttr::manyGetPrepare {this class model forwhat} {
set settype [set_type_name [$this ooplType] [$this isOrdered]]
set setname [cap [[$this ooplType] getName]Of[cap [$this getName]]]
set keyname [ [$this qualifier] getName]
set keytype [[[$this qualifier] ooplType] getName]
catch {$model addClass $settype}
set op [$class addOperation get$setname $settype]
$op addParameter $keyname $keytype
$this copyAccessMode $op r
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmbasetype.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMBaseType : {CMCmnType OPBaseType} {
constructor
method destructor
}
constructor CMBaseType {class this} {
set this [CMCmnType::constructor $class $this]
set this [OPBaseType::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMBaseType::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnType::destructor
}
selfPromoter OPBaseType {this} {
CMBaseType promote $this
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmclass.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMClass : {CMCmnClass OPClass} {
constructor
method destructor
}
constructor CMClass {class this} {
set this [CMCmnClass::constructor $class $this]
set this [OPClass::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMClass::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnClass::destructor
}
selfPromoter OPClass {this} {
CMClass promote $this
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmlinkclas.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMLinkClass : {CMCmnClass OPLinkClass} {
constructor
method destructor
}
constructor CMLinkClass {class this} {
set this [CMCmnClass::constructor $class $this]
set this [OPLinkClass::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMLinkClass::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnClass::destructor
}
selfPromoter OPLinkClass {this} {
CMLinkClass promote $this
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmclassenu.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMClassEnum : {CMSpecialClass OPClassEnum} {
constructor
method destructor
}
constructor CMClassEnum {class this} {
set this [CMSpecialClass::constructor $class $this]
set this [OPClassEnum::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMClassEnum::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMSpecialClass::destructor
}
selfPromoter OPClassEnum {this} {
CMClassEnum promote $this
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmdbqualas.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMDBQualAssocAttr : {CMQualifAssocAttr OPDBQualAssocAttr} {
constructor
method destructor
method prepare
method oneGetPrepare
method oneSetPrepare
method oneRemovePrepare
method manyGetPrepare
method manySetPrepare
method manyRemovePrepare
method anySetPrepare
}
constructor CMDBQualAssocAttr {class this} {
set this [CMQualifAssocAttr::constructor $class $this]
set this [OPDBQualAssocAttr::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMDBQualAssocAttr::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMQualifAssocAttr::destructor
}
selfPromoter OPDBQualAssocAttr {this} {
CMDBQualAssocAttr promote $this
}
method CMDBQualAssocAttr::prepare {this class model forwhat} {
my_debug "CMDBQualAssocAttr::prepare()"
$this prepareForAssoc $class $model $forwhat
}
method CMDBQualAssocAttr::oneGetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [$this getName]
set keyname [[$this qualifier] getName]
set keytype [[[$this qualifier] ooplType] getName]
set op [$class addOperation "get[cap $name]" $type]
$op addParameter $keyname $keytype
$this copyAccessMode $op r
}
method CMDBQualAssocAttr::oneSetPrepare {this class model forwhat} {
$this anySetPrepare $class $model $forwhat "set"
}
method CMDBQualAssocAttr::oneRemovePrepare {this class model forwhat} {
set name [cap [$this getName]]
set keyname [[$this qualifier] getName]
set keytype [[[$this qualifier] ooplType] getName]
set op [$class addOperation remove$name int]
$op addParameter $keyname $keytype
$this copyAccessMode $op w
}
method CMDBQualAssocAttr::manyGetPrepare {this class model forwhat} {
set name [$this getName]
set settype [set_type_name [$this ooplType]]
set setname [cap [set_name $name]]
set keyname [[$this qualifier] getName]
set keytype [[[$this qualifier] ooplType] getName]
catch {$model addClass $settype}
set op [$class addOperation get$setname int]
$op addParameter $setname $settype
$op addParameter $keyname $keytype
$this copyAccessMode $op r
}
method CMDBQualAssocAttr::manySetPrepare {this class model forwhat} {
$this anySetPrepare $class $model $forwhat "add"
}
method CMDBQualAssocAttr::manyRemovePrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [cap [$this getName]]
set keyname [[$this qualifier] getName]
set keytype [[[$this qualifier] ooplType] getName]
set op [$class addOperation remove$name int]
$op addParameter $keyname $keytype
$op addParameter toRemove $type
$this copyAccessMode $op w
}
method CMDBQualAssocAttr::anySetPrepare {this class model forwhat prefix} {
set type [[$this ooplType] getName]
set name [cap [$this getName]]
set keyname [[$this qualifier] getName]
set keytype [[[$this qualifier] ooplType] getName]
set op [$class addOperation $prefix$name int]
$op addParameter $keyname $keytype
$op addParameter new$name $type
$this copyAccessMode $op w
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmdataattr.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMDataAttr : {CMbDataAttr OPDataAttr} {
constructor
method destructor
method prepare
}
constructor CMDataAttr {class this} {
set this [CMbDataAttr::constructor $class $this]
set this [OPDataAttr::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMDataAttr::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMbDataAttr::destructor
}
selfPromoter OPDataAttr {this} {
CMDataAttr promote $this
}
method CMDataAttr::prepare {this class model forwhat} {
my_debug "CMDataAttr::prepare()"
set mdf [$this getPropertyValue modifier]
if {$mdf != "" && $mdf != "Default"} {
# when a modifier is specified
# do not generate access funcs
return
}
set name [cap [$this getName]]
set type [[$this ooplType] getName]
set op [$class addOperation get$name $type]
$this copyAccessMode $op r
set op [$class addOperation set$name ""]
$op addParameter new$name $type
$this copyAccessMode $op w
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmclasstde.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMClassTDef : {CMSpecialClass OPClassTDef} {
constructor
method destructor
}
constructor CMClassTDef {class this} {
set this [CMSpecialClass::constructor $class $this]
set this [OPClassTDef::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMClassTDef::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMSpecialClass::destructor
}
selfPromoter OPClassTDef {this} {
CMClassTDef promote $this
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmtraceeve.tcl /main/titanic/3
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMTraceEvent : {CMReceivedEvent} {
constructor
method destructor
method init
method mcheck
method checkCorrCcdMessage
method checkEtdTimes
}
constructor CMTraceEvent {class this} {
set this [CMReceivedEvent::constructor $class $this]
# Start constructor user section
$this init
# End constructor user section
return $this
}
method CMTraceEvent::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMReceivedEvent::destructor
}
method CMTraceEvent::init {this} {
$this longType "SD Message"
$this CMReceivedEvent::init
}
method CMTraceEvent::mcheck {this class} {
my_debug "CMTraceEvent::mcheck()"
$this checkEventAttributes $class
$this checkCorrCcdMessage $class
$this checkEtdTimes $class
$this checkMethodForEvent $class
}
method CMTraceEvent::checkCorrCcdMessage {this class} {
my_debug "CMTraceEvent::checkCorrCcdMessage()"
#
# Check to see if this trace_event occurs as any comm_message to the
# same class as the trace_event in any CCD in the system.
#
# This function assumes that the comm_message events are loaded in the
# ooplmodel (i.e. that "ccd" was passed to option "-events").
#
if {[M4CheckManager::errorControl $E_NO_CORR_CCDMSG_FOUND] == "off"} {
return
}
set r_name [$this getName]
set r_found 0
foreach ccd_r [$class getReceivedEvents] {
if {[$ccd_r getEventType] == "comm_message" && [$ccd_r getName] == $r_name} {
set r_found 1
break
}
}
if {!$r_found} {
m4_warning $E_NO_CORR_CCDMSG_FOUND [$this asStr] \
[$this getSenderName] [$class getName]
}
}
method CMTraceEvent::checkEtdTimes {this class} {
my_debug "CMTraceEvent::checkEtdTimes()"
#
# If this event has the receiving object as the sending object, check
# if the arrival time is later than the send time.
#
#
# Does not work, for two reasons:
# 1) save diagram does not update begin_y/end_y when stripping diagram,
# so that only coordinates of first connector are saved (if intermediate
# vertices are used)
# 2) given class may have two distinct 'timelines' in the same
# diagram, and the event may be sent from one to the other,
# making it invalid to compare src and dst times
# This check is better done in libetd.
#
if 0 {
if {[$this getSenderName] == [$class getName]} {
if {[get_dst_time $this] < [get_src_time $this]} {
m4_error $E_RECEIVED_BEFORE_SENT \
[$class getName] [$this asStr]
}
}
} # 0
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmclasstyp.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMClassType : {CMCmnType OPClassType} {
constructor
method destructor
}
constructor CMClassType {class this} {
set this [CMCmnType::constructor $class $this]
set this [OPClassType::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMClassType::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnType::destructor
}
selfPromoter OPClassType {this} {
CMClassType promote $this
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmassocatt.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMAssocAttr : {CMCmnAssocAttr OPAssocAttr} {
constructor
method destructor
method prepare
method oneGetPrepare
method oneSetPrepare
method oneRemovePrepare
method manyGetPrepare
method manySetPrepare
method manyRemovePrepare
}
constructor CMAssocAttr {class this} {
set this [CMCmnAssocAttr::constructor $class $this]
set this [OPAssocAttr::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMAssocAttr::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnAssocAttr::destructor
}
selfPromoter OPAssocAttr {this} {
CMAssocAttr promote $this
}
method CMAssocAttr::prepare {this class model forwhat} {
my_debug "CMAssocAttr::prepare()"
$this prepareForAssoc $class $model $forwhat
}
method CMAssocAttr::oneGetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [cap [$this getName]]
set op [$class addOperation get$name $type]
$this copyAccessMode $op r
}
method CMAssocAttr::oneSetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [cap [$this getName]]
set op [$class addOperation set$name ""]
$op addParameter new$name $type
$this copyAccessMode $op w
}
method CMAssocAttr::oneRemovePrepare {this class model forwhat} {
set name [cap [$this getName]]
set op [$class addOperation remove$name ""]
$this copyAccessMode $op w
}
method CMAssocAttr::manyGetPrepare {this class model forwhat} {
set ordered [$this isOrdered]
set settype [set_type_name [$this ooplType] $ordered]
set setname [cap [set_name [$this getName] $ordered]]
catch {$model addClass $settype}
set op [$class addOperation get$setname $settype]
$this copyAccessMode $op r
}
method CMAssocAttr::manySetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [cap [$this getName]]
set op [$class addOperation add$name ""]
$op addParameter new$name $type
$this copyAccessMode $op w
}
method CMAssocAttr::manyRemovePrepare {this class model forwhat} {
if [$this isMandatory] {
return
}
set type [[$this ooplType] getName]
set name [cap [$this getName]]
set op [$class addOperation remove$name ""]
$op addParameter old$name $type
$this copyAccessMode $op w
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmcadccdsu.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMCADCCDSubject : {CMDiagSubject OPCADCCDSubject} {
constructor
method destructor
method mcheck
}
constructor CMCADCCDSubject {class this} {
set this [CMDiagSubject::constructor $class $this]
set this [OPCADCCDSubject::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMCADCCDSubject::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMDiagSubject::destructor
}
selfPromoter OPCADCCDSubject {this} {
CMCADCCDSubject promote $this
}
method CMCADCCDSubject::mcheck {this} {
my_debug "CMCADCCDSubject::mcheck()"
$this cadCheck
$this ccdCheck
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmsystemsu.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMSystemSubject : {CMCmnSubject OPSystemSubject} {
constructor
method destructor
method mcheck
}
constructor CMSystemSubject {class this} {
set this [CMCmnSubject::constructor $class $this]
set this [OPSystemSubject::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMSystemSubject::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnSubject::destructor
}
selfPromoter OPSystemSubject {this} {
CMSystemSubject promote $this
}
method CMSystemSubject::mcheck {this} {
my_debug "CMSystemSubject::mcheck()"
#
# Check if each received event of this subject is handled by one of
# the classes in this system.
#
if {[M4CheckManager::errorControl $E_NO_MATCHING_OPER_IN_SUBJECT] == "off"} {
return
}
set currSystemVersion [[ClientContext::global] currentSystem]
if {[$currSystemVersion isNil]} {
set systemName ""
} else {
set systemName [[$currSystemVersion system] name]
}
set subjectName [$this getName]
set subjectType [$this get_obj_type]
set diagramName "[$this getDiagramName].[$this getDiagramType]"
#
# Go to the system specified by this subject, load and prepare the model
# for all classes in the system and check for every event received by
# this subject whether it is handled by some class.
#
if {[catch {fstorage::goto_system $subjectName} msg]} {
m4_error $E_BAD_SYSTEM_SUBJECT $subjectName $diagramName $msg
return
}
if {[catch {set classes [get_system_classes]} msg]} {
puts stdout $msg
catch {fstorage::goto_system $systemName}
return
}
if {[lempty $classes]} {
m4_error $E_SUBJECT_IS_EMPTY System $subjectName $diagramName
catch {fstorage::goto_system $systemName}
return
}
set modelChecker [ModelChecker new $classes ccd]
$modelChecker loadModel 0 1 0
if {[$modelChecker ooModel] == ""} {
m4_message $M_LOADING_SUBJMODEL_FAILED $subjectType $subjectName
catch {fstorage::goto_system $systemName}
return
}
[$modelChecker ooplModel] prepare [$modelChecker ooplClasses] [$modelChecker ooplSubjects] check
foreach recvEv [$this getReceivedEvents] {
set found 0
foreach class [$modelChecker ooplClasses] {
if {[$recvEv checkMethodForEvent $class "" 1]} {
set found 1
break
}
}
if {!$found} {
m4_error $E_NO_MATCHING_OPER_IN_SUBJECT system $subjectName [$recvEv asStr]
}
}
[$modelChecker ooModel] delete
#
# Go to the original system
#
if {[catch {fstorage::goto_system $systemName} msg]} {
puts stdout $msg
return
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmdblinkat.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMDBLinkAttr : {CMCmnAssocAttr OPDBLinkAttr} {
constructor
method destructor
method prepare
method oneGetPrepare
method manyGetPrepare
}
constructor CMDBLinkAttr {class this} {
set this [CMCmnAssocAttr::constructor $class $this]
set this [OPDBLinkAttr::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMDBLinkAttr::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnAssocAttr::destructor
}
selfPromoter OPDBLinkAttr {this} {
CMDBLinkAttr promote $this
}
method CMDBLinkAttr::prepare {this class model forwhat} {
$this prepareForLink $class $model $forwhat
}
method CMDBLinkAttr::oneGetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [cap "${type}Of[cap [$this getName]]"]
set op [$class addOperation get$name $type]
$this copyAccessMode $op r
}
method CMDBLinkAttr::manyGetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [$this getName]
set settype [set_type_name [$this ooplType]]
set setname [cap [set_name $name]]
set func_name get[cap [set_name "${type}Of[cap $name]"]]
catch {$model addClass $settype}
set op [$class addOperation $func_name int]
$op addParameter $setname $settype
$this copyAccessMode $op r
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmenumtype.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMEnumType : {CMCmnType OPEnumType} {
constructor
method destructor
}
constructor CMEnumType {class this} {
set this [CMCmnType::constructor $class $this]
set this [OPEnumType::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMEnumType::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnType::destructor
}
selfPromoter OPEnumType {this} {
CMEnumType promote $this
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmreversel.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMReverseLinkAttr : {CMCmnAssocAttr OPReverseLinkAttr} {
constructor
method destructor
method prepare
method oneGetPrepare
method manyGetPrepare
}
constructor CMReverseLinkAttr {class this} {
set this [CMCmnAssocAttr::constructor $class $this]
set this [OPReverseLinkAttr::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMReverseLinkAttr::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnAssocAttr::destructor
}
selfPromoter OPReverseLinkAttr {this} {
CMReverseLinkAttr promote $this
}
method CMReverseLinkAttr::prepare {this class model forwhat} {
my_debug "CMReverseLinkAttr::prepare()"
$this prepareForLink $class $model $forwhat
}
method CMReverseLinkAttr::oneGetPrepare {this class model forwhat} {
set type [[$this ooplType] getName]
set name [cap [$this getName]]
set op [$class addOperation get$name $type]
$this copyAccessMode $op r
}
method CMReverseLinkAttr::manyGetPrepare {this class model forwhat} {
# does not occur
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmeventmes.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMEventMessage : {CMReceivedEvent} {
constructor
method destructor
method init
method mcheck
}
constructor CMEventMessage {class this} {
set this [CMReceivedEvent::constructor $class $this]
# Start constructor user section
$this init
# End constructor user section
return $this
}
method CMEventMessage::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMReceivedEvent::destructor
}
method CMEventMessage::init {this} {
$this longType "STD Event Message"
$this CMReceivedEvent::init
}
method CMEventMessage::mcheck {this class} {
my_debug "CMEventMessage::mcheck()"
$this checkEventAttributes $class
$this checkMethodForEvent $class
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmctorpara.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMCtorParameter : {OPCtorParameter CMParameter} {
constructor
method destructor
method prepare
}
constructor CMCtorParameter {class this} {
set this [OPCtorParameter::constructor $class $this]
set this [CMParameter::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMCtorParameter::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMParameter::destructor
}
selfPromoter OPCtorParameter {this} {
CMCtorParameter promote $this
}
method CMCtorParameter::prepare {this class model forwhat} {
my_debug "CMCtorParameter::prepare()"
# empty
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmdbdataat.tcl /main/titanic/1
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMDBDataAttr : {CMbDataAttr OPDBDataAttr} {
constructor
method destructor
method prepare
}
constructor CMDBDataAttr {class this} {
set this [CMbDataAttr::constructor $class $this]
set this [OPDBDataAttr::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMDBDataAttr::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMbDataAttr::destructor
}
selfPromoter OPDBDataAttr {this} {
CMDBDataAttr promote $this
}
method CMDBDataAttr::prepare {this class model forwhat} {
set name [cap [$this getName]]
set type [[$this ooplType] getName]
set column [$this column]
set op [$class addOperation get$name $type]
$this copyAccessMode $op r
if {[$column getColumnType] == "field"} {
set op [$class addOperation set$name ""]
$op addParameter new$name $type
$this copyAccessMode $op w
}
if [$column isNullable] {
set op [$class addOperation "[uncap $name]IsNull" int]
$this copyAccessMode $op r
set op [$class addOperation nullify$name ""]
$this copyAccessMode $op w
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmcadsubje.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMCADSubject : {CMDiagSubject OPCADSubject} {
constructor
method destructor
method mcheck
}
constructor CMCADSubject {class this} {
set this [CMDiagSubject::constructor $class $this]
set this [OPCADSubject::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMCADSubject::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMDiagSubject::destructor
}
selfPromoter OPCADSubject {this} {
CMCADSubject promote $this
}
method CMCADSubject::mcheck {this} {
my_debug "CMCADSubject::mcheck()"
$this cadCheck
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmdblinkcl.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMDBLinkClass : {CMCmnClass OPDBLinkClass} {
constructor
method destructor
method prepare
}
constructor CMDBLinkClass {class this} {
set this [CMCmnClass::constructor $class $this]
set this [OPDBLinkClass::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method CMDBLinkClass::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMCmnClass::destructor
}
selfPromoter OPDBLinkClass {this} {
CMDBLinkClass promote $this
}
method CMDBLinkClass::prepare {this model forwhat} {
my_debug "CMDBLinkClass::prepare()"
# $this CMLinkClass::prepare ...
$this CMCmnClass::prepare $model $forwhat
if {$forwhat == "check"} {
prepare_db_class $this $model
}
}
# Do not delete this line -- regeneration end marker
#---------------------------------------------------------------------------
# File: @(#)cmcommmess.tcl /main/titanic/2
#---------------------------------------------------------------------------
# Start user added include file section
# End user added include file section
Class CMCommMessage : {CMReceivedEvent} {
constructor
method destructor
method init
method mcheck
}
constructor CMCommMessage {class this} {
set this [CMReceivedEvent::constructor $class $this]
# Start constructor user section
$this init
# End constructor user section
return $this
}
method CMCommMessage::destructor {this} {
# Start destructor user section
# End destructor user section
$this CMReceivedEvent::destructor
}
method CMCommMessage::init {this} {
$this longType "CCD Communication Message"
$this CMReceivedEvent::init
}
method CMCommMessage::mcheck {this class} {
my_debug "CMCommMessage::mcheck()"
$this checkMethodForEvent $class
}
# Do not delete this line -- regeneration end marker