summaryrefslogtreecommitdiffstats
path: root/src/uml
diff options
context:
space:
mode:
authorSandro S. Andrade <sandroandrade@kde.org>2013-09-04 16:38:54 -0300
committerSandro S. Andrade <sandroandrade@kde.org>2013-09-04 21:38:16 +0200
commit61f9748061ef752b5617ec244a8f451700dc18f4 (patch)
tree66dd61031a506844e0dfd8ad52f598b3989121d4 /src/uml
parentdf7fb2f660e151d0c5fbe62f90be9437ed190087 (diff)
Add implementation of clone() in all UML metamodel objects
Change-Id: I9bb9c90159b813ee7d7b941b9fbb1d6f426bf487 Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'src/uml')
-rw-r--r--src/uml/qobjects/qumlactivityobject.cpp22
-rw-r--r--src/uml/qobjects/qumlactorobject.cpp18
-rw-r--r--src/uml/qobjects/qumlartifactobject.cpp18
-rw-r--r--src/uml/qobjects/qumlassociationobject.cpp18
-rw-r--r--src/uml/qumlabstraction.cpp37
-rw-r--r--src/uml/qumlabstraction.h2
-rw-r--r--src/uml/qumlacceptcallaction.cpp67
-rw-r--r--src/uml/qumlacceptcallaction.h2
-rw-r--r--src/uml/qumlaccepteventaction.cpp70
-rw-r--r--src/uml/qumlaccepteventaction.h2
-rw-r--r--src/uml/qumlaction.cpp71
-rw-r--r--src/uml/qumlaction.h2
-rw-r--r--src/uml/qumlactionexecutionspecification.cpp44
-rw-r--r--src/uml/qumlactionexecutionspecification.h2
-rw-r--r--src/uml/qumlactioninputpin.cpp73
-rw-r--r--src/uml/qumlactioninputpin.h2
-rw-r--r--src/uml/qumlactivity.cpp158
-rw-r--r--src/uml/qumlactivity.h2
-rw-r--r--src/uml/qumlactivityedge.cpp73
-rw-r--r--src/uml/qumlactivityedge.h2
-rw-r--r--src/uml/qumlactivityfinalnode.cpp45
-rw-r--r--src/uml/qumlactivityfinalnode.h2
-rw-r--r--src/uml/qumlactivitygroup.cpp39
-rw-r--r--src/uml/qumlactivitygroup.h2
-rw-r--r--src/uml/qumlactivitynode.cpp63
-rw-r--r--src/uml/qumlactivitynode.h2
-rw-r--r--src/uml/qumlactivityparameternode.cpp65
-rw-r--r--src/uml/qumlactivityparameternode.h2
-rw-r--r--src/uml/qumlactivitypartition.cpp58
-rw-r--r--src/uml/qumlactivitypartition.h2
-rw-r--r--src/uml/qumlactor.cpp84
-rw-r--r--src/uml/qumlactor.h2
-rw-r--r--src/uml/qumladdstructuralfeaturevalueaction.cpp74
-rw-r--r--src/uml/qumladdstructuralfeaturevalueaction.h2
-rw-r--r--src/uml/qumladdvariablevalueaction.cpp70
-rw-r--r--src/uml/qumladdvariablevalueaction.h2
-rw-r--r--src/uml/qumlanyreceiveevent.cpp27
-rw-r--r--src/uml/qumlanyreceiveevent.h2
-rw-r--r--src/uml/qumlartifact.cpp100
-rw-r--r--src/uml/qumlartifact.h2
-rw-r--r--src/uml/qumlassociation.cpp97
-rw-r--r--src/uml/qumlassociation.h2
-rw-r--r--src/uml/qumlassociationclass.cpp109
-rw-r--r--src/uml/qumlassociationclass.h2
-rw-r--r--src/uml/qumlbehavior.cpp138
-rw-r--r--src/uml/qumlbehavior.h2
-rw-r--r--src/uml/qumlbehavioralfeature.cpp63
-rw-r--r--src/uml/qumlbehavioralfeature.h2
-rw-r--r--src/uml/qumlbehavioredclassifier.cpp92
-rw-r--r--src/uml/qumlbehavioredclassifier.h2
-rw-r--r--src/uml/qumlbehaviorexecutionspecification.cpp44
-rw-r--r--src/uml/qumlbehaviorexecutionspecification.h2
-rw-r--r--src/uml/qumlbroadcastsignalaction.cpp67
-rw-r--r--src/uml/qumlbroadcastsignalaction.h2
-rw-r--r--src/uml/qumlcallaction.cpp70
-rw-r--r--src/uml/qumlcallaction.h2
-rw-r--r--src/uml/qumlcallbehavioraction.cpp70
-rw-r--r--src/uml/qumlcallbehavioraction.h2
-rw-r--r--src/uml/qumlcallevent.cpp33
-rw-r--r--src/uml/qumlcallevent.h2
-rw-r--r--src/uml/qumlcalloperationaction.cpp74
-rw-r--r--src/uml/qumlcalloperationaction.h2
-rw-r--r--src/uml/qumlcentralbuffernode.cpp59
-rw-r--r--src/uml/qumlcentralbuffernode.h2
-rw-r--r--src/uml/qumlchangeevent.cpp33
-rw-r--r--src/uml/qumlchangeevent.h2
-rw-r--r--src/uml/qumlclass.cpp120
-rw-r--r--src/uml/qumlclass.h2
-rw-r--r--src/uml/qumlclassifier.cpp114
-rw-r--r--src/uml/qumlclassifier.h2
-rw-r--r--src/uml/qumlclassifiertemplateparameter.cpp35
-rw-r--r--src/uml/qumlclassifiertemplateparameter.h2
-rw-r--r--src/uml/qumlclause.cpp41
-rw-r--r--src/uml/qumlclause.h2
-rw-r--r--src/uml/qumlclearassociationaction.cpp66
-rw-r--r--src/uml/qumlclearassociationaction.h2
-rw-r--r--src/uml/qumlclearstructuralfeatureaction.cpp66
-rw-r--r--src/uml/qumlclearstructuralfeatureaction.h2
-rw-r--r--src/uml/qumlclearvariableaction.cpp59
-rw-r--r--src/uml/qumlclearvariableaction.h2
-rw-r--r--src/uml/qumlcollaboration.cpp95
-rw-r--r--src/uml/qumlcollaboration.h2
-rw-r--r--src/uml/qumlcollaborationuse.cpp31
-rw-r--r--src/uml/qumlcollaborationuse.h2
-rw-r--r--src/uml/qumlcombinedfragment.cpp47
-rw-r--r--src/uml/qumlcombinedfragment.h2
-rw-r--r--src/uml/qumlcomment.cpp18
-rw-r--r--src/uml/qumlcomment.h2
-rw-r--r--src/uml/qumlcommunicationpath.cpp83
-rw-r--r--src/uml/qumlcommunicationpath.h2
-rw-r--r--src/uml/qumlcomponent.cpp121
-rw-r--r--src/uml/qumlcomponent.h2
-rw-r--r--src/uml/qumlcomponentrealization.cpp45
-rw-r--r--src/uml/qumlcomponentrealization.h2
-rw-r--r--src/uml/qumlconditionalnode.cpp93
-rw-r--r--src/uml/qumlconditionalnode.h2
-rw-r--r--src/uml/qumlconnectableelement.cpp37
-rw-r--r--src/uml/qumlconnectableelement.h2
-rw-r--r--src/uml/qumlconnectableelementtemplateparameter.cpp26
-rw-r--r--src/uml/qumlconnectableelementtemplateparameter.h2
-rw-r--r--src/uml/qumlconnectionpointreference.cpp42
-rw-r--r--src/uml/qumlconnectionpointreference.h2
-rw-r--r--src/uml/qumlconnector.cpp49
-rw-r--r--src/uml/qumlconnector.h2
-rw-r--r--src/uml/qumlconnectorend.cpp32
-rw-r--r--src/uml/qumlconnectorend.h2
-rw-r--r--src/uml/qumlconsiderignorefragment.cpp44
-rw-r--r--src/uml/qumlconsiderignorefragment.h2
-rw-r--r--src/uml/qumlconstraint.cpp41
-rw-r--r--src/uml/qumlconstraint.h2
-rw-r--r--src/uml/qumlcontinuation.cpp37
-rw-r--r--src/uml/qumlcontinuation.h2
-rw-r--r--src/uml/qumlcontrolflow.cpp50
-rw-r--r--src/uml/qumlcontrolflow.h2
-rw-r--r--src/uml/qumlcontrolnode.cpp45
-rw-r--r--src/uml/qumlcontrolnode.h2
-rw-r--r--src/uml/qumlcreatelinkaction.cpp66
-rw-r--r--src/uml/qumlcreatelinkaction.h2
-rw-r--r--src/uml/qumlcreatelinkobjectaction.cpp68
-rw-r--r--src/uml/qumlcreatelinkobjectaction.h2
-rw-r--r--src/uml/qumlcreateobjectaction.cpp65
-rw-r--r--src/uml/qumlcreateobjectaction.h2
-rw-r--r--src/uml/qumldatastorenode.cpp59
-rw-r--r--src/uml/qumldatastorenode.h2
-rw-r--r--src/uml/qumldatatype.cpp85
-rw-r--r--src/uml/qumldatatype.h2
-rw-r--r--src/uml/qumldecisionnode.cpp56
-rw-r--r--src/uml/qumldecisionnode.h2
-rw-r--r--src/uml/qumldependency.cpp36
-rw-r--r--src/uml/qumldependency.h2
-rw-r--r--src/uml/qumldeployedartifact.cpp21
-rw-r--r--src/uml/qumldeployedartifact.h2
-rw-r--r--src/uml/qumldeployment.cpp47
-rw-r--r--src/uml/qumldeployment.h2
-rw-r--r--src/uml/qumldeploymentspecification.cpp102
-rw-r--r--src/uml/qumldeploymentspecification.h2
-rw-r--r--src/uml/qumldeploymenttarget.cpp30
-rw-r--r--src/uml/qumldeploymenttarget.h2
-rw-r--r--src/uml/qumldestroylinkaction.cpp66
-rw-r--r--src/uml/qumldestroylinkaction.h2
-rw-r--r--src/uml/qumldestroyobjectaction.cpp69
-rw-r--r--src/uml/qumldestroyobjectaction.h2
-rw-r--r--src/uml/qumldestructionoccurrencespecification.cpp40
-rw-r--r--src/uml/qumldestructionoccurrencespecification.h2
-rw-r--r--src/uml/qumldevice.cpp108
-rw-r--r--src/uml/qumldevice.h2
-rw-r--r--src/uml/qumldirectedrelationship.cpp16
-rw-r--r--src/uml/qumldirectedrelationship.h2
-rw-r--r--src/uml/qumlduration.cpp42
-rw-r--r--src/uml/qumlduration.h2
-rw-r--r--src/uml/qumldurationconstraint.cpp43
-rw-r--r--src/uml/qumldurationconstraint.h2
-rw-r--r--src/uml/qumldurationinterval.cpp42
-rw-r--r--src/uml/qumldurationinterval.h2
-rw-r--r--src/uml/qumldurationobservation.cpp36
-rw-r--r--src/uml/qumldurationobservation.h2
-rw-r--r--src/uml/qumlelement.cpp18
-rw-r--r--src/uml/qumlelement.h2
-rw-r--r--src/uml/qumlelementimport.cpp29
-rw-r--r--src/uml/qumlelementimport.h2
-rw-r--r--src/uml/qumlencapsulatedclassifier.cpp86
-rw-r--r--src/uml/qumlencapsulatedclassifier.h2
-rw-r--r--src/uml/qumlenumeration.cpp87
-rw-r--r--src/uml/qumlenumeration.h2
-rw-r--r--src/uml/qumlenumerationliteral.cpp47
-rw-r--r--src/uml/qumlenumerationliteral.h2
-rw-r--r--src/uml/qumlevent.cpp27
-rw-r--r--src/uml/qumlevent.h2
-rw-r--r--src/uml/qumlexceptionhandler.cpp31
-rw-r--r--src/uml/qumlexceptionhandler.h2
-rw-r--r--src/uml/qumlexecutablenode.cpp51
-rw-r--r--src/uml/qumlexecutablenode.h2
-rw-r--r--src/uml/qumlexecutionenvironment.cpp108
-rw-r--r--src/uml/qumlexecutionenvironment.h2
-rw-r--r--src/uml/qumlexecutionoccurrencespecification.cpp43
-rw-r--r--src/uml/qumlexecutionoccurrencespecification.h2
-rw-r--r--src/uml/qumlexecutionspecification.cpp44
-rw-r--r--src/uml/qumlexecutionspecification.h2
-rw-r--r--src/uml/qumlexpansionnode.cpp70
-rw-r--r--src/uml/qumlexpansionnode.h2
-rw-r--r--src/uml/qumlexpansionregion.cpp92
-rw-r--r--src/uml/qumlexpansionregion.h2
-rw-r--r--src/uml/qumlexpression.cpp40
-rw-r--r--src/uml/qumlexpression.h2
-rw-r--r--src/uml/qumlextend.cpp42
-rw-r--r--src/uml/qumlextend.h2
-rw-r--r--src/uml/qumlextension.cpp92
-rw-r--r--src/uml/qumlextension.h2
-rw-r--r--src/uml/qumlextensionend.cpp85
-rw-r--r--src/uml/qumlextensionend.h2
-rw-r--r--src/uml/qumlextensionpoint.cpp30
-rw-r--r--src/uml/qumlextensionpoint.h2
-rw-r--r--src/uml/qumlfeature.cpp31
-rw-r--r--src/uml/qumlfeature.h2
-rw-r--r--src/uml/qumlfinalnode.cpp45
-rw-r--r--src/uml/qumlfinalnode.h2
-rw-r--r--src/uml/qumlfinalstate.cpp64
-rw-r--r--src/uml/qumlfinalstate.h2
-rw-r--r--src/uml/qumlflowfinalnode.cpp45
-rw-r--r--src/uml/qumlflowfinalnode.h2
-rw-r--r--src/uml/qumlforknode.cpp45
-rw-r--r--src/uml/qumlforknode.h2
-rw-r--r--src/uml/qumlfunctionbehavior.cpp121
-rw-r--r--src/uml/qumlfunctionbehavior.h2
-rw-r--r--src/uml/qumlgate.cpp24
-rw-r--r--src/uml/qumlgate.h2
-rw-r--r--src/uml/qumlgeneralization.cpp30
-rw-r--r--src/uml/qumlgeneralization.h2
-rw-r--r--src/uml/qumlgeneralizationset.cpp46
-rw-r--r--src/uml/qumlgeneralizationset.h2
-rw-r--r--src/uml/qumlgeneralordering.cpp32
-rw-r--r--src/uml/qumlgeneralordering.h2
-rw-r--r--src/uml/qumlimage.cpp22
-rw-r--r--src/uml/qumlimage.h2
-rw-r--r--src/uml/qumlinclude.cpp32
-rw-r--r--src/uml/qumlinclude.h2
-rw-r--r--src/uml/qumlinformationflow.cpp62
-rw-r--r--src/uml/qumlinformationflow.h2
-rw-r--r--src/uml/qumlinformationitem.cpp81
-rw-r--r--src/uml/qumlinformationitem.h2
-rw-r--r--src/uml/qumlinitialnode.cpp45
-rw-r--r--src/uml/qumlinitialnode.h2
-rw-r--r--src/uml/qumlinputpin.cpp67
-rw-r--r--src/uml/qumlinputpin.h2
-rw-r--r--src/uml/qumlinstancespecification.cpp47
-rw-r--r--src/uml/qumlinstancespecification.h2
-rw-r--r--src/uml/qumlinstancevalue.cpp36
-rw-r--r--src/uml/qumlinstancevalue.h2
-rw-r--r--src/uml/qumlinteraction.cpp156
-rw-r--r--src/uml/qumlinteraction.h2
-rw-r--r--src/uml/qumlinteractionconstraint.cpp44
-rw-r--r--src/uml/qumlinteractionconstraint.h2
-rw-r--r--src/uml/qumlinteractionfragment.cpp42
-rw-r--r--src/uml/qumlinteractionfragment.h2
-rw-r--r--src/uml/qumlinteractionoperand.cpp54
-rw-r--r--src/uml/qumlinteractionoperand.h2
-rw-r--r--src/uml/qumlinteractionuse.cpp58
-rw-r--r--src/uml/qumlinteractionuse.h2
-rw-r--r--src/uml/qumlinterface.cpp106
-rw-r--r--src/uml/qumlinterface.h2
-rw-r--r--src/uml/qumlinterfacerealization.cpp45
-rw-r--r--src/uml/qumlinterfacerealization.h2
-rw-r--r--src/uml/qumlinterruptibleactivityregion.cpp36
-rw-r--r--src/uml/qumlinterruptibleactivityregion.h2
-rw-r--r--src/uml/qumlinterval.cpp41
-rw-r--r--src/uml/qumlinterval.h2
-rw-r--r--src/uml/qumlintervalconstraint.cpp38
-rw-r--r--src/uml/qumlintervalconstraint.h2
-rw-r--r--src/uml/qumlinvocationaction.cpp66
-rw-r--r--src/uml/qumlinvocationaction.h2
-rw-r--r--src/uml/qumljoinnode.cpp55
-rw-r--r--src/uml/qumljoinnode.h2
-rw-r--r--src/uml/qumllifeline.cpp47
-rw-r--r--src/uml/qumllifeline.h2
-rw-r--r--src/uml/qumllinkaction.cpp66
-rw-r--r--src/uml/qumllinkaction.h2
-rw-r--r--src/uml/qumllinkendcreationdata.cpp28
-rw-r--r--src/uml/qumllinkendcreationdata.h2
-rw-r--r--src/uml/qumllinkenddata.cpp26
-rw-r--r--src/uml/qumllinkenddata.h2
-rw-r--r--src/uml/qumllinkenddestructiondata.cpp28
-rw-r--r--src/uml/qumllinkenddestructiondata.h2
-rw-r--r--src/uml/qumlliteralboolean.cpp34
-rw-r--r--src/uml/qumlliteralboolean.h2
-rw-r--r--src/uml/qumlliteralinteger.cpp34
-rw-r--r--src/uml/qumlliteralinteger.h2
-rw-r--r--src/uml/qumlliteralnull.cpp30
-rw-r--r--src/uml/qumlliteralnull.h2
-rw-r--r--src/uml/qumlliteralreal.cpp34
-rw-r--r--src/uml/qumlliteralreal.h2
-rw-r--r--src/uml/qumlliteralspecification.cpp30
-rw-r--r--src/uml/qumlliteralspecification.h2
-rw-r--r--src/uml/qumlliteralstring.cpp34
-rw-r--r--src/uml/qumlliteralstring.h2
-rw-r--r--src/uml/qumlliteralunlimitednatural.cpp34
-rw-r--r--src/uml/qumlliteralunlimitednatural.h2
-rw-r--r--src/uml/qumlloopnode.cpp116
-rw-r--r--src/uml/qumlloopnode.h2
-rw-r--r--src/uml/qumlmanifestation.cpp40
-rw-r--r--src/uml/qumlmanifestation.h2
-rw-r--r--src/uml/qumlmergenode.cpp45
-rw-r--r--src/uml/qumlmergenode.h2
-rw-r--r--src/uml/qumlmessage.cpp59
-rw-r--r--src/uml/qumlmessage.h2
-rw-r--r--src/uml/qumlmessageend.cpp27
-rw-r--r--src/uml/qumlmessageend.h2
-rw-r--r--src/uml/qumlmessageevent.cpp27
-rw-r--r--src/uml/qumlmessageevent.h2
-rw-r--r--src/uml/qumlmessageoccurrencespecification.cpp40
-rw-r--r--src/uml/qumlmessageoccurrencespecification.h2
-rw-r--r--src/uml/qumlmodel.cpp61
-rw-r--r--src/uml/qumlmodel.h2
-rw-r--r--src/uml/qumlmultiplicityelement.cpp35
-rw-r--r--src/uml/qumlmultiplicityelement.h2
-rw-r--r--src/uml/qumlnamedelement.cpp35
-rw-r--r--src/uml/qumlnamedelement.h2
-rw-r--r--src/uml/qumlnamespace.cpp45
-rw-r--r--src/uml/qumlnamespace.h2
-rw-r--r--src/uml/qumlnode.cpp110
-rw-r--r--src/uml/qumlnode.h2
-rw-r--r--src/uml/qumlobjectflow.cpp69
-rw-r--r--src/uml/qumlobjectflow.h2
-rw-r--r--src/uml/qumlobjectnode.cpp72
-rw-r--r--src/uml/qumlobjectnode.h2
-rw-r--r--src/uml/qumlobservation.cpp27
-rw-r--r--src/uml/qumlobservation.h2
-rw-r--r--src/uml/qumloccurrencespecification.cpp45
-rw-r--r--src/uml/qumloccurrencespecification.h2
-rw-r--r--src/uml/qumlopaqueaction.cpp73
-rw-r--r--src/uml/qumlopaqueaction.h2
-rw-r--r--src/uml/qumlopaquebehavior.cpp127
-rw-r--r--src/uml/qumlopaquebehavior.h2
-rw-r--r--src/uml/qumlopaqueexpression.cpp47
-rw-r--r--src/uml/qumlopaqueexpression.h2
-rw-r--r--src/uml/qumloperation.cpp121
-rw-r--r--src/uml/qumloperation.h2
-rw-r--r--src/uml/qumloperationtemplateparameter.cpp26
-rw-r--r--src/uml/qumloperationtemplateparameter.h2
-rw-r--r--src/uml/qumloutputpin.cpp67
-rw-r--r--src/uml/qumloutputpin.h2
-rw-r--r--src/uml/qumlpackage.cpp75
-rw-r--r--src/uml/qumlpackage.h2
-rw-r--r--src/uml/qumlpackageableelement.cpp30
-rw-r--r--src/uml/qumlpackageableelement.h2
-rw-r--r--src/uml/qumlpackageimport.cpp25
-rw-r--r--src/uml/qumlpackageimport.h2
-rw-r--r--src/uml/qumlpackagemerge.cpp21
-rw-r--r--src/uml/qumlpackagemerge.h2
-rw-r--r--src/uml/qumlparameter.cpp74
-rw-r--r--src/uml/qumlparameter.h2
-rw-r--r--src/uml/qumlparameterableelement.cpp21
-rw-r--r--src/uml/qumlparameterableelement.h2
-rw-r--r--src/uml/qumlparameterset.cpp32
-rw-r--r--src/uml/qumlparameterset.h2
-rw-r--r--src/uml/qumlpartdecomposition.cpp46
-rw-r--r--src/uml/qumlpartdecomposition.h2
-rw-r--r--src/uml/qumlpin.cpp70
-rw-r--r--src/uml/qumlpin.h2
-rw-r--r--src/uml/qumlport.cpp106
-rw-r--r--src/uml/qumlport.h2
-rw-r--r--src/uml/qumlprimitivetype.cpp81
-rw-r--r--src/uml/qumlprimitivetype.h2
-rw-r--r--src/uml/qumlprofile.cpp65
-rw-r--r--src/uml/qumlprofile.h2
-rw-r--r--src/uml/qumlprofileapplication.cpp25
-rw-r--r--src/uml/qumlprofileapplication.h2
-rw-r--r--src/uml/qumlproperty.cpp124
-rw-r--r--src/uml/qumlproperty.h2
-rw-r--r--src/uml/qumlprotocolconformance.cpp21
-rw-r--r--src/uml/qumlprotocolconformance.h2
-rw-r--r--src/uml/qumlprotocolstatemachine.cpp135
-rw-r--r--src/uml/qumlprotocolstatemachine.h2
-rw-r--r--src/uml/qumlprotocoltransition.cpp68
-rw-r--r--src/uml/qumlprotocoltransition.h2
-rw-r--r--src/uml/qumlpseudostate.cpp40
-rw-r--r--src/uml/qumlpseudostate.h2
-rw-r--r--src/uml/qumlqualifiervalue.cpp21
-rw-r--r--src/uml/qumlqualifiervalue.h2
-rw-r--r--src/uml/qumlraiseexceptionaction.cpp61
-rw-r--r--src/uml/qumlraiseexceptionaction.h2
-rw-r--r--src/uml/qumlreadextentaction.cpp65
-rw-r--r--src/uml/qumlreadextentaction.h2
-rw-r--r--src/uml/qumlreadisclassifiedobjectaction.cpp73
-rw-r--r--src/uml/qumlreadisclassifiedobjectaction.h2
-rw-r--r--src/uml/qumlreadlinkaction.cpp67
-rw-r--r--src/uml/qumlreadlinkaction.h2
-rw-r--r--src/uml/qumlreadlinkobjectendaction.cpp70
-rw-r--r--src/uml/qumlreadlinkobjectendaction.h2
-rw-r--r--src/uml/qumlreadlinkobjectendqualifieraction.cpp70
-rw-r--r--src/uml/qumlreadlinkobjectendqualifieraction.h2
-rw-r--r--src/uml/qumlreadselfaction.cpp61
-rw-r--r--src/uml/qumlreadselfaction.h2
-rw-r--r--src/uml/qumlreadstructuralfeatureaction.cpp66
-rw-r--r--src/uml/qumlreadstructuralfeatureaction.h2
-rw-r--r--src/uml/qumlreadvariableaction.cpp64
-rw-r--r--src/uml/qumlreadvariableaction.h2
-rw-r--r--src/uml/qumlrealization.cpp34
-rw-r--r--src/uml/qumlrealization.h2
-rw-r--r--src/uml/qumlreception.cpp55
-rw-r--r--src/uml/qumlreception.h2
-rw-r--r--src/uml/qumlreclassifyobjectaction.cpp74
-rw-r--r--src/uml/qumlreclassifyobjectaction.h2
-rw-r--r--src/uml/qumlredefinableelement.cpp32
-rw-r--r--src/uml/qumlredefinableelement.h2
-rw-r--r--src/uml/qumlredefinabletemplatesignature.cpp44
-rw-r--r--src/uml/qumlredefinabletemplatesignature.h2
-rw-r--r--src/uml/qumlreduceaction.cpp74
-rw-r--r--src/uml/qumlreduceaction.h2
-rw-r--r--src/uml/qumlregion.cpp62
-rw-r--r--src/uml/qumlregion.h2
-rw-r--r--src/uml/qumlrelationship.cpp13
-rw-r--r--src/uml/qumlrelationship.h2
-rw-r--r--src/uml/qumlremovestructuralfeaturevalueaction.cpp74
-rw-r--r--src/uml/qumlremovestructuralfeaturevalueaction.h2
-rw-r--r--src/uml/qumlremovevariablevalueaction.cpp70
-rw-r--r--src/uml/qumlremovevariablevalueaction.h2
-rw-r--r--src/uml/qumlreplyaction.cpp71
-rw-r--r--src/uml/qumlreplyaction.h2
-rw-r--r--src/uml/qumlsendobjectaction.cpp69
-rw-r--r--src/uml/qumlsendobjectaction.h2
-rw-r--r--src/uml/qumlsendsignalaction.cpp71
-rw-r--r--src/uml/qumlsendsignalaction.h2
-rw-r--r--src/uml/qumlsequencenode.cpp81
-rw-r--r--src/uml/qumlsequencenode.h2
-rw-r--r--src/uml/qumlsignal.cpp81
-rw-r--r--src/uml/qumlsignal.h2
-rw-r--r--src/uml/qumlsignalevent.cpp33
-rw-r--r--src/uml/qumlsignalevent.h2
-rw-r--r--src/uml/qumlslot.cpp26
-rw-r--r--src/uml/qumlslot.h2
-rw-r--r--src/uml/qumlstartclassifierbehavioraction.cpp61
-rw-r--r--src/uml/qumlstartclassifierbehavioraction.h2
-rw-r--r--src/uml/qumlstartobjectbehavioraction.cpp69
-rw-r--r--src/uml/qumlstartobjectbehavioraction.h2
-rw-r--r--src/uml/qumlstate.cpp101
-rw-r--r--src/uml/qumlstate.h2
-rw-r--r--src/uml/qumlstateinvariant.cpp41
-rw-r--r--src/uml/qumlstateinvariant.h2
-rw-r--r--src/uml/qumlstatemachine.cpp136
-rw-r--r--src/uml/qumlstatemachine.h2
-rw-r--r--src/uml/qumlstereotype.cpp111
-rw-r--r--src/uml/qumlstereotype.h2
-rw-r--r--src/uml/qumlstringexpression.cpp49
-rw-r--r--src/uml/qumlstringexpression.h2
-rw-r--r--src/uml/qumlstructuralfeature.cpp40
-rw-r--r--src/uml/qumlstructuralfeature.h2
-rw-r--r--src/uml/qumlstructuralfeatureaction.cpp66
-rw-r--r--src/uml/qumlstructuralfeatureaction.h2
-rw-r--r--src/uml/qumlstructuredactivitynode.cpp92
-rw-r--r--src/uml/qumlstructuredactivitynode.h2
-rw-r--r--src/uml/qumlstructuredclassifier.cpp92
-rw-r--r--src/uml/qumlstructuredclassifier.h2
-rw-r--r--src/uml/qumlsubstitution.cpp45
-rw-r--r--src/uml/qumlsubstitution.h2
-rw-r--r--src/uml/qumltemplateableelement.cpp21
-rw-r--r--src/uml/qumltemplateableelement.h2
-rw-r--r--src/uml/qumltemplatebinding.cpp26
-rw-r--r--src/uml/qumltemplatebinding.h2
-rw-r--r--src/uml/qumltemplateparameter.cpp36
-rw-r--r--src/uml/qumltemplateparameter.h2
-rw-r--r--src/uml/qumltemplateparametersubstitution.cpp31
-rw-r--r--src/uml/qumltemplateparametersubstitution.h2
-rw-r--r--src/uml/qumltemplatesignature.cpp26
-rw-r--r--src/uml/qumltemplatesignature.h2
-rw-r--r--src/uml/qumltestidentityaction.cpp70
-rw-r--r--src/uml/qumltestidentityaction.h2
-rw-r--r--src/uml/qumltimeconstraint.cpp43
-rw-r--r--src/uml/qumltimeconstraint.h2
-rw-r--r--src/uml/qumltimeevent.cpp37
-rw-r--r--src/uml/qumltimeevent.h2
-rw-r--r--src/uml/qumltimeexpression.cpp42
-rw-r--r--src/uml/qumltimeexpression.h2
-rw-r--r--src/uml/qumltimeinterval.cpp42
-rw-r--r--src/uml/qumltimeinterval.h2
-rw-r--r--src/uml/qumltimeobservation.cpp36
-rw-r--r--src/uml/qumltimeobservation.h2
-rw-r--r--src/uml/qumltransition.cpp75
-rw-r--r--src/uml/qumltransition.h2
-rw-r--r--src/uml/qumltrigger.cpp32
-rw-r--r--src/uml/qumltrigger.h2
-rw-r--r--src/uml/qumltype.cpp32
-rw-r--r--src/uml/qumltype.h2
-rw-r--r--src/uml/qumltypedelement.cpp27
-rw-r--r--src/uml/qumltypedelement.h2
-rw-r--r--src/uml/qumlunmarshallaction.cpp69
-rw-r--r--src/uml/qumlunmarshallaction.h2
-rw-r--r--src/uml/qumlusage.cpp31
-rw-r--r--src/uml/qumlusage.h2
-rw-r--r--src/uml/qumlusecase.cpp103
-rw-r--r--src/uml/qumlusecase.h2
-rw-r--r--src/uml/qumlvaluepin.cpp72
-rw-r--r--src/uml/qumlvaluepin.h2
-rw-r--r--src/uml/qumlvaluespecification.cpp30
-rw-r--r--src/uml/qumlvaluespecification.h2
-rw-r--r--src/uml/qumlvaluespecificationaction.cpp66
-rw-r--r--src/uml/qumlvaluespecificationaction.h2
-rw-r--r--src/uml/qumlvariable.cpp51
-rw-r--r--src/uml/qumlvariable.h2
-rw-r--r--src/uml/qumlvariableaction.cpp62
-rw-r--r--src/uml/qumlvariableaction.h2
-rw-r--r--src/uml/qumlvertex.cpp33
-rw-r--r--src/uml/qumlvertex.h2
-rw-r--r--src/uml/qumlwritelinkaction.cpp62
-rw-r--r--src/uml/qumlwritelinkaction.h2
-rw-r--r--src/uml/qumlwritestructuralfeatureaction.cpp70
-rw-r--r--src/uml/qumlwritestructuralfeatureaction.h2
-rw-r--r--src/uml/qumlwritevariableaction.cpp64
-rw-r--r--src/uml/qumlwritevariableaction.h2
-rw-r--r--src/uml/uml.pro2
489 files changed, 12998 insertions, 1475 deletions
diff --git a/src/uml/qobjects/qumlactivityobject.cpp b/src/uml/qobjects/qumlactivityobject.cpp
index bf6df852..2ee00e1b 100644
--- a/src/uml/qobjects/qumlactivityobject.cpp
+++ b/src/uml/qobjects/qumlactivityobject.cpp
@@ -643,11 +643,11 @@ QString QUmlActivityObject::separator() const
QSet<QObject *> QUmlActivityObject::excludeCollisions(QSet<QObject *> imps) const
{
- QSet<QUmlPackageableElement *> inputSet;
- foreach(QObject *object, imps)
- inputSet.insert(qmodelingobjectproperty_cast<QUmlPackageableElement *>(object));
+ QSet<QUmlPackageableElement *> impsConverted;
+ foreach (QObject *object, imps)
+ impsConverted.insert(qmodelingobjectproperty_cast<QUmlPackageableElement *>(object));
QSet<QObject *> set;
- foreach (QUmlPackageableElement *element, qmodelingobjectproperty_cast<QUmlActivity *>(this)->excludeCollisions(inputSet))
+ foreach (QUmlPackageableElement *element, qmodelingobjectproperty_cast<QUmlActivity *>(this)->excludeCollisions(impsConverted))
set.insert(element->asQObject());
return set;
}
@@ -659,11 +659,11 @@ QSet<QString> QUmlActivityObject::getNamesOfMember(QObject *element) const
QSet<QObject *> QUmlActivityObject::importMembers(QSet<QObject *> imps) const
{
- QSet<QUmlPackageableElement *> inputSet;
+ QSet<QUmlPackageableElement *> impsConverted;
foreach (QObject *object, imps)
- inputSet.insert(qmodelingobjectproperty_cast<QUmlPackageableElement *>(object));
+ impsConverted.insert(qmodelingobjectproperty_cast<QUmlPackageableElement *>(object));
QSet<QObject *> set;
- foreach (QUmlPackageableElement *element, qmodelingobjectproperty_cast<QUmlActivity *>(this)->importMembers(inputSet))
+ foreach (QUmlPackageableElement *element, qmodelingobjectproperty_cast<QUmlActivity *>(this)->importMembers(impsConverted))
set.insert(element->asQObject());
return set;
}
@@ -766,11 +766,11 @@ QSet<QObject *> QUmlActivityObject::parents() const
QSet<QObject *> QUmlActivityObject::inherit(QSet<QObject *> inhs) const
{
- QSet<QUmlNamedElement *> inputSet;
- foreach(QObject *object, inhs)
- inputSet.insert(qmodelingobjectproperty_cast<QUmlNamedElement *>(object));
+ QSet<QUmlNamedElement *> inhsConverted;
+ foreach (QObject *object, inhs)
+ inhsConverted.insert(qmodelingobjectproperty_cast<QUmlNamedElement *>(object));
QSet<QObject *> set;
- foreach (QUmlNamedElement *element, qmodelingobjectproperty_cast<QUmlActivity *>(this)->inherit(inputSet))
+ foreach (QUmlNamedElement *element, qmodelingobjectproperty_cast<QUmlActivity *>(this)->inherit(inhsConverted))
set.insert(element->asQObject());
return set;
}
diff --git a/src/uml/qobjects/qumlactorobject.cpp b/src/uml/qobjects/qumlactorobject.cpp
index b89d5f80..957a66ef 100644
--- a/src/uml/qobjects/qumlactorobject.cpp
+++ b/src/uml/qobjects/qumlactorobject.cpp
@@ -426,11 +426,11 @@ QString QUmlActorObject::separator() const
QSet<QObject *> QUmlActorObject::excludeCollisions(QSet<QObject *> imps) const
{
- QSet<QUmlPackageableElement *> inputSet;
+ QSet<QUmlPackageableElement *> impsConverted;
foreach (QObject *object, imps)
- inputSet.insert(qmodelingobjectproperty_cast<QUmlPackageableElement *>(object));
+ impsConverted.insert(qmodelingobjectproperty_cast<QUmlPackageableElement *>(object));
QSet<QObject *> set;
- foreach (QUmlPackageableElement *element, qmodelingobjectproperty_cast<QUmlActor *>(this)->excludeCollisions(inputSet))
+ foreach (QUmlPackageableElement *element, qmodelingobjectproperty_cast<QUmlActor *>(this)->excludeCollisions(impsConverted))
set.insert(element->asQObject());
return set;
}
@@ -442,11 +442,11 @@ QSet<QString> QUmlActorObject::getNamesOfMember(QObject *element) const
QSet<QObject *> QUmlActorObject::importMembers(QSet<QObject *> imps) const
{
- QSet<QUmlPackageableElement *> inputSet;
+ QSet<QUmlPackageableElement *> impsConverted;
foreach (QObject *object, imps)
- inputSet.insert(qmodelingobjectproperty_cast<QUmlPackageableElement *>(object));
+ impsConverted.insert(qmodelingobjectproperty_cast<QUmlPackageableElement *>(object));
QSet<QObject *> set;
- foreach (QUmlPackageableElement *element, qmodelingobjectproperty_cast<QUmlActor *>(this)->importMembers(inputSet))
+ foreach (QUmlPackageableElement *element, qmodelingobjectproperty_cast<QUmlActor *>(this)->importMembers(impsConverted))
set.insert(element->asQObject());
return set;
}
@@ -521,11 +521,11 @@ bool QUmlActorObject::hasVisibilityOf(QObject *n) const
QSet<QObject *> QUmlActorObject::inherit(QSet<QObject *> inhs) const
{
- QSet<QUmlNamedElement *> inputSet;
+ QSet<QUmlNamedElement *> inhsConverted;
foreach (QObject *object, inhs)
- inputSet.insert(qmodelingobjectproperty_cast<QUmlNamedElement *>(object));
+ inhsConverted.insert(qmodelingobjectproperty_cast<QUmlNamedElement *>(object));
QSet<QObject *> set;
- foreach (QUmlNamedElement *element, qmodelingobjectproperty_cast<QUmlActor *>(this)->inherit(inputSet))
+ foreach (QUmlNamedElement *element, qmodelingobjectproperty_cast<QUmlActor *>(this)->inherit(inhsConverted))
set.insert(element->asQObject());
return set;
}
diff --git a/src/uml/qobjects/qumlartifactobject.cpp b/src/uml/qobjects/qumlartifactobject.cpp
index 7f0b5362..cf9b617d 100644
--- a/src/uml/qobjects/qumlartifactobject.cpp
+++ b/src/uml/qobjects/qumlartifactobject.cpp
@@ -442,11 +442,11 @@ QString QUmlArtifactObject::separator() const
QSet<QObject *> QUmlArtifactObject::excludeCollisions(QSet<QObject *> imps) const
{
- QSet<QUmlPackageableElement *> inputSet;
+ QSet<QUmlPackageableElement *> impsConverted;
foreach (QObject *object, imps)
- inputSet.insert(qmodelingobjectproperty_cast<QUmlPackageableElement *>(object));
+ impsConverted.insert(qmodelingobjectproperty_cast<QUmlPackageableElement *>(object));
QSet<QObject *> set;
- foreach (QUmlPackageableElement *element, qmodelingobjectproperty_cast<QUmlArtifact *>(this)->excludeCollisions(inputSet))
+ foreach (QUmlPackageableElement *element, qmodelingobjectproperty_cast<QUmlArtifact *>(this)->excludeCollisions(impsConverted))
set.insert(element->asQObject());
return set;
}
@@ -458,11 +458,11 @@ QSet<QString> QUmlArtifactObject::getNamesOfMember(QObject *element) const
QSet<QObject *> QUmlArtifactObject::importMembers(QSet<QObject *> imps) const
{
- QSet<QUmlPackageableElement *> inputSet;
+ QSet<QUmlPackageableElement *> impsConverted;
foreach (QObject *object, imps)
- inputSet.insert(qmodelingobjectproperty_cast<QUmlPackageableElement *>(object));
+ impsConverted.insert(qmodelingobjectproperty_cast<QUmlPackageableElement *>(object));
QSet<QObject *> set;
- foreach (QUmlPackageableElement *element, qmodelingobjectproperty_cast<QUmlArtifact *>(this)->importMembers(inputSet))
+ foreach (QUmlPackageableElement *element, qmodelingobjectproperty_cast<QUmlArtifact *>(this)->importMembers(impsConverted))
set.insert(element->asQObject());
return set;
}
@@ -537,11 +537,11 @@ bool QUmlArtifactObject::hasVisibilityOf(QObject *n) const
QSet<QObject *> QUmlArtifactObject::inherit(QSet<QObject *> inhs) const
{
- QSet<QUmlNamedElement *> inputSet;
+ QSet<QUmlNamedElement *> inhsConverted;
foreach (QObject *object, inhs)
- inputSet.insert(qmodelingobjectproperty_cast<QUmlNamedElement *>(object));
+ inhsConverted.insert(qmodelingobjectproperty_cast<QUmlNamedElement *>(object));
QSet<QObject *> set;
- foreach (QUmlNamedElement *element, qmodelingobjectproperty_cast<QUmlArtifact *>(this)->inherit(inputSet))
+ foreach (QUmlNamedElement *element, qmodelingobjectproperty_cast<QUmlArtifact *>(this)->inherit(inhsConverted))
set.insert(element->asQObject());
return set;
}
diff --git a/src/uml/qobjects/qumlassociationobject.cpp b/src/uml/qobjects/qumlassociationobject.cpp
index 841fec68..bb8c8b42 100644
--- a/src/uml/qobjects/qumlassociationobject.cpp
+++ b/src/uml/qobjects/qumlassociationobject.cpp
@@ -450,11 +450,11 @@ QString QUmlAssociationObject::separator() const
QSet<QObject *> QUmlAssociationObject::excludeCollisions(QSet<QObject *> imps) const
{
- QSet<QUmlPackageableElement *> inputSet;
+ QSet<QUmlPackageableElement *> impsConverted;
foreach (QObject *object, imps)
- inputSet.insert(qmodelingobjectproperty_cast<QUmlPackageableElement *>(object));
+ impsConverted.insert(qmodelingobjectproperty_cast<QUmlPackageableElement *>(object));
QSet<QObject *> set;
- foreach (QUmlPackageableElement *element, qmodelingobjectproperty_cast<QUmlAssociation *>(this)->excludeCollisions(inputSet))
+ foreach (QUmlPackageableElement *element, qmodelingobjectproperty_cast<QUmlAssociation *>(this)->excludeCollisions(impsConverted))
set.insert(element->asQObject());
return set;
}
@@ -466,11 +466,11 @@ QSet<QString> QUmlAssociationObject::getNamesOfMember(QObject *element) const
QSet<QObject *> QUmlAssociationObject::importMembers(QSet<QObject *> imps) const
{
- QSet<QUmlPackageableElement *> inputSet;
+ QSet<QUmlPackageableElement *> impsConverted;
foreach (QObject *object, imps)
- inputSet.insert(qmodelingobjectproperty_cast<QUmlPackageableElement *>(object));
+ impsConverted.insert(qmodelingobjectproperty_cast<QUmlPackageableElement *>(object));
QSet<QObject *> set;
- foreach (QUmlPackageableElement *element, qmodelingobjectproperty_cast<QUmlAssociation *>(this)->importMembers(inputSet))
+ foreach (QUmlPackageableElement *element, qmodelingobjectproperty_cast<QUmlAssociation *>(this)->importMembers(impsConverted))
set.insert(element->asQObject());
return set;
}
@@ -545,11 +545,11 @@ bool QUmlAssociationObject::hasVisibilityOf(QObject *n) const
QSet<QObject *> QUmlAssociationObject::inherit(QSet<QObject *> inhs) const
{
- QSet<QUmlNamedElement *> inputSet;
+ QSet<QUmlNamedElement *> inhsConverted;
foreach (QObject *object, inhs)
- inputSet.insert(qmodelingobjectproperty_cast<QUmlNamedElement *>(object));
+ inhsConverted.insert(qmodelingobjectproperty_cast<QUmlNamedElement *>(object));
QSet<QObject *> set;
- foreach (QUmlNamedElement *element, qmodelingobjectproperty_cast<QUmlAssociation *>(this)->inherit(inputSet))
+ foreach (QUmlNamedElement *element, qmodelingobjectproperty_cast<QUmlAssociation *>(this)->inherit(inhsConverted))
set.insert(element->asQObject());
return set;
}
diff --git a/src/uml/qumlabstraction.cpp b/src/uml/qumlabstraction.cpp
index b8e1a5a8..a459f3b3 100644
--- a/src/uml/qumlabstraction.cpp
+++ b/src/uml/qumlabstraction.cpp
@@ -42,8 +42,16 @@
#include "private/qumlabstractionobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOpaqueExpression>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlAbstraction
@@ -67,13 +75,36 @@ QUmlAbstraction::~QUmlAbstraction()
}
}
+QModelingObject *QUmlAbstraction::clone() const
+{
+ QUmlAbstraction *c = new QUmlAbstraction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlNamedElement *element, client())
+ c->addClient(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ foreach (QUmlNamedElement *element, supplier())
+ c->addSupplier(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ if (mapping())
+ c->setMapping(dynamic_cast<QUmlOpaqueExpression *>(mapping()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
An composition of an Expression that states the abstraction relationship between the supplier and the client. In some cases, such as Derivation, it is usually formal and unidirectional; in other cases, such as Trace, it is usually informal and bidirectional. The mapping expression is optional and may be omitted if the precise relationship between the elements is not specified.
*/
-QUmlOpaqueExpression *
-QUmlAbstraction::mapping() const
+QUmlOpaqueExpression *QUmlAbstraction::mapping() const
{
// This is a read-write association end
diff --git a/src/uml/qumlabstraction.h b/src/uml/qumlabstraction.h
index 1d400a0f..b6938ad7 100644
--- a/src/uml/qumlabstraction.h
+++ b/src/uml/qumlabstraction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlAbstraction(bool createQObject = true);
virtual ~QUmlAbstraction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlOpaqueExpression *mapping() const;
void setMapping(QUmlOpaqueExpression *mapping);
diff --git a/src/uml/qumlacceptcallaction.cpp b/src/uml/qumlacceptcallaction.cpp
index cb5124d8..2a8dec7c 100644
--- a/src/uml/qumlacceptcallaction.cpp
+++ b/src/uml/qumlacceptcallaction.cpp
@@ -42,8 +42,27 @@
#include "private/qumlacceptcallactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlTrigger>
/*!
\class QUmlAcceptCallAction
@@ -67,13 +86,55 @@ QUmlAcceptCallAction::~QUmlAcceptCallAction()
}
}
+QModelingObject *QUmlAcceptCallAction::clone() const
+{
+ QUmlAcceptCallAction *c = new QUmlAcceptCallAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ c->setUnmarshall(isUnmarshall());
+ foreach (QUmlOutputPin *element, result())
+ c->addResult(dynamic_cast<QUmlOutputPin *>(element->clone()));
+ foreach (QUmlTrigger *element, trigger())
+ c->addTrigger(dynamic_cast<QUmlTrigger *>(element->clone()));
+ if (returnInformation())
+ c->setReturnInformation(dynamic_cast<QUmlOutputPin *>(returnInformation()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Pin where a value is placed containing sufficient information to perform a subsequent reply and return control to the caller. The contents of this value are opaque. It can be passed and copied but it cannot be manipulated by the model.
*/
-QUmlOutputPin *
-QUmlAcceptCallAction::returnInformation() const
+QUmlOutputPin *QUmlAcceptCallAction::returnInformation() const
{
// This is a read-write association end
diff --git a/src/uml/qumlacceptcallaction.h b/src/uml/qumlacceptcallaction.h
index 468a721c..dfc0b47b 100644
--- a/src/uml/qumlacceptcallaction.h
+++ b/src/uml/qumlacceptcallaction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlAcceptCallAction(bool createQObject = true);
virtual ~QUmlAcceptCallAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlOutputPin *returnInformation() const;
void setReturnInformation(QUmlOutputPin *returnInformation);
diff --git a/src/uml/qumlaccepteventaction.cpp b/src/uml/qumlaccepteventaction.cpp
index 65c270ac..ce41b466 100644
--- a/src/uml/qumlaccepteventaction.cpp
+++ b/src/uml/qumlaccepteventaction.cpp
@@ -42,9 +42,27 @@
#include "private/qumlaccepteventactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
#include <QtUml/QUmlTrigger>
-
/*!
\class QUmlAcceptEventAction
@@ -67,13 +85,53 @@ QUmlAcceptEventAction::~QUmlAcceptEventAction()
}
}
+QModelingObject *QUmlAcceptEventAction::clone() const
+{
+ QUmlAcceptEventAction *c = new QUmlAcceptEventAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ c->setUnmarshall(isUnmarshall());
+ foreach (QUmlOutputPin *element, result())
+ c->addResult(dynamic_cast<QUmlOutputPin *>(element->clone()));
+ foreach (QUmlTrigger *element, trigger())
+ c->addTrigger(dynamic_cast<QUmlTrigger *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Indicates whether there is a single output pin for the event, or multiple output pins for attributes of the event.
*/
-bool
-QUmlAcceptEventAction::isUnmarshall() const
+bool QUmlAcceptEventAction::isUnmarshall() const
{
// This is a read-write property
@@ -92,8 +150,7 @@ void QUmlAcceptEventAction::setUnmarshall(bool isUnmarshall)
/*!
Pins holding the received event objects or their attributes. Event objects may be copied in transmission, so identity might not be preserved.
*/
-const QSet<QUmlOutputPin *>
-QUmlAcceptEventAction::result() const
+const QSet<QUmlOutputPin *> QUmlAcceptEventAction::result() const
{
// This is a read-write association end
@@ -132,8 +189,7 @@ void QUmlAcceptEventAction::removeResult(QUmlOutputPin *result)
/*!
The type of events accepted by the action, as specified by triggers. For triggers with signal events, a signal of the specified type or any subtype of the specified signal type is accepted.
*/
-const QSet<QUmlTrigger *>
-QUmlAcceptEventAction::trigger() const
+const QSet<QUmlTrigger *> QUmlAcceptEventAction::trigger() const
{
// This is a read-write association end
diff --git a/src/uml/qumlaccepteventaction.h b/src/uml/qumlaccepteventaction.h
index 19e5132c..c45c5d23 100644
--- a/src/uml/qumlaccepteventaction.h
+++ b/src/uml/qumlaccepteventaction.h
@@ -61,6 +61,8 @@ public:
explicit QUmlAcceptEventAction(bool createQObject = true);
virtual ~QUmlAcceptEventAction();
+ QModelingObject *clone() const;
+
// Owned attributes
bool isUnmarshall() const;
void setUnmarshall(bool isUnmarshall);
diff --git a/src/uml/qumlaction.cpp b/src/uml/qumlaction.cpp
index 0d053d80..8a2fe972 100644
--- a/src/uml/qumlaction.cpp
+++ b/src/uml/qumlaction.cpp
@@ -40,11 +40,26 @@
****************************************************************************/
#include "qumlaction.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlAction
@@ -61,13 +76,48 @@ QUmlAction::~QUmlAction()
{
}
+QModelingObject *QUmlAction::clone() const
+{
+ QUmlAction *c = new QUmlAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The classifier that owns the behavior of which this action is a part.
*/
-QUmlClassifier *
-QUmlAction::context() const
+QUmlClassifier *QUmlAction::context() const
{
// This is a read-only derived association end
@@ -91,8 +141,7 @@ void QUmlAction::setContext(QUmlClassifier *context)
/*!
The ordered set of input pins connected to the Action. These are among the total set of inputs.
*/
-const QList<QUmlInputPin *>
-QUmlAction::input() const
+const QList<QUmlInputPin *> QUmlAction::input() const
{
// This is a read-only derived union association end
@@ -131,8 +180,7 @@ void QUmlAction::removeInput(QUmlInputPin *input)
/*!
If true, the action can begin a new, concurrent execution, even if there is already another execution of the action ongoing. If false, the action cannot begin a new execution until any previous execution has completed.
*/
-bool
-QUmlAction::isLocallyReentrant() const
+bool QUmlAction::isLocallyReentrant() const
{
// This is a read-write property
@@ -151,8 +199,7 @@ void QUmlAction::setLocallyReentrant(bool isLocallyReentrant)
/*!
Constraint that must be satisfied when executed is completed.
*/
-const QSet<QUmlConstraint *>
-QUmlAction::localPostcondition() const
+const QSet<QUmlConstraint *> QUmlAction::localPostcondition() const
{
// This is a read-write association end
@@ -191,8 +238,7 @@ void QUmlAction::removeLocalPostcondition(QUmlConstraint *localPostcondition)
/*!
Constraint that must be satisfied when execution is started.
*/
-const QSet<QUmlConstraint *>
-QUmlAction::localPrecondition() const
+const QSet<QUmlConstraint *> QUmlAction::localPrecondition() const
{
// This is a read-write association end
@@ -231,8 +277,7 @@ void QUmlAction::removeLocalPrecondition(QUmlConstraint *localPrecondition)
/*!
The ordered set of output pins connected to the Action. The action places its results onto pins in this set.
*/
-const QList<QUmlOutputPin *>
-QUmlAction::output() const
+const QList<QUmlOutputPin *> QUmlAction::output() const
{
// This is a read-only derived union association end
diff --git a/src/uml/qumlaction.h b/src/uml/qumlaction.h
index 0e8988b8..35c4c4cc 100644
--- a/src/uml/qumlaction.h
+++ b/src/uml/qumlaction.h
@@ -62,6 +62,8 @@ class Q_UML_EXPORT QUmlAction : public QUmlExecutableNode
public:
virtual ~QUmlAction();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QUmlClassifier *context() const;
Q_DECL_HIDDEN void setContext(QUmlClassifier *context);
diff --git a/src/uml/qumlactionexecutionspecification.cpp b/src/uml/qumlactionexecutionspecification.cpp
index 481c4522..742c6bbd 100644
--- a/src/uml/qumlactionexecutionspecification.cpp
+++ b/src/uml/qumlactionexecutionspecification.cpp
@@ -43,7 +43,18 @@
#include "private/qumlactionexecutionspecificationobject_p.h"
#include <QtUml/QUmlAction>
-
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlGeneralOrdering>
+#include <QtUml/QUmlInteraction>
+#include <QtUml/QUmlInteractionOperand>
+#include <QtUml/QUmlLifeline>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOccurrenceSpecification>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlActionExecutionSpecification
@@ -66,13 +77,40 @@ QUmlActionExecutionSpecification::~QUmlActionExecutionSpecification()
}
}
+QModelingObject *QUmlActionExecutionSpecification::clone() const
+{
+ QUmlActionExecutionSpecification *c = new QUmlActionExecutionSpecification;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlLifeline *element, covered())
+ c->addCovered(dynamic_cast<QUmlLifeline *>(element->clone()));
+ if (enclosingInteraction())
+ c->setEnclosingInteraction(dynamic_cast<QUmlInteraction *>(enclosingInteraction()->clone()));
+ if (enclosingOperand())
+ c->setEnclosingOperand(dynamic_cast<QUmlInteractionOperand *>(enclosingOperand()->clone()));
+ foreach (QUmlGeneralOrdering *element, generalOrdering())
+ c->addGeneralOrdering(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ if (finish())
+ c->setFinish(dynamic_cast<QUmlOccurrenceSpecification *>(finish()->clone()));
+ if (start())
+ c->setStart(dynamic_cast<QUmlOccurrenceSpecification *>(start()->clone()));
+ if (action())
+ c->setAction(dynamic_cast<QUmlAction *>(action()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Action whose execution is occurring.
*/
-QUmlAction *
-QUmlActionExecutionSpecification::action() const
+QUmlAction *QUmlActionExecutionSpecification::action() const
{
// This is a read-write association end
diff --git a/src/uml/qumlactionexecutionspecification.h b/src/uml/qumlactionexecutionspecification.h
index 025a7f28..0f6edac4 100644
--- a/src/uml/qumlactionexecutionspecification.h
+++ b/src/uml/qumlactionexecutionspecification.h
@@ -60,6 +60,8 @@ public:
explicit QUmlActionExecutionSpecification(bool createQObject = true);
virtual ~QUmlActionExecutionSpecification();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlAction *action() const;
void setAction(QUmlAction *action);
diff --git a/src/uml/qumlactioninputpin.cpp b/src/uml/qumlactioninputpin.cpp
index f1e4079a..f3c218ec 100644
--- a/src/uml/qumlactioninputpin.cpp
+++ b/src/uml/qumlactioninputpin.cpp
@@ -43,7 +43,27 @@
#include "private/qumlactioninputpinobject_p.h"
#include <QtUml/QUmlAction>
-
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlMultiplicityElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlState>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlActionInputPin
@@ -67,13 +87,60 @@ QUmlActionInputPin::~QUmlActionInputPin()
}
}
+QModelingObject *QUmlActionInputPin::clone() const
+{
+ QUmlActionInputPin *c = new QUmlActionInputPin;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ c->setOrdered(isOrdered());
+ c->setUnique(isUnique());
+ if (lowerValue())
+ c->setLowerValue(dynamic_cast<QUmlValueSpecification *>(lowerValue()->clone()));
+ if (upperValue())
+ c->setUpperValue(dynamic_cast<QUmlValueSpecification *>(upperValue()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ foreach (QUmlState *element, inState())
+ c->addInState(dynamic_cast<QUmlState *>(element->clone()));
+ c->setControlType(isControlType());
+ c->setOrdering(ordering());
+ if (selection())
+ c->setSelection(dynamic_cast<QUmlBehavior *>(selection()->clone()));
+ if (upperBound())
+ c->setUpperBound(dynamic_cast<QUmlValueSpecification *>(upperBound()->clone()));
+ c->setControl(isControl());
+ if (fromAction())
+ c->setFromAction(dynamic_cast<QUmlAction *>(fromAction()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The action used to provide values.
*/
-QUmlAction *
-QUmlActionInputPin::fromAction() const
+QUmlAction *QUmlActionInputPin::fromAction() const
{
// This is a read-write association end
diff --git a/src/uml/qumlactioninputpin.h b/src/uml/qumlactioninputpin.h
index bc5a083f..5fd5ebf7 100644
--- a/src/uml/qumlactioninputpin.h
+++ b/src/uml/qumlactioninputpin.h
@@ -60,6 +60,8 @@ public:
explicit QUmlActionInputPin(bool createQObject = true);
virtual ~QUmlActionInputPin();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlAction *fromAction() const;
void setFromAction(QUmlAction *fromAction);
diff --git a/src/uml/qumlactivity.cpp b/src/uml/qumlactivity.cpp
index a552c541..c44544b0 100644
--- a/src/uml/qumlactivity.cpp
+++ b/src/uml/qumlactivity.cpp
@@ -46,9 +46,48 @@
#include <QtUml/QUmlActivityGroup>
#include <QtUml/QUmlActivityNode>
#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlBehavioralFeature>
+#include <QtUml/QUmlBehavioredClassifier>
+#include <QtUml/QUmlClass>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElement>
+#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExtension>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlInterfaceRealization>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameter>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlParameterSet>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlReception>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
#include <QtUml/QUmlVariable>
-
/*!
\class QUmlActivity
@@ -72,13 +111,105 @@ QUmlActivity::~QUmlActivity()
}
}
+QModelingObject *QUmlActivity::clone() const
+{
+ QUmlActivity *c = new QUmlActivity;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlConnector *element, ownedConnector())
+ c->addOwnedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setActive(isActive());
+ foreach (QUmlClassifier *element, nestedClassifier())
+ c->addNestedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ foreach (QUmlReception *element, ownedReception())
+ c->addOwnedReception(dynamic_cast<QUmlReception *>(element->clone()));
+ c->setReentrant(isReentrant());
+ foreach (QUmlParameter *element, ownedParameter())
+ c->addOwnedParameter(dynamic_cast<QUmlParameter *>(element->clone()));
+ foreach (QUmlParameterSet *element, ownedParameterSet())
+ c->addOwnedParameterSet(dynamic_cast<QUmlParameterSet *>(element->clone()));
+ foreach (QUmlConstraint *element, postcondition())
+ c->addPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, precondition())
+ c->addPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlBehavior *element, redefinedBehavior())
+ c->addRedefinedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ if (specification())
+ c->setSpecification(dynamic_cast<QUmlBehavioralFeature *>(specification()->clone()));
+ foreach (QUmlActivityEdge *element, edge())
+ c->addEdge(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityGroup *element, group())
+ c->addGroup(dynamic_cast<QUmlActivityGroup *>(element->clone()));
+ c->setReadOnly(isReadOnly());
+ c->setSingleExecution(isSingleExecution());
+ foreach (QUmlActivityNode *element, node())
+ c->addNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlActivityPartition *element, partition())
+ c->addPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ foreach (QUmlStructuredActivityNode *element, structuredNode())
+ c->addStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(element->clone()));
+ foreach (QUmlVariable *element, variable())
+ c->addVariable(dynamic_cast<QUmlVariable *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Edges expressing flow between nodes of the activity.
*/
-const QSet<QUmlActivityEdge *>
-QUmlActivity::edge() const
+const QSet<QUmlActivityEdge *> QUmlActivity::edge() const
{
// This is a read-write association end
@@ -127,8 +258,7 @@ void QUmlActivity::removeEdge(QUmlActivityEdge *edge)
/*!
Top-level groups in the activity.
*/
-const QSet<QUmlActivityGroup *>
-QUmlActivity::group() const
+const QSet<QUmlActivityGroup *> QUmlActivity::group() const
{
// This is a read-write association end
@@ -177,8 +307,7 @@ void QUmlActivity::removeGroup(QUmlActivityGroup *group)
/*!
If true, this activity must not make any changes to variables outside the activity or to objects. (This is an assertion, not an executable property. It may be used by an execution engine to optimize model execution. If the assertion is violated by the action, then the model is ill-formed.) The default is false (an activity may make nonlocal changes).
*/
-bool
-QUmlActivity::isReadOnly() const
+bool QUmlActivity::isReadOnly() const
{
// This is a read-write property
@@ -197,8 +326,7 @@ void QUmlActivity::setReadOnly(bool isReadOnly)
/*!
If true, all invocations of the activity are handled by the same execution.
*/
-bool
-QUmlActivity::isSingleExecution() const
+bool QUmlActivity::isSingleExecution() const
{
// This is a read-write property
@@ -217,8 +345,7 @@ void QUmlActivity::setSingleExecution(bool isSingleExecution)
/*!
Nodes coordinated by the activity.
*/
-const QSet<QUmlActivityNode *>
-QUmlActivity::node() const
+const QSet<QUmlActivityNode *> QUmlActivity::node() const
{
// This is a read-write association end
@@ -267,8 +394,7 @@ void QUmlActivity::removeNode(QUmlActivityNode *node)
/*!
Top-level partitions in the activity.
*/
-const QSet<QUmlActivityPartition *>
-QUmlActivity::partition() const
+const QSet<QUmlActivityPartition *> QUmlActivity::partition() const
{
// This is a read-write association end
@@ -304,8 +430,7 @@ void QUmlActivity::removePartition(QUmlActivityPartition *partition)
/*!
Top-level structured nodes in the activity.
*/
-const QSet<QUmlStructuredActivityNode *>
-QUmlActivity::structuredNode() const
+const QSet<QUmlStructuredActivityNode *> QUmlActivity::structuredNode() const
{
// This is a read-write association end
@@ -356,8 +481,7 @@ void QUmlActivity::removeStructuredNode(QUmlStructuredActivityNode *structuredNo
/*!
Top-level variables in the activity.
*/
-const QSet<QUmlVariable *>
-QUmlActivity::variable() const
+const QSet<QUmlVariable *> QUmlActivity::variable() const
{
// This is a read-write association end
diff --git a/src/uml/qumlactivity.h b/src/uml/qumlactivity.h
index cabb663b..c911b15e 100644
--- a/src/uml/qumlactivity.h
+++ b/src/uml/qumlactivity.h
@@ -65,6 +65,8 @@ public:
explicit QUmlActivity(bool createQObject = true);
virtual ~QUmlActivity();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlActivityEdge *> edge() const;
void addEdge(QUmlActivityEdge *edge);
diff --git a/src/uml/qumlactivityedge.cpp b/src/uml/qumlactivityedge.cpp
index b28fc27c..0f4b3fc8 100644
--- a/src/uml/qumlactivityedge.cpp
+++ b/src/uml/qumlactivityedge.cpp
@@ -44,10 +44,18 @@
#include <QtUml/QUmlActivityGroup>
#include <QtUml/QUmlActivityNode>
#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlStructuredActivityNode>
#include <QtUml/QUmlValueSpecification>
-
/*!
\class QUmlActivityEdge
@@ -70,13 +78,45 @@ QUmlActivityEdge::~QUmlActivityEdge()
{
}
+QModelingObject *QUmlActivityEdge::clone() const
+{
+ QUmlActivityEdge *c = new QUmlActivityEdge;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ if (guard())
+ c->setGuard(dynamic_cast<QUmlValueSpecification *>(guard()->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ if (interrupts())
+ c->setInterrupts(dynamic_cast<QUmlInterruptibleActivityRegion *>(interrupts()->clone()));
+ foreach (QUmlActivityEdge *element, redefinedEdge())
+ c->addRedefinedEdge(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ if (source())
+ c->setSource(dynamic_cast<QUmlActivityNode *>(source()->clone()));
+ if (target())
+ c->setTarget(dynamic_cast<QUmlActivityNode *>(target()->clone()));
+ if (weight())
+ c->setWeight(dynamic_cast<QUmlValueSpecification *>(weight()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Activity containing the edge.
*/
-QUmlActivity *
-QUmlActivityEdge::activity() const
+QUmlActivity *QUmlActivityEdge::activity() const
{
// This is a read-write association end
@@ -102,8 +142,7 @@ void QUmlActivityEdge::setActivity(QUmlActivity *activity)
/*!
Specification evaluated at runtime to determine if the edge can be traversed.
*/
-QUmlValueSpecification *
-QUmlActivityEdge::guard() const
+QUmlValueSpecification *QUmlActivityEdge::guard() const
{
// This is a read-write association end
@@ -133,8 +172,7 @@ void QUmlActivityEdge::setGuard(QUmlValueSpecification *guard)
/*!
Groups containing the edge.
*/
-const QSet<QUmlActivityGroup *>
-QUmlActivityEdge::inGroup() const
+const QSet<QUmlActivityGroup *> QUmlActivityEdge::inGroup() const
{
// This is a read-only derived union association end
@@ -174,8 +212,7 @@ void QUmlActivityEdge::removeInGroup(QUmlActivityGroup *inGroup)
/*!
Partitions containing the edge.
*/
-const QSet<QUmlActivityPartition *>
-QUmlActivityEdge::inPartition() const
+const QSet<QUmlActivityPartition *> QUmlActivityEdge::inPartition() const
{
// This is a read-write association end
@@ -221,8 +258,7 @@ void QUmlActivityEdge::removeInPartition(QUmlActivityPartition *inPartition)
/*!
Structured activity node containing the edge.
*/
-QUmlStructuredActivityNode *
-QUmlActivityEdge::inStructuredNode() const
+QUmlStructuredActivityNode *QUmlActivityEdge::inStructuredNode() const
{
// This is a read-write association end
@@ -252,8 +288,7 @@ void QUmlActivityEdge::setInStructuredNode(QUmlStructuredActivityNode *inStructu
/*!
Region that the edge can interrupt.
*/
-QUmlInterruptibleActivityRegion *
-QUmlActivityEdge::interrupts() const
+QUmlInterruptibleActivityRegion *QUmlActivityEdge::interrupts() const
{
// This is a read-write association end
@@ -274,8 +309,7 @@ void QUmlActivityEdge::setInterrupts(QUmlInterruptibleActivityRegion *interrupts
/*!
Inherited edges replaced by this edge in a specialization of the activity.
*/
-const QSet<QUmlActivityEdge *>
-QUmlActivityEdge::redefinedEdge() const
+const QSet<QUmlActivityEdge *> QUmlActivityEdge::redefinedEdge() const
{
// This is a read-write association end
@@ -311,8 +345,7 @@ void QUmlActivityEdge::removeRedefinedEdge(QUmlActivityEdge *redefinedEdge)
/*!
Node from which tokens are taken when they traverse the edge.
*/
-QUmlActivityNode *
-QUmlActivityEdge::source() const
+QUmlActivityNode *QUmlActivityEdge::source() const
{
// This is a read-write association end
@@ -333,8 +366,7 @@ void QUmlActivityEdge::setSource(QUmlActivityNode *source)
/*!
Node to which tokens are put when they traverse the edge.
*/
-QUmlActivityNode *
-QUmlActivityEdge::target() const
+QUmlActivityNode *QUmlActivityEdge::target() const
{
// This is a read-write association end
@@ -355,8 +387,7 @@ void QUmlActivityEdge::setTarget(QUmlActivityNode *target)
/*!
The minimum number of tokens that must traverse the edge at the same time.
*/
-QUmlValueSpecification *
-QUmlActivityEdge::weight() const
+QUmlValueSpecification *QUmlActivityEdge::weight() const
{
// This is a read-write association end
diff --git a/src/uml/qumlactivityedge.h b/src/uml/qumlactivityedge.h
index 12f16e7e..0710a2c1 100644
--- a/src/uml/qumlactivityedge.h
+++ b/src/uml/qumlactivityedge.h
@@ -65,6 +65,8 @@ class Q_UML_EXPORT QUmlActivityEdge : public QUmlRedefinableElement
public:
virtual ~QUmlActivityEdge();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QUmlActivity *activity() const;
void setActivity(QUmlActivity *activity);
diff --git a/src/uml/qumlactivityfinalnode.cpp b/src/uml/qumlactivityfinalnode.cpp
index b6cd4400..b5824274 100644
--- a/src/uml/qumlactivityfinalnode.cpp
+++ b/src/uml/qumlactivityfinalnode.cpp
@@ -42,6 +42,22 @@
#include "private/qumlactivityfinalnodeobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlActivityFinalNode
@@ -63,3 +79,32 @@ QUmlActivityFinalNode::~QUmlActivityFinalNode()
}
}
+QModelingObject *QUmlActivityFinalNode::clone() const
+{
+ QUmlActivityFinalNode *c = new QUmlActivityFinalNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlactivityfinalnode.h b/src/uml/qumlactivityfinalnode.h
index e30bb50b..758d985c 100644
--- a/src/uml/qumlactivityfinalnode.h
+++ b/src/uml/qumlactivityfinalnode.h
@@ -58,6 +58,8 @@ public:
explicit QUmlActivityFinalNode(bool createQObject = true);
virtual ~QUmlActivityFinalNode();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlactivitygroup.cpp b/src/uml/qumlactivitygroup.cpp
index 5c04439f..716f3a77 100644
--- a/src/uml/qumlactivitygroup.cpp
+++ b/src/uml/qumlactivitygroup.cpp
@@ -43,7 +43,13 @@
#include <QtUml/QUmlActivity>
#include <QtUml/QUmlActivityEdge>
#include <QtUml/QUmlActivityNode>
-
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlActivityGroup
@@ -61,13 +67,28 @@ QUmlActivityGroup::~QUmlActivityGroup()
{
}
+QModelingObject *QUmlActivityGroup::clone() const
+{
+ QUmlActivityGroup *c = new QUmlActivityGroup;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (inActivity())
+ c->setInActivity(dynamic_cast<QUmlActivity *>(inActivity()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Edges immediately contained in the group.
*/
-const QSet<QUmlActivityEdge *>
-QUmlActivityGroup::containedEdge() const
+const QSet<QUmlActivityEdge *> QUmlActivityGroup::containedEdge() const
{
// This is a read-only derived union association end
@@ -107,8 +128,7 @@ void QUmlActivityGroup::removeContainedEdge(QUmlActivityEdge *containedEdge)
/*!
Nodes immediately contained in the group.
*/
-const QSet<QUmlActivityNode *>
-QUmlActivityGroup::containedNode() const
+const QSet<QUmlActivityNode *> QUmlActivityGroup::containedNode() const
{
// This is a read-only derived union association end
@@ -148,8 +168,7 @@ void QUmlActivityGroup::removeContainedNode(QUmlActivityNode *containedNode)
/*!
Activity containing the group.
*/
-QUmlActivity *
-QUmlActivityGroup::inActivity() const
+QUmlActivity *QUmlActivityGroup::inActivity() const
{
// This is a read-write association end
@@ -175,8 +194,7 @@ void QUmlActivityGroup::setInActivity(QUmlActivity *inActivity)
/*!
Groups immediately contained in the group.
*/
-const QSet<QUmlActivityGroup *>
-QUmlActivityGroup::subgroup() const
+const QSet<QUmlActivityGroup *> QUmlActivityGroup::subgroup() const
{
// This is a read-only derived union association end
@@ -215,8 +233,7 @@ void QUmlActivityGroup::removeSubgroup(QUmlActivityGroup *subgroup)
/*!
Group immediately containing the group.
*/
-QUmlActivityGroup *
-QUmlActivityGroup::superGroup() const
+QUmlActivityGroup *QUmlActivityGroup::superGroup() const
{
// This is a read-only derived union association end
diff --git a/src/uml/qumlactivitygroup.h b/src/uml/qumlactivitygroup.h
index 9ec10483..825b83b7 100644
--- a/src/uml/qumlactivitygroup.h
+++ b/src/uml/qumlactivitygroup.h
@@ -61,6 +61,8 @@ class Q_UML_EXPORT QUmlActivityGroup : public virtual QUmlNamedElement
public:
virtual ~QUmlActivityGroup();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlActivityEdge *> containedEdge() const;
Q_DECL_HIDDEN void addContainedEdge(QUmlActivityEdge *containedEdge);
diff --git a/src/uml/qumlactivitynode.cpp b/src/uml/qumlactivitynode.cpp
index 271ef3bc..f879361d 100644
--- a/src/uml/qumlactivitynode.cpp
+++ b/src/uml/qumlactivitynode.cpp
@@ -44,9 +44,17 @@
#include <QtUml/QUmlActivityEdge>
#include <QtUml/QUmlActivityGroup>
#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlStructuredActivityNode>
-
/*!
\class QUmlActivityNode
@@ -64,13 +72,41 @@ QUmlActivityNode::~QUmlActivityNode()
{
}
+QModelingObject *QUmlActivityNode::clone() const
+{
+ QUmlActivityNode *c = new QUmlActivityNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Activity containing the node.
*/
-QUmlActivity *
-QUmlActivityNode::activity() const
+QUmlActivity *QUmlActivityNode::activity() const
{
// This is a read-write association end
@@ -96,8 +132,7 @@ void QUmlActivityNode::setActivity(QUmlActivity *activity)
/*!
Groups containing the node.
*/
-const QSet<QUmlActivityGroup *>
-QUmlActivityNode::inGroup() const
+const QSet<QUmlActivityGroup *> QUmlActivityNode::inGroup() const
{
// This is a read-only derived union association end
@@ -137,8 +172,7 @@ void QUmlActivityNode::removeInGroup(QUmlActivityGroup *inGroup)
/*!
Interruptible regions containing the node.
*/
-const QSet<QUmlInterruptibleActivityRegion *>
-QUmlActivityNode::inInterruptibleRegion() const
+const QSet<QUmlInterruptibleActivityRegion *> QUmlActivityNode::inInterruptibleRegion() const
{
// This is a read-write association end
@@ -184,8 +218,7 @@ void QUmlActivityNode::removeInInterruptibleRegion(QUmlInterruptibleActivityRegi
/*!
Partitions containing the node.
*/
-const QSet<QUmlActivityPartition *>
-QUmlActivityNode::inPartition() const
+const QSet<QUmlActivityPartition *> QUmlActivityNode::inPartition() const
{
// This is a read-write association end
@@ -231,8 +264,7 @@ void QUmlActivityNode::removeInPartition(QUmlActivityPartition *inPartition)
/*!
Structured activity node containing the node.
*/
-QUmlStructuredActivityNode *
-QUmlActivityNode::inStructuredNode() const
+QUmlStructuredActivityNode *QUmlActivityNode::inStructuredNode() const
{
// This is a read-write association end
@@ -262,8 +294,7 @@ void QUmlActivityNode::setInStructuredNode(QUmlStructuredActivityNode *inStructu
/*!
Edges that have the node as target.
*/
-const QSet<QUmlActivityEdge *>
-QUmlActivityNode::incoming() const
+const QSet<QUmlActivityEdge *> QUmlActivityNode::incoming() const
{
// This is a read-write association end
@@ -303,8 +334,7 @@ void QUmlActivityNode::removeIncoming(QUmlActivityEdge *incoming)
/*!
Edges that have the node as source.
*/
-const QSet<QUmlActivityEdge *>
-QUmlActivityNode::outgoing() const
+const QSet<QUmlActivityEdge *> QUmlActivityNode::outgoing() const
{
// This is a read-write association end
@@ -344,8 +374,7 @@ void QUmlActivityNode::removeOutgoing(QUmlActivityEdge *outgoing)
/*!
Inherited nodes replaced by this node in a specialization of the activity.
*/
-const QSet<QUmlActivityNode *>
-QUmlActivityNode::redefinedNode() const
+const QSet<QUmlActivityNode *> QUmlActivityNode::redefinedNode() const
{
// This is a read-write association end
diff --git a/src/uml/qumlactivitynode.h b/src/uml/qumlactivitynode.h
index fe48977d..8d4b32e9 100644
--- a/src/uml/qumlactivitynode.h
+++ b/src/uml/qumlactivitynode.h
@@ -64,6 +64,8 @@ class Q_UML_EXPORT QUmlActivityNode : public QUmlRedefinableElement
public:
virtual ~QUmlActivityNode();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QUmlActivity *activity() const;
void setActivity(QUmlActivity *activity);
diff --git a/src/uml/qumlactivityparameternode.cpp b/src/uml/qumlactivityparameternode.cpp
index 74cef68f..c6f870ec 100644
--- a/src/uml/qumlactivityparameternode.cpp
+++ b/src/uml/qumlactivityparameternode.cpp
@@ -42,8 +42,27 @@
#include "private/qumlactivityparameternodeobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
#include <QtUml/QUmlParameter>
-
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlState>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlActivityParameterNode
@@ -66,13 +85,53 @@ QUmlActivityParameterNode::~QUmlActivityParameterNode()
}
}
+QModelingObject *QUmlActivityParameterNode::clone() const
+{
+ QUmlActivityParameterNode *c = new QUmlActivityParameterNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ foreach (QUmlState *element, inState())
+ c->addInState(dynamic_cast<QUmlState *>(element->clone()));
+ c->setControlType(isControlType());
+ c->setOrdering(ordering());
+ if (selection())
+ c->setSelection(dynamic_cast<QUmlBehavior *>(selection()->clone()));
+ if (upperBound())
+ c->setUpperBound(dynamic_cast<QUmlValueSpecification *>(upperBound()->clone()));
+ if (parameter())
+ c->setParameter(dynamic_cast<QUmlParameter *>(parameter()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The parameter the object node will be accepting or providing values for.
*/
-QUmlParameter *
-QUmlActivityParameterNode::parameter() const
+QUmlParameter *QUmlActivityParameterNode::parameter() const
{
// This is a read-write association end
diff --git a/src/uml/qumlactivityparameternode.h b/src/uml/qumlactivityparameternode.h
index e2ef5e3e..ea1bf1d2 100644
--- a/src/uml/qumlactivityparameternode.h
+++ b/src/uml/qumlactivityparameternode.h
@@ -60,6 +60,8 @@ public:
explicit QUmlActivityParameterNode(bool createQObject = true);
virtual ~QUmlActivityParameterNode();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlParameter *parameter() const;
void setParameter(QUmlParameter *parameter);
diff --git a/src/uml/qumlactivitypartition.cpp b/src/uml/qumlactivitypartition.cpp
index 536a36ee..576613a6 100644
--- a/src/uml/qumlactivitypartition.cpp
+++ b/src/uml/qumlactivitypartition.cpp
@@ -42,10 +42,17 @@
#include "private/qumlactivitypartitionobject_p.h"
+#include <QtUml/QUmlActivity>
#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
#include <QtUml/QUmlElement>
-
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlActivityPartition
@@ -71,13 +78,40 @@ QUmlActivityPartition::~QUmlActivityPartition()
}
}
+QModelingObject *QUmlActivityPartition::clone() const
+{
+ QUmlActivityPartition *c = new QUmlActivityPartition;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (inActivity())
+ c->setInActivity(dynamic_cast<QUmlActivity *>(inActivity()->clone()));
+ foreach (QUmlActivityEdge *element, edge())
+ c->addEdge(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ c->setDimension(isDimension());
+ c->setExternal(isExternal());
+ foreach (QUmlActivityNode *element, node())
+ c->addNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ if (represents())
+ c->setRepresents(dynamic_cast<QUmlElement *>(represents()->clone()));
+ foreach (QUmlActivityPartition *element, subpartition())
+ c->addSubpartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (superPartition())
+ c->setSuperPartition(dynamic_cast<QUmlActivityPartition *>(superPartition()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Edges immediately contained in the group.
*/
-const QSet<QUmlActivityEdge *>
-QUmlActivityPartition::edge() const
+const QSet<QUmlActivityEdge *> QUmlActivityPartition::edge() const
{
// This is a read-write association end
@@ -123,8 +157,7 @@ void QUmlActivityPartition::removeEdge(QUmlActivityEdge *edge)
/*!
Tells whether the partition groups other partitions along a dimension.
*/
-bool
-QUmlActivityPartition::isDimension() const
+bool QUmlActivityPartition::isDimension() const
{
// This is a read-write property
@@ -143,8 +176,7 @@ void QUmlActivityPartition::setDimension(bool isDimension)
/*!
Tells whether the partition represents an entity to which the partitioning structure does not apply.
*/
-bool
-QUmlActivityPartition::isExternal() const
+bool QUmlActivityPartition::isExternal() const
{
// This is a read-write property
@@ -163,8 +195,7 @@ void QUmlActivityPartition::setExternal(bool isExternal)
/*!
Nodes immediately contained in the group.
*/
-const QSet<QUmlActivityNode *>
-QUmlActivityPartition::node() const
+const QSet<QUmlActivityNode *> QUmlActivityPartition::node() const
{
// This is a read-write association end
@@ -210,8 +241,7 @@ void QUmlActivityPartition::removeNode(QUmlActivityNode *node)
/*!
An element constraining behaviors invoked by nodes in the partition.
*/
-QUmlElement *
-QUmlActivityPartition::represents() const
+QUmlElement *QUmlActivityPartition::represents() const
{
// This is a read-write association end
@@ -232,8 +262,7 @@ void QUmlActivityPartition::setRepresents(QUmlElement *represents)
/*!
Partitions immediately contained in the partition.
*/
-const QSet<QUmlActivityPartition *>
-QUmlActivityPartition::subpartition() const
+const QSet<QUmlActivityPartition *> QUmlActivityPartition::subpartition() const
{
// This is a read-write association end
@@ -272,8 +301,7 @@ void QUmlActivityPartition::removeSubpartition(QUmlActivityPartition *subpartiti
/*!
Partition immediately containing the partition.
*/
-QUmlActivityPartition *
-QUmlActivityPartition::superPartition() const
+QUmlActivityPartition *QUmlActivityPartition::superPartition() const
{
// This is a read-write association end
diff --git a/src/uml/qumlactivitypartition.h b/src/uml/qumlactivitypartition.h
index de40ef37..8c2d64ec 100644
--- a/src/uml/qumlactivitypartition.h
+++ b/src/uml/qumlactivitypartition.h
@@ -62,6 +62,8 @@ public:
explicit QUmlActivityPartition(bool createQObject = true);
virtual ~QUmlActivityPartition();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlActivityEdge *> edge() const;
void addEdge(QUmlActivityEdge *edge);
diff --git a/src/uml/qumlactor.cpp b/src/uml/qumlactor.cpp
index b1da8467..ebf557a7 100644
--- a/src/uml/qumlactor.cpp
+++ b/src/uml/qumlactor.cpp
@@ -42,6 +42,35 @@
#include "private/qumlactorobject_p.h"
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlInterfaceRealization>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlActor
@@ -63,3 +92,58 @@ QUmlActor::~QUmlActor()
}
}
+QModelingObject *QUmlActor::clone() const
+{
+ QUmlActor *c = new QUmlActor;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlactor.h b/src/uml/qumlactor.h
index 2e41bb90..e70629f4 100644
--- a/src/uml/qumlactor.h
+++ b/src/uml/qumlactor.h
@@ -58,6 +58,8 @@ public:
explicit QUmlActor(bool createQObject = true);
virtual ~QUmlActor();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumladdstructuralfeaturevalueaction.cpp b/src/uml/qumladdstructuralfeaturevalueaction.cpp
index 3adbb269..49ef650c 100644
--- a/src/uml/qumladdstructuralfeaturevalueaction.cpp
+++ b/src/uml/qumladdstructuralfeaturevalueaction.cpp
@@ -42,8 +42,27 @@
#include "private/qumladdstructuralfeaturevalueactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
-
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuralFeature>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlAddStructuralFeatureValueAction
@@ -67,13 +86,59 @@ QUmlAddStructuralFeatureValueAction::~QUmlAddStructuralFeatureValueAction()
}
}
+QModelingObject *QUmlAddStructuralFeatureValueAction::clone() const
+{
+ QUmlAddStructuralFeatureValueAction *c = new QUmlAddStructuralFeatureValueAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (object())
+ c->setObject(dynamic_cast<QUmlInputPin *>(object()->clone()));
+ if (structuralFeature())
+ c->setStructuralFeature(dynamic_cast<QUmlStructuralFeature *>(structuralFeature()->clone()));
+ if (result())
+ c->setResult(dynamic_cast<QUmlOutputPin *>(result()->clone()));
+ if (value())
+ c->setValue(dynamic_cast<QUmlInputPin *>(value()->clone()));
+ if (insertAt())
+ c->setInsertAt(dynamic_cast<QUmlInputPin *>(insertAt()->clone()));
+ c->setReplaceAll(isReplaceAll());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Gives the position at which to insert a new value or move an existing value in ordered structural features. The type of the pin is UnlimitedNatural, but the value cannot be zero. This pin is omitted for unordered structural features.
*/
-QUmlInputPin *
-QUmlAddStructuralFeatureValueAction::insertAt() const
+QUmlInputPin *QUmlAddStructuralFeatureValueAction::insertAt() const
{
// This is a read-write association end
@@ -103,8 +168,7 @@ void QUmlAddStructuralFeatureValueAction::setInsertAt(QUmlInputPin *insertAt)
/*!
Specifies whether existing values of the structural feature of the object should be removed before adding the new value.
*/
-bool
-QUmlAddStructuralFeatureValueAction::isReplaceAll() const
+bool QUmlAddStructuralFeatureValueAction::isReplaceAll() const
{
// This is a read-write property
diff --git a/src/uml/qumladdstructuralfeaturevalueaction.h b/src/uml/qumladdstructuralfeaturevalueaction.h
index 5c0b5086..e1d36c62 100644
--- a/src/uml/qumladdstructuralfeaturevalueaction.h
+++ b/src/uml/qumladdstructuralfeaturevalueaction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlAddStructuralFeatureValueAction(bool createQObject = true);
virtual ~QUmlAddStructuralFeatureValueAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlInputPin *insertAt() const;
void setInsertAt(QUmlInputPin *insertAt);
diff --git a/src/uml/qumladdvariablevalueaction.cpp b/src/uml/qumladdvariablevalueaction.cpp
index 18891384..524559d8 100644
--- a/src/uml/qumladdvariablevalueaction.cpp
+++ b/src/uml/qumladdvariablevalueaction.cpp
@@ -42,8 +42,27 @@
#include "private/qumladdvariablevalueactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
-
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlVariable>
/*!
\class QUmlAddVariableValueAction
@@ -67,13 +86,55 @@ QUmlAddVariableValueAction::~QUmlAddVariableValueAction()
}
}
+QModelingObject *QUmlAddVariableValueAction::clone() const
+{
+ QUmlAddVariableValueAction *c = new QUmlAddVariableValueAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (variable())
+ c->setVariable(dynamic_cast<QUmlVariable *>(variable()->clone()));
+ if (value())
+ c->setValue(dynamic_cast<QUmlInputPin *>(value()->clone()));
+ if (insertAt())
+ c->setInsertAt(dynamic_cast<QUmlInputPin *>(insertAt()->clone()));
+ c->setReplaceAll(isReplaceAll());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Gives the position at which to insert a new value or move an existing value in ordered variables. The types is UnlimitedINatural, but the value cannot be zero. This pin is omitted for unordered variables.
*/
-QUmlInputPin *
-QUmlAddVariableValueAction::insertAt() const
+QUmlInputPin *QUmlAddVariableValueAction::insertAt() const
{
// This is a read-write association end
@@ -103,8 +164,7 @@ void QUmlAddVariableValueAction::setInsertAt(QUmlInputPin *insertAt)
/*!
Specifies whether existing values of the variable should be removed before adding the new value.
*/
-bool
-QUmlAddVariableValueAction::isReplaceAll() const
+bool QUmlAddVariableValueAction::isReplaceAll() const
{
// This is a read-write property
diff --git a/src/uml/qumladdvariablevalueaction.h b/src/uml/qumladdvariablevalueaction.h
index 36b3209b..9088ad08 100644
--- a/src/uml/qumladdvariablevalueaction.h
+++ b/src/uml/qumladdvariablevalueaction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlAddVariableValueAction(bool createQObject = true);
virtual ~QUmlAddVariableValueAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlInputPin *insertAt() const;
void setInsertAt(QUmlInputPin *insertAt);
diff --git a/src/uml/qumlanyreceiveevent.cpp b/src/uml/qumlanyreceiveevent.cpp
index d955ab24..208ff6ed 100644
--- a/src/uml/qumlanyreceiveevent.cpp
+++ b/src/uml/qumlanyreceiveevent.cpp
@@ -42,6 +42,15 @@
#include "private/qumlanyreceiveeventobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlAnyReceiveEvent
@@ -63,3 +72,21 @@ QUmlAnyReceiveEvent::~QUmlAnyReceiveEvent()
}
}
+QModelingObject *QUmlAnyReceiveEvent::clone() const
+{
+ QUmlAnyReceiveEvent *c = new QUmlAnyReceiveEvent;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ return c;
+}
+
diff --git a/src/uml/qumlanyreceiveevent.h b/src/uml/qumlanyreceiveevent.h
index 1b60c934..2e6eee35 100644
--- a/src/uml/qumlanyreceiveevent.h
+++ b/src/uml/qumlanyreceiveevent.h
@@ -58,6 +58,8 @@ public:
explicit QUmlAnyReceiveEvent(bool createQObject = true);
virtual ~QUmlAnyReceiveEvent();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlartifact.cpp b/src/uml/qumlartifact.cpp
index 4394a900..b0ab6eb9 100644
--- a/src/uml/qumlartifact.cpp
+++ b/src/uml/qumlartifact.cpp
@@ -42,10 +42,35 @@
#include "private/qumlartifactobject_p.h"
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
#include <QtUml/QUmlManifestation>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlProperty>
-
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlArtifact
@@ -67,13 +92,70 @@ QUmlArtifact::~QUmlArtifact()
}
}
+QModelingObject *QUmlArtifact::clone() const
+{
+ QUmlArtifact *c = new QUmlArtifact;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ c->setFileName(fileName());
+ foreach (QUmlManifestation *element, manifestation())
+ c->addManifestation(dynamic_cast<QUmlManifestation *>(element->clone()));
+ foreach (QUmlArtifact *element, nestedArtifact())
+ c->addNestedArtifact(dynamic_cast<QUmlArtifact *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
A concrete name that is used to refer to the Artifact in a physical context. Example: file system name, universal resource locator.
*/
-QString
-QUmlArtifact::fileName() const
+QString QUmlArtifact::fileName() const
{
// This is a read-write property
@@ -92,8 +174,7 @@ void QUmlArtifact::setFileName(QString fileName)
/*!
The set of model elements that are manifested in the Artifact. That is, these model elements are utilized in the construction (or generation) of the artifact.
*/
-const QSet<QUmlManifestation *>
-QUmlArtifact::manifestation() const
+const QSet<QUmlManifestation *> QUmlArtifact::manifestation() const
{
// This is a read-write association end
@@ -134,8 +215,7 @@ void QUmlArtifact::removeManifestation(QUmlManifestation *manifestation)
/*!
The Artifacts that are defined (nested) within the Artifact. The association is a specialization of the ownedMember association from Namespace to NamedElement.
*/
-const QSet<QUmlArtifact *>
-QUmlArtifact::nestedArtifact() const
+const QSet<QUmlArtifact *> QUmlArtifact::nestedArtifact() const
{
// This is a read-write association end
@@ -174,8 +254,7 @@ void QUmlArtifact::removeNestedArtifact(QUmlArtifact *nestedArtifact)
/*!
The attributes or association ends defined for the Artifact. The association is a specialization of the ownedMember association.
*/
-const QList<QUmlProperty *>
-QUmlArtifact::ownedAttribute() const
+const QList<QUmlProperty *> QUmlArtifact::ownedAttribute() const
{
// This is a read-write association end
@@ -216,8 +295,7 @@ void QUmlArtifact::removeOwnedAttribute(QUmlProperty *ownedAttribute)
/*!
The Operations defined for the Artifact. The association is a specialization of the ownedMember association.
*/
-const QList<QUmlOperation *>
-QUmlArtifact::ownedOperation() const
+const QList<QUmlOperation *> QUmlArtifact::ownedOperation() const
{
// This is a read-write association end
diff --git a/src/uml/qumlartifact.h b/src/uml/qumlartifact.h
index 1f8eda84..393ca4ed 100644
--- a/src/uml/qumlartifact.h
+++ b/src/uml/qumlartifact.h
@@ -63,6 +63,8 @@ public:
explicit QUmlArtifact(bool createQObject = true);
virtual ~QUmlArtifact();
+ QModelingObject *clone() const;
+
// Owned attributes
QString fileName() const;
void setFileName(QString fileName);
diff --git a/src/uml/qumlassociation.cpp b/src/uml/qumlassociation.cpp
index 620df2eb..5353db0a 100644
--- a/src/uml/qumlassociation.cpp
+++ b/src/uml/qumlassociation.cpp
@@ -42,9 +42,33 @@
#include "private/qumlassociationobject_p.h"
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
#include <QtUml/QUmlType>
-
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlAssociation
@@ -67,13 +91,68 @@ QUmlAssociation::~QUmlAssociation()
}
}
+QModelingObject *QUmlAssociation::clone() const
+{
+ QUmlAssociation *c = new QUmlAssociation;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ c->setDerived(isDerived());
+ foreach (QUmlProperty *element, memberEnd())
+ c->addMemberEnd(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlProperty *element, navigableOwnedEnd())
+ c->addNavigableOwnedEnd(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlProperty *element, ownedEnd())
+ c->addOwnedEnd(dynamic_cast<QUmlProperty *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the classifiers that are used as types of the ends of the association.
*/
-const QList<QUmlType *>
-QUmlAssociation::endType() const
+const QList<QUmlType *> QUmlAssociation::endType() const
{
// This is a read-only derived association end
@@ -115,8 +194,7 @@ void QUmlAssociation::removeEndType(QUmlType *endType)
/*!
Specifies whether the association is derived from other model elements such as other associations or constraints.
*/
-bool
-QUmlAssociation::isDerived() const
+bool QUmlAssociation::isDerived() const
{
// This is a read-write property
@@ -135,8 +213,7 @@ void QUmlAssociation::setDerived(bool isDerived)
/*!
Each end represents participation of instances of the classifier connected to the end in links of the association.
*/
-const QList<QUmlProperty *>
-QUmlAssociation::memberEnd() const
+const QList<QUmlProperty *> QUmlAssociation::memberEnd() const
{
// This is a read-write association end
@@ -182,8 +259,7 @@ void QUmlAssociation::removeMemberEnd(QUmlProperty *memberEnd)
/*!
The navigable ends that are owned by the association itself.
*/
-const QSet<QUmlProperty *>
-QUmlAssociation::navigableOwnedEnd() const
+const QSet<QUmlProperty *> QUmlAssociation::navigableOwnedEnd() const
{
// This is a read-write association end
@@ -219,8 +295,7 @@ void QUmlAssociation::removeNavigableOwnedEnd(QUmlProperty *navigableOwnedEnd)
/*!
The ends that are owned by the association itself.
*/
-const QList<QUmlProperty *>
-QUmlAssociation::ownedEnd() const
+const QList<QUmlProperty *> QUmlAssociation::ownedEnd() const
{
// This is a read-write association end
diff --git a/src/uml/qumlassociation.h b/src/uml/qumlassociation.h
index 5067de9d..06481758 100644
--- a/src/uml/qumlassociation.h
+++ b/src/uml/qumlassociation.h
@@ -62,6 +62,8 @@ public:
explicit QUmlAssociation(bool createQObject = true);
virtual ~QUmlAssociation();
+ QModelingObject *clone() const;
+
// Owned attributes
const QList<QUmlType *> endType() const;
Q_DECL_HIDDEN void addEndType(QUmlType *endType);
diff --git a/src/uml/qumlassociationclass.cpp b/src/uml/qumlassociationclass.cpp
index 2bfddf63..4bdc8350 100644
--- a/src/uml/qumlassociationclass.cpp
+++ b/src/uml/qumlassociationclass.cpp
@@ -42,6 +42,42 @@
#include "private/qumlassociationclassobject_p.h"
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClass>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElement>
+#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExtension>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlInterfaceRealization>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlReception>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlAssociationClass
@@ -65,3 +101,76 @@ QUmlAssociationClass::~QUmlAssociationClass()
}
}
+QModelingObject *QUmlAssociationClass::clone() const
+{
+ QUmlAssociationClass *c = new QUmlAssociationClass;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlConnector *element, ownedConnector())
+ c->addOwnedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setActive(isActive());
+ foreach (QUmlClassifier *element, nestedClassifier())
+ c->addNestedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ foreach (QUmlReception *element, ownedReception())
+ c->addOwnedReception(dynamic_cast<QUmlReception *>(element->clone()));
+ c->setDerived(isDerived());
+ foreach (QUmlProperty *element, memberEnd())
+ c->addMemberEnd(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlProperty *element, navigableOwnedEnd())
+ c->addNavigableOwnedEnd(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlProperty *element, ownedEnd())
+ c->addOwnedEnd(dynamic_cast<QUmlProperty *>(element->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlassociationclass.h b/src/uml/qumlassociationclass.h
index df1ae8e5..9aa58662 100644
--- a/src/uml/qumlassociationclass.h
+++ b/src/uml/qumlassociationclass.h
@@ -59,6 +59,8 @@ public:
explicit QUmlAssociationClass(bool createQObject = true);
virtual ~QUmlAssociationClass();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlbehavior.cpp b/src/uml/qumlbehavior.cpp
index cec9f20c..8992c2f6 100644
--- a/src/uml/qumlbehavior.cpp
+++ b/src/uml/qumlbehavior.cpp
@@ -42,10 +42,43 @@
#include <QtUml/QUmlBehavioralFeature>
#include <QtUml/QUmlBehavioredClassifier>
+#include <QtUml/QUmlClass>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElement>
+#include <QtUml/QUmlConnector>
#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExtension>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlInterfaceRealization>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
#include <QtUml/QUmlParameter>
+#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlParameterSet>
-
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlReception>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlBehavior
@@ -64,13 +97,91 @@ QUmlBehavior::~QUmlBehavior()
{
}
+QModelingObject *QUmlBehavior::clone() const
+{
+ QUmlBehavior *c = new QUmlBehavior;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlConnector *element, ownedConnector())
+ c->addOwnedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setActive(isActive());
+ foreach (QUmlClassifier *element, nestedClassifier())
+ c->addNestedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ foreach (QUmlReception *element, ownedReception())
+ c->addOwnedReception(dynamic_cast<QUmlReception *>(element->clone()));
+ c->setReentrant(isReentrant());
+ foreach (QUmlParameter *element, ownedParameter())
+ c->addOwnedParameter(dynamic_cast<QUmlParameter *>(element->clone()));
+ foreach (QUmlParameterSet *element, ownedParameterSet())
+ c->addOwnedParameterSet(dynamic_cast<QUmlParameterSet *>(element->clone()));
+ foreach (QUmlConstraint *element, postcondition())
+ c->addPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, precondition())
+ c->addPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlBehavior *element, redefinedBehavior())
+ c->addRedefinedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ if (specification())
+ c->setSpecification(dynamic_cast<QUmlBehavioralFeature *>(specification()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The classifier that is the context for the execution of the behavior. If the behavior is owned by a BehavioredClassifier, that classifier is the context. Otherwise, the context is the first BehavioredClassifier reached by following the chain of owner relationships. For example, following this algorithm, the context of an entry action in a state machine is the classifier that owns the state machine. The features of the context classifier as well as the elements visible to the context classifier are visible to the behavior.
*/
-QUmlBehavioredClassifier *
-QUmlBehavior::context() const
+QUmlBehavioredClassifier *QUmlBehavior::context() const
{
// This is a read-only derived association end
@@ -102,8 +213,7 @@ void QUmlBehavior::setContext(QUmlBehavioredClassifier *context)
/*!
Tells whether the behavior can be invoked while it is still executing from a previous invocation.
*/
-bool
-QUmlBehavior::isReentrant() const
+bool QUmlBehavior::isReentrant() const
{
// This is a read-write property
@@ -122,8 +232,7 @@ void QUmlBehavior::setReentrant(bool isReentrant)
/*!
References a list of parameters to the behavior which describes the order and type of arguments that can be given when the behavior is invoked and of the values which will be returned when the behavior completes its execution.
*/
-const QList<QUmlParameter *>
-QUmlBehavior::ownedParameter() const
+const QList<QUmlParameter *> QUmlBehavior::ownedParameter() const
{
// This is a read-write association end
@@ -162,8 +271,7 @@ void QUmlBehavior::removeOwnedParameter(QUmlParameter *ownedParameter)
/*!
The ParameterSets owned by this Behavior.
*/
-const QSet<QUmlParameterSet *>
-QUmlBehavior::ownedParameterSet() const
+const QSet<QUmlParameterSet *> QUmlBehavior::ownedParameterSet() const
{
// This is a read-write association end
@@ -202,8 +310,7 @@ void QUmlBehavior::removeOwnedParameterSet(QUmlParameterSet *ownedParameterSet)
/*!
An optional set of Constraints specifying what is fulfilled after the execution of the behavior is completed, if its precondition was fulfilled before its invocation.
*/
-const QSet<QUmlConstraint *>
-QUmlBehavior::postcondition() const
+const QSet<QUmlConstraint *> QUmlBehavior::postcondition() const
{
// This is a read-write association end
@@ -242,8 +349,7 @@ void QUmlBehavior::removePostcondition(QUmlConstraint *postcondition)
/*!
An optional set of Constraints specifying what must be fulfilled when the behavior is invoked.
*/
-const QSet<QUmlConstraint *>
-QUmlBehavior::precondition() const
+const QSet<QUmlConstraint *> QUmlBehavior::precondition() const
{
// This is a read-write association end
@@ -282,8 +388,7 @@ void QUmlBehavior::removePrecondition(QUmlConstraint *precondition)
/*!
References a behavior that this behavior redefines. A subtype of Behavior may redefine any other subtype of Behavior. If the behavior implements a behavioral feature, it replaces the redefined behavior. If the behavior is a classifier behavior, it extends the redefined behavior.
*/
-const QSet<QUmlBehavior *>
-QUmlBehavior::redefinedBehavior() const
+const QSet<QUmlBehavior *> QUmlBehavior::redefinedBehavior() const
{
// This is a read-write association end
@@ -319,8 +424,7 @@ void QUmlBehavior::removeRedefinedBehavior(QUmlBehavior *redefinedBehavior)
/*!
Designates a behavioral feature that the behavior implements. The behavioral feature must be owned by the classifier that owns the behavior or be inherited by it. The parameters of the behavioral feature and the implementing behavior must match. A behavior does not need to have a specification, in which case it either is the classifer behavior of a BehavioredClassifier or it can only be invoked by another behavior of the classifier.
*/
-QUmlBehavioralFeature *
-QUmlBehavior::specification() const
+QUmlBehavioralFeature *QUmlBehavior::specification() const
{
// This is a read-write association end
diff --git a/src/uml/qumlbehavior.h b/src/uml/qumlbehavior.h
index 99f8fca8..2abba3d8 100644
--- a/src/uml/qumlbehavior.h
+++ b/src/uml/qumlbehavior.h
@@ -63,6 +63,8 @@ class Q_UML_EXPORT QUmlBehavior : public QUmlClass
public:
virtual ~QUmlBehavior();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QUmlBehavioredClassifier *context() const;
Q_DECL_HIDDEN void setContext(QUmlBehavioredClassifier *context);
diff --git a/src/uml/qumlbehavioralfeature.cpp b/src/uml/qumlbehavioralfeature.cpp
index 8d7bbef0..c410a044 100644
--- a/src/uml/qumlbehavioralfeature.cpp
+++ b/src/uml/qumlbehavioralfeature.cpp
@@ -41,11 +41,22 @@
#include "qumlbehavioralfeature.h"
#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
#include <QtUml/QUmlParameter>
#include <QtUml/QUmlParameterSet>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlType>
-
/*!
\class QUmlBehavioralFeature
@@ -63,13 +74,44 @@ QUmlBehavioralFeature::~QUmlBehavioralFeature()
{
}
+QModelingObject *QUmlBehavioralFeature::clone() const
+{
+ QUmlBehavioralFeature *c = new QUmlBehavioralFeature;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ c->setLeaf(isLeaf());
+ c->setStatic(isStatic());
+ c->setConcurrency(concurrency());
+ c->setAbstract(isAbstract());
+ foreach (QUmlBehavior *element, method())
+ c->addMethod(dynamic_cast<QUmlBehavior *>(element->clone()));
+ foreach (QUmlParameter *element, ownedParameter())
+ c->addOwnedParameter(dynamic_cast<QUmlParameter *>(element->clone()));
+ foreach (QUmlParameterSet *element, ownedParameterSet())
+ c->addOwnedParameterSet(dynamic_cast<QUmlParameterSet *>(element->clone()));
+ foreach (QUmlType *element, raisedException())
+ c->addRaisedException(dynamic_cast<QUmlType *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies the semantics of concurrent calls to the same passive instance (i.e., an instance originating from a class with isActive being false). Active instances control access to their own behavioral features.
*/
-QtUml::CallConcurrencyKind
-QUmlBehavioralFeature::concurrency() const
+QtUml::CallConcurrencyKind QUmlBehavioralFeature::concurrency() const
{
// This is a read-write property
@@ -88,8 +130,7 @@ void QUmlBehavioralFeature::setConcurrency(QtUml::CallConcurrencyKind concurrenc
/*!
If true, then the behavioral feature does not have an implementation, and one must be supplied by a more specific element. If false, the behavioral feature must have an implementation in the classifier or one must be inherited from a more general element.
*/
-bool
-QUmlBehavioralFeature::isAbstract() const
+bool QUmlBehavioralFeature::isAbstract() const
{
// This is a read-write property
@@ -108,8 +149,7 @@ void QUmlBehavioralFeature::setAbstract(bool isAbstract)
/*!
A behavioral description that implements the behavioral feature. There may be at most one behavior for a particular pairing of a classifier (as owner of the behavior) and a behavioral feature (as specification of the behavior).
*/
-const QSet<QUmlBehavior *>
-QUmlBehavioralFeature::method() const
+const QSet<QUmlBehavior *> QUmlBehavioralFeature::method() const
{
// This is a read-write association end
@@ -149,8 +189,7 @@ void QUmlBehavioralFeature::removeMethod(QUmlBehavior *method)
/*!
Specifies the ordered set of formal parameters of this BehavioralFeature.
*/
-const QList<QUmlParameter *>
-QUmlBehavioralFeature::ownedParameter() const
+const QList<QUmlParameter *> QUmlBehavioralFeature::ownedParameter() const
{
// This is a read-write association end
@@ -189,8 +228,7 @@ void QUmlBehavioralFeature::removeOwnedParameter(QUmlParameter *ownedParameter)
/*!
The ParameterSets owned by this BehavioralFeature.
*/
-const QSet<QUmlParameterSet *>
-QUmlBehavioralFeature::ownedParameterSet() const
+const QSet<QUmlParameterSet *> QUmlBehavioralFeature::ownedParameterSet() const
{
// This is a read-write association end
@@ -229,8 +267,7 @@ void QUmlBehavioralFeature::removeOwnedParameterSet(QUmlParameterSet *ownedParam
/*!
References the Types representing exceptions that may be raised during an invocation of this feature.
*/
-const QSet<QUmlType *>
-QUmlBehavioralFeature::raisedException() const
+const QSet<QUmlType *> QUmlBehavioralFeature::raisedException() const
{
// This is a read-write association end
diff --git a/src/uml/qumlbehavioralfeature.h b/src/uml/qumlbehavioralfeature.h
index dd678e73..5b6cf554 100644
--- a/src/uml/qumlbehavioralfeature.h
+++ b/src/uml/qumlbehavioralfeature.h
@@ -66,6 +66,8 @@ class Q_UML_EXPORT QUmlBehavioralFeature : public QUmlNamespace, public QUmlFeat
public:
virtual ~QUmlBehavioralFeature();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QtUml::CallConcurrencyKind concurrency() const;
void setConcurrency(QtUml::CallConcurrencyKind concurrency);
diff --git a/src/uml/qumlbehavioredclassifier.cpp b/src/uml/qumlbehavioredclassifier.cpp
index 95524330..fcf09985 100644
--- a/src/uml/qumlbehavioredclassifier.cpp
+++ b/src/uml/qumlbehavioredclassifier.cpp
@@ -41,8 +41,34 @@
#include "qumlbehavioredclassifier.h"
#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
#include <QtUml/QUmlInterfaceRealization>
-
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlBehavioredClassifier
@@ -59,13 +85,67 @@ QUmlBehavioredClassifier::~QUmlBehavioredClassifier()
{
}
+QModelingObject *QUmlBehavioredClassifier::clone() const
+{
+ QUmlBehavioredClassifier *c = new QUmlBehavioredClassifier;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
A behavior specification that specifies the behavior of the classifier itself.
*/
-QUmlBehavior *
-QUmlBehavioredClassifier::classifierBehavior() const
+QUmlBehavior *QUmlBehavioredClassifier::classifierBehavior() const
{
// This is a read-write association end
@@ -94,8 +174,7 @@ void QUmlBehavioredClassifier::setClassifierBehavior(QUmlBehavior *classifierBeh
/*!
The set of InterfaceRealizations owned by the BehavioredClassifier. Interface realizations reference the Interfaces of which the BehavioredClassifier is an implementation.
*/
-const QSet<QUmlInterfaceRealization *>
-QUmlBehavioredClassifier::interfaceRealization() const
+const QSet<QUmlInterfaceRealization *> QUmlBehavioredClassifier::interfaceRealization() const
{
// This is a read-write association end
@@ -146,8 +225,7 @@ void QUmlBehavioredClassifier::removeInterfaceRealization(QUmlInterfaceRealizati
/*!
References behavior specifications owned by a classifier.
*/
-const QSet<QUmlBehavior *>
-QUmlBehavioredClassifier::ownedBehavior() const
+const QSet<QUmlBehavior *> QUmlBehavioredClassifier::ownedBehavior() const
{
// This is a read-write association end
diff --git a/src/uml/qumlbehavioredclassifier.h b/src/uml/qumlbehavioredclassifier.h
index 81b55fdf..3da3d343 100644
--- a/src/uml/qumlbehavioredclassifier.h
+++ b/src/uml/qumlbehavioredclassifier.h
@@ -60,6 +60,8 @@ class Q_UML_EXPORT QUmlBehavioredClassifier : public virtual QUmlClassifier
public:
virtual ~QUmlBehavioredClassifier();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QUmlBehavior *classifierBehavior() const;
void setClassifierBehavior(QUmlBehavior *classifierBehavior);
diff --git a/src/uml/qumlbehaviorexecutionspecification.cpp b/src/uml/qumlbehaviorexecutionspecification.cpp
index 44a3c785..f4bfa7f7 100644
--- a/src/uml/qumlbehaviorexecutionspecification.cpp
+++ b/src/uml/qumlbehaviorexecutionspecification.cpp
@@ -43,7 +43,18 @@
#include "private/qumlbehaviorexecutionspecificationobject_p.h"
#include <QtUml/QUmlBehavior>
-
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlGeneralOrdering>
+#include <QtUml/QUmlInteraction>
+#include <QtUml/QUmlInteractionOperand>
+#include <QtUml/QUmlLifeline>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOccurrenceSpecification>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlBehaviorExecutionSpecification
@@ -66,13 +77,40 @@ QUmlBehaviorExecutionSpecification::~QUmlBehaviorExecutionSpecification()
}
}
+QModelingObject *QUmlBehaviorExecutionSpecification::clone() const
+{
+ QUmlBehaviorExecutionSpecification *c = new QUmlBehaviorExecutionSpecification;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlLifeline *element, covered())
+ c->addCovered(dynamic_cast<QUmlLifeline *>(element->clone()));
+ if (enclosingInteraction())
+ c->setEnclosingInteraction(dynamic_cast<QUmlInteraction *>(enclosingInteraction()->clone()));
+ if (enclosingOperand())
+ c->setEnclosingOperand(dynamic_cast<QUmlInteractionOperand *>(enclosingOperand()->clone()));
+ foreach (QUmlGeneralOrdering *element, generalOrdering())
+ c->addGeneralOrdering(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ if (finish())
+ c->setFinish(dynamic_cast<QUmlOccurrenceSpecification *>(finish()->clone()));
+ if (start())
+ c->setStart(dynamic_cast<QUmlOccurrenceSpecification *>(start()->clone()));
+ if (behavior())
+ c->setBehavior(dynamic_cast<QUmlBehavior *>(behavior()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Behavior whose execution is occurring.
*/
-QUmlBehavior *
-QUmlBehaviorExecutionSpecification::behavior() const
+QUmlBehavior *QUmlBehaviorExecutionSpecification::behavior() const
{
// This is a read-write association end
diff --git a/src/uml/qumlbehaviorexecutionspecification.h b/src/uml/qumlbehaviorexecutionspecification.h
index bfa3e721..1d5db8c7 100644
--- a/src/uml/qumlbehaviorexecutionspecification.h
+++ b/src/uml/qumlbehaviorexecutionspecification.h
@@ -60,6 +60,8 @@ public:
explicit QUmlBehaviorExecutionSpecification(bool createQObject = true);
virtual ~QUmlBehaviorExecutionSpecification();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlBehavior *behavior() const;
void setBehavior(QUmlBehavior *behavior);
diff --git a/src/uml/qumlbroadcastsignalaction.cpp b/src/uml/qumlbroadcastsignalaction.cpp
index 4a52bc89..5a990c0c 100644
--- a/src/uml/qumlbroadcastsignalaction.cpp
+++ b/src/uml/qumlbroadcastsignalaction.cpp
@@ -42,8 +42,28 @@
#include "private/qumlbroadcastsignalactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlRedefinableElement>
#include <QtUml/QUmlSignal>
-
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlBroadcastSignalAction
@@ -66,13 +86,54 @@ QUmlBroadcastSignalAction::~QUmlBroadcastSignalAction()
}
}
+QModelingObject *QUmlBroadcastSignalAction::clone() const
+{
+ QUmlBroadcastSignalAction *c = new QUmlBroadcastSignalAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlInputPin *element, argument())
+ c->addArgument(dynamic_cast<QUmlInputPin *>(element->clone()));
+ if (onPort())
+ c->setOnPort(dynamic_cast<QUmlPort *>(onPort()->clone()));
+ if (signal())
+ c->setSignal(dynamic_cast<QUmlSignal *>(signal()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The specification of signal object transmitted to the target objects.
*/
-QUmlSignal *
-QUmlBroadcastSignalAction::signal() const
+QUmlSignal *QUmlBroadcastSignalAction::signal() const
{
// This is a read-write association end
diff --git a/src/uml/qumlbroadcastsignalaction.h b/src/uml/qumlbroadcastsignalaction.h
index e8cc1448..8287c710 100644
--- a/src/uml/qumlbroadcastsignalaction.h
+++ b/src/uml/qumlbroadcastsignalaction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlBroadcastSignalAction(bool createQObject = true);
virtual ~QUmlBroadcastSignalAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlSignal *signal() const;
void setSignal(QUmlSignal *signal);
diff --git a/src/uml/qumlcallaction.cpp b/src/uml/qumlcallaction.cpp
index b3b32597..c4d2d4b8 100644
--- a/src/uml/qumlcallaction.cpp
+++ b/src/uml/qumlcallaction.cpp
@@ -40,8 +40,27 @@
****************************************************************************/
#include "qumlcallaction.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlCallAction
@@ -58,13 +77,55 @@ QUmlCallAction::~QUmlCallAction()
{
}
+QModelingObject *QUmlCallAction::clone() const
+{
+ QUmlCallAction *c = new QUmlCallAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlInputPin *element, argument())
+ c->addArgument(dynamic_cast<QUmlInputPin *>(element->clone()));
+ if (onPort())
+ c->setOnPort(dynamic_cast<QUmlPort *>(onPort()->clone()));
+ c->setSynchronous(isSynchronous());
+ foreach (QUmlOutputPin *element, result())
+ c->addResult(dynamic_cast<QUmlOutputPin *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
If true, the call is synchronous and the caller waits for completion of the invoked behavior. If false, the call is asynchronous and the caller proceeds immediately and does not expect a return values.
*/
-bool
-QUmlCallAction::isSynchronous() const
+bool QUmlCallAction::isSynchronous() const
{
// This is a read-write property
@@ -83,8 +144,7 @@ void QUmlCallAction::setSynchronous(bool isSynchronous)
/*!
A list of output pins where the results of performing the invocation are placed.
*/
-const QList<QUmlOutputPin *>
-QUmlCallAction::result() const
+const QList<QUmlOutputPin *> QUmlCallAction::result() const
{
// This is a read-write association end
diff --git a/src/uml/qumlcallaction.h b/src/uml/qumlcallaction.h
index b2ffbe8d..e2d592ac 100644
--- a/src/uml/qumlcallaction.h
+++ b/src/uml/qumlcallaction.h
@@ -59,6 +59,8 @@ class Q_UML_EXPORT QUmlCallAction : public QUmlInvocationAction
public:
virtual ~QUmlCallAction();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
bool isSynchronous() const;
void setSynchronous(bool isSynchronous);
diff --git a/src/uml/qumlcallbehavioraction.cpp b/src/uml/qumlcallbehavioraction.cpp
index a943bdee..e6ef87c1 100644
--- a/src/uml/qumlcallbehavioraction.cpp
+++ b/src/uml/qumlcallbehavioraction.cpp
@@ -42,8 +42,28 @@
#include "private/qumlcallbehavioractionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
#include <QtUml/QUmlBehavior>
-
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlCallBehaviorAction
@@ -66,13 +86,57 @@ QUmlCallBehaviorAction::~QUmlCallBehaviorAction()
}
}
+QModelingObject *QUmlCallBehaviorAction::clone() const
+{
+ QUmlCallBehaviorAction *c = new QUmlCallBehaviorAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlInputPin *element, argument())
+ c->addArgument(dynamic_cast<QUmlInputPin *>(element->clone()));
+ if (onPort())
+ c->setOnPort(dynamic_cast<QUmlPort *>(onPort()->clone()));
+ c->setSynchronous(isSynchronous());
+ foreach (QUmlOutputPin *element, result())
+ c->addResult(dynamic_cast<QUmlOutputPin *>(element->clone()));
+ if (behavior())
+ c->setBehavior(dynamic_cast<QUmlBehavior *>(behavior()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The invoked behavior. It must be capable of accepting and returning control.
*/
-QUmlBehavior *
-QUmlCallBehaviorAction::behavior() const
+QUmlBehavior *QUmlCallBehaviorAction::behavior() const
{
// This is a read-write association end
diff --git a/src/uml/qumlcallbehavioraction.h b/src/uml/qumlcallbehavioraction.h
index dcc05cb8..5400be08 100644
--- a/src/uml/qumlcallbehavioraction.h
+++ b/src/uml/qumlcallbehavioraction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlCallBehaviorAction(bool createQObject = true);
virtual ~QUmlCallBehaviorAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlBehavior *behavior() const;
void setBehavior(QUmlBehavior *behavior);
diff --git a/src/uml/qumlcallevent.cpp b/src/uml/qumlcallevent.cpp
index bfc94ddf..eac7d9db 100644
--- a/src/uml/qumlcallevent.cpp
+++ b/src/uml/qumlcallevent.cpp
@@ -42,8 +42,16 @@
#include "private/qumlcalleventobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOperation>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlCallEvent
@@ -66,13 +74,32 @@ QUmlCallEvent::~QUmlCallEvent()
}
}
+QModelingObject *QUmlCallEvent::clone() const
+{
+ QUmlCallEvent *c = new QUmlCallEvent;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (operation())
+ c->setOperation(dynamic_cast<QUmlOperation *>(operation()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Designates the operation whose invocation raised the call event.
*/
-QUmlOperation *
-QUmlCallEvent::operation() const
+QUmlOperation *QUmlCallEvent::operation() const
{
// This is a read-write association end
diff --git a/src/uml/qumlcallevent.h b/src/uml/qumlcallevent.h
index 4bd1472c..c4a20120 100644
--- a/src/uml/qumlcallevent.h
+++ b/src/uml/qumlcallevent.h
@@ -60,6 +60,8 @@ public:
explicit QUmlCallEvent(bool createQObject = true);
virtual ~QUmlCallEvent();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlOperation *operation() const;
void setOperation(QUmlOperation *operation);
diff --git a/src/uml/qumlcalloperationaction.cpp b/src/uml/qumlcalloperationaction.cpp
index 6a2926e9..e57b9f0d 100644
--- a/src/uml/qumlcalloperationaction.cpp
+++ b/src/uml/qumlcalloperationaction.cpp
@@ -42,9 +42,28 @@
#include "private/qumlcalloperationactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOperation>
-
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlCallOperationAction
@@ -68,13 +87,59 @@ QUmlCallOperationAction::~QUmlCallOperationAction()
}
}
+QModelingObject *QUmlCallOperationAction::clone() const
+{
+ QUmlCallOperationAction *c = new QUmlCallOperationAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlInputPin *element, argument())
+ c->addArgument(dynamic_cast<QUmlInputPin *>(element->clone()));
+ if (onPort())
+ c->setOnPort(dynamic_cast<QUmlPort *>(onPort()->clone()));
+ c->setSynchronous(isSynchronous());
+ foreach (QUmlOutputPin *element, result())
+ c->addResult(dynamic_cast<QUmlOutputPin *>(element->clone()));
+ if (operation())
+ c->setOperation(dynamic_cast<QUmlOperation *>(operation()->clone()));
+ if (target())
+ c->setTarget(dynamic_cast<QUmlInputPin *>(target()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The operation to be invoked by the action execution.
*/
-QUmlOperation *
-QUmlCallOperationAction::operation() const
+QUmlOperation *QUmlCallOperationAction::operation() const
{
// This is a read-write association end
@@ -95,8 +160,7 @@ void QUmlCallOperationAction::setOperation(QUmlOperation *operation)
/*!
The target object to which the request is sent. The classifier of the target object is used to dynamically determine a behavior to invoke. This object constitutes the context of the execution of the operation.
*/
-QUmlInputPin *
-QUmlCallOperationAction::target() const
+QUmlInputPin *QUmlCallOperationAction::target() const
{
// This is a read-write association end
diff --git a/src/uml/qumlcalloperationaction.h b/src/uml/qumlcalloperationaction.h
index 7397f9fd..c8355a85 100644
--- a/src/uml/qumlcalloperationaction.h
+++ b/src/uml/qumlcalloperationaction.h
@@ -61,6 +61,8 @@ public:
explicit QUmlCallOperationAction(bool createQObject = true);
virtual ~QUmlCallOperationAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlOperation *operation() const;
void setOperation(QUmlOperation *operation);
diff --git a/src/uml/qumlcentralbuffernode.cpp b/src/uml/qumlcentralbuffernode.cpp
index f97a6f7d..5cc14e2f 100644
--- a/src/uml/qumlcentralbuffernode.cpp
+++ b/src/uml/qumlcentralbuffernode.cpp
@@ -42,6 +42,26 @@
#include "private/qumlcentralbuffernodeobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlState>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlCentralBufferNode
@@ -63,3 +83,42 @@ QUmlCentralBufferNode::~QUmlCentralBufferNode()
}
}
+QModelingObject *QUmlCentralBufferNode::clone() const
+{
+ QUmlCentralBufferNode *c = new QUmlCentralBufferNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ foreach (QUmlState *element, inState())
+ c->addInState(dynamic_cast<QUmlState *>(element->clone()));
+ c->setControlType(isControlType());
+ c->setOrdering(ordering());
+ if (selection())
+ c->setSelection(dynamic_cast<QUmlBehavior *>(selection()->clone()));
+ if (upperBound())
+ c->setUpperBound(dynamic_cast<QUmlValueSpecification *>(upperBound()->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlcentralbuffernode.h b/src/uml/qumlcentralbuffernode.h
index 297ff035..fc95cdc6 100644
--- a/src/uml/qumlcentralbuffernode.h
+++ b/src/uml/qumlcentralbuffernode.h
@@ -58,6 +58,8 @@ public:
explicit QUmlCentralBufferNode(bool createQObject = true);
virtual ~QUmlCentralBufferNode();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlchangeevent.cpp b/src/uml/qumlchangeevent.cpp
index 3d27eb7b..1b428fd7 100644
--- a/src/uml/qumlchangeevent.cpp
+++ b/src/uml/qumlchangeevent.cpp
@@ -42,8 +42,16 @@
#include "private/qumlchangeeventobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
#include <QtUml/QUmlValueSpecification>
-
/*!
\class QUmlChangeEvent
@@ -66,13 +74,32 @@ QUmlChangeEvent::~QUmlChangeEvent()
}
}
+QModelingObject *QUmlChangeEvent::clone() const
+{
+ QUmlChangeEvent *c = new QUmlChangeEvent;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (changeExpression())
+ c->setChangeExpression(dynamic_cast<QUmlValueSpecification *>(changeExpression()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
A Boolean-valued expression that will result in a change event whenever its value changes from false to true.
*/
-QUmlValueSpecification *
-QUmlChangeEvent::changeExpression() const
+QUmlValueSpecification *QUmlChangeEvent::changeExpression() const
{
// This is a read-write association end
diff --git a/src/uml/qumlchangeevent.h b/src/uml/qumlchangeevent.h
index 89d7c652..41a3b861 100644
--- a/src/uml/qumlchangeevent.h
+++ b/src/uml/qumlchangeevent.h
@@ -60,6 +60,8 @@ public:
explicit QUmlChangeEvent(bool createQObject = true);
virtual ~QUmlChangeEvent();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlValueSpecification *changeExpression() const;
void setChangeExpression(QUmlValueSpecification *changeExpression);
diff --git a/src/uml/qumlclass.cpp b/src/uml/qumlclass.cpp
index 4e1d2d0d..c7328e4d 100644
--- a/src/uml/qumlclass.cpp
+++ b/src/uml/qumlclass.cpp
@@ -42,13 +42,41 @@
#include "private/qumlclassobject_p.h"
+#include <QtUml/QUmlBehavior>
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElement>
+#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
#include <QtUml/QUmlExtension>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlInterfaceRealization>
#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlPort>
#include <QtUml/QUmlProperty>
#include <QtUml/QUmlReception>
-
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlClass
@@ -72,13 +100,78 @@ QUmlClass::~QUmlClass()
}
}
+QModelingObject *QUmlClass::clone() const
+{
+ QUmlClass *c = new QUmlClass;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlConnector *element, ownedConnector())
+ c->addOwnedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setActive(isActive());
+ foreach (QUmlClassifier *element, nestedClassifier())
+ c->addNestedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ foreach (QUmlReception *element, ownedReception())
+ c->addOwnedReception(dynamic_cast<QUmlReception *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the Extensions that specify additional properties of the metaclass. The property is derived from the extensions whose memberEnds are typed by the Class.
*/
-const QSet<QUmlExtension *>
-QUmlClass::extension() const
+const QSet<QUmlExtension *> QUmlClass::extension() const
{
// This is a read-only derived association end
@@ -124,8 +217,7 @@ void QUmlClass::removeExtension(QUmlExtension *extension)
/*!
If true, the Classifier does not provide a complete declaration and can typically not be instantiated. An abstract classifier is intended to be used by other classifiers e.g. as the target of general metarelationships or generalization relationships.True when a class is abstract.
*/
-bool
-QUmlClass::isAbstract() const
+bool QUmlClass::isAbstract() const
{
// This is a read-write property
@@ -144,8 +236,7 @@ void QUmlClass::setAbstract(bool isAbstract)
/*!
Determines whether an object specified by this class is active or not. If true, then the owning class is referred to as an active class. If false, then such a class is referred to as a passive class.
*/
-bool
-QUmlClass::isActive() const
+bool QUmlClass::isActive() const
{
// This is a read-write property
@@ -164,8 +255,7 @@ void QUmlClass::setActive(bool isActive)
/*!
References all the Classifiers that are defined (nested) within the Class.
*/
-const QList<QUmlClassifier *>
-QUmlClass::nestedClassifier() const
+const QList<QUmlClassifier *> QUmlClass::nestedClassifier() const
{
// This is a read-write association end
@@ -204,8 +294,7 @@ void QUmlClass::removeNestedClassifier(QUmlClassifier *nestedClassifier)
/*!
The attributes (i.e. the properties) owned by the class.
*/
-const QList<QUmlProperty *>
-QUmlClass::ownedAttribute() const
+const QList<QUmlProperty *> QUmlClass::ownedAttribute() const
{
// This is a read-write association end
@@ -256,8 +345,7 @@ void QUmlClass::removeOwnedAttribute(QUmlProperty *ownedAttribute)
/*!
The operations owned by the class.
*/
-const QList<QUmlOperation *>
-QUmlClass::ownedOperation() const
+const QList<QUmlOperation *> QUmlClass::ownedOperation() const
{
// This is a read-write association end
@@ -308,8 +396,7 @@ void QUmlClass::removeOwnedOperation(QUmlOperation *ownedOperation)
/*!
Receptions that objects of this class are willing to accept.
*/
-const QSet<QUmlReception *>
-QUmlClass::ownedReception() const
+const QSet<QUmlReception *> QUmlClass::ownedReception() const
{
// This is a read-write association end
@@ -350,8 +437,7 @@ void QUmlClass::removeOwnedReception(QUmlReception *ownedReception)
/*!
This gives the superclasses of a class.
*/
-const QSet<QUmlClass *>
-QUmlClass::superClass() const
+const QSet<QUmlClass *> QUmlClass::superClass() const
{
// This is a read-write derived association end
diff --git a/src/uml/qumlclass.h b/src/uml/qumlclass.h
index 1dec16e4..ec7ebbc9 100644
--- a/src/uml/qumlclass.h
+++ b/src/uml/qumlclass.h
@@ -66,6 +66,8 @@ public:
explicit QUmlClass(bool createQObject = true);
virtual ~QUmlClass();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlExtension *> extension() const;
Q_DECL_HIDDEN void addExtension(QUmlExtension *extension);
diff --git a/src/uml/qumlclassifier.cpp b/src/uml/qumlclassifier.cpp
index a46fcdb7..8c9d29db 100644
--- a/src/uml/qumlclassifier.cpp
+++ b/src/uml/qumlclassifier.cpp
@@ -42,15 +42,30 @@
#include <QtUml/QUmlClassifierTemplateParameter>
#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
#include <QtUml/QUmlFeature>
#include <QtUml/QUmlGeneralization>
#include <QtUml/QUmlGeneralizationSet>
#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlRedefinableElement>
#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
#include <QtUml/QUmlUseCase>
-
/*!
\class QUmlClassifier
@@ -71,13 +86,61 @@ QUmlClassifier::~QUmlClassifier()
{
}
+QModelingObject *QUmlClassifier::clone() const
+{
+ QUmlClassifier *c = new QUmlClassifier;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Refers to all of the Properties that are direct (i.e. not inherited or imported) attributes of the classifier.
*/
-const QSet<QUmlProperty *>
-QUmlClassifier::attribute() const
+const QSet<QUmlProperty *> QUmlClassifier::attribute() const
{
// This is a read-only derived union association end
@@ -113,8 +176,7 @@ void QUmlClassifier::removeAttribute(QUmlProperty *attribute)
/*!
References the collaboration uses owned by the classifier.
*/
-const QSet<QUmlCollaborationUse *>
-QUmlClassifier::collaborationUse() const
+const QSet<QUmlCollaborationUse *> QUmlClassifier::collaborationUse() const
{
// This is a read-write association end
@@ -153,8 +215,7 @@ void QUmlClassifier::removeCollaborationUse(QUmlCollaborationUse *collaborationU
/*!
Specifies each feature defined in the classifier.Note that there may be members of the Classifier that are of the type Feature but are not included in this association, e.g. inherited features.
*/
-const QSet<QUmlFeature *>
-QUmlClassifier::feature() const
+const QSet<QUmlFeature *> QUmlClassifier::feature() const
{
// This is a read-only derived union association end
@@ -200,8 +261,7 @@ void QUmlClassifier::removeFeature(QUmlFeature *feature)
/*!
Specifies the general Classifiers for this Classifier.References the general classifier in the Generalization relationship.
*/
-const QSet<QUmlClassifier *>
-QUmlClassifier::general() const
+const QSet<QUmlClassifier *> QUmlClassifier::general() const
{
// This is a read-write derived association end
@@ -237,8 +297,7 @@ void QUmlClassifier::removeGeneral(QUmlClassifier *general)
/*!
Specifies the Generalization relationships for this Classifier. These Generalizations navigaten to more general classifiers in the generalization hierarchy.
*/
-const QSet<QUmlGeneralization *>
-QUmlClassifier::generalization() const
+const QSet<QUmlGeneralization *> QUmlClassifier::generalization() const
{
// This is a read-write association end
@@ -287,8 +346,7 @@ void QUmlClassifier::removeGeneralization(QUmlGeneralization *generalization)
/*!
Specifies all elements inherited by this classifier from the general classifiers.
*/
-const QSet<QUmlNamedElement *>
-QUmlClassifier::inheritedMember() const
+const QSet<QUmlNamedElement *> QUmlClassifier::inheritedMember() const
{
// This is a read-only derived association end
@@ -330,8 +388,7 @@ void QUmlClassifier::removeInheritedMember(QUmlNamedElement *inheritedMember)
/*!
If true, the Classifier does not provide a complete declaration and can typically not be instantiated. An abstract classifier is intended to be used by other classifiers e.g. as the target of general metarelationships or generalization relationships.
*/
-bool
-QUmlClassifier::isAbstract() const
+bool QUmlClassifier::isAbstract() const
{
// This is a read-write property
@@ -350,8 +407,7 @@ void QUmlClassifier::setAbstract(bool isAbstract)
/*!
If true, the Classifier cannot be specialized by generalization. Note that this property is preserved through package merge operations; that is, the capability to specialize a Classifier (i.e., isFinalSpecialization =false) must be preserved in the resulting Classifier of a package merge operation where a Classifier with isFinalSpecialization =false is merged with a matching Classifier with isFinalSpecialization =true: the resulting Classifier will have isFinalSpecialization =false.
*/
-bool
-QUmlClassifier::isFinalSpecialization() const
+bool QUmlClassifier::isFinalSpecialization() const
{
// This is a read-write property
@@ -370,8 +426,7 @@ void QUmlClassifier::setFinalSpecialization(bool isFinalSpecialization)
/*!
The optional template signature specifying the formal template parameters.
*/
-QUmlRedefinableTemplateSignature *
-QUmlClassifier::ownedTemplateSignature() const
+QUmlRedefinableTemplateSignature *QUmlClassifier::ownedTemplateSignature() const
{
// This is a read-write association end
@@ -393,8 +448,7 @@ void QUmlClassifier::setOwnedTemplateSignature(QUmlRedefinableTemplateSignature
/*!
References the use cases owned by this classifier.
*/
-const QSet<QUmlUseCase *>
-QUmlClassifier::ownedUseCase() const
+const QSet<QUmlUseCase *> QUmlClassifier::ownedUseCase() const
{
// This is a read-write association end
@@ -433,8 +487,7 @@ void QUmlClassifier::removeOwnedUseCase(QUmlUseCase *ownedUseCase)
/*!
Designates the GeneralizationSet of which the associated Classifier is a power type.
*/
-const QSet<QUmlGeneralizationSet *>
-QUmlClassifier::powertypeExtent() const
+const QSet<QUmlGeneralizationSet *> QUmlClassifier::powertypeExtent() const
{
// This is a read-write association end
@@ -474,8 +527,7 @@ void QUmlClassifier::removePowertypeExtent(QUmlGeneralizationSet *powertypeExten
/*!
References the Classifiers that are redefined by this Classifier.
*/
-const QSet<QUmlClassifier *>
-QUmlClassifier::redefinedClassifier() const
+const QSet<QUmlClassifier *> QUmlClassifier::redefinedClassifier() const
{
// This is a read-write association end
@@ -511,8 +563,7 @@ void QUmlClassifier::removeRedefinedClassifier(QUmlClassifier *redefinedClassifi
/*!
References a collaboration use which indicates the collaboration that represents this classifier.
*/
-QUmlCollaborationUse *
-QUmlClassifier::representation() const
+QUmlCollaborationUse *QUmlClassifier::representation() const
{
// This is a read-write association end
@@ -541,8 +592,7 @@ void QUmlClassifier::setRepresentation(QUmlCollaborationUse *representation)
/*!
References the substitutions that are owned by this Classifier.
*/
-const QSet<QUmlSubstitution *>
-QUmlClassifier::substitution() const
+const QSet<QUmlSubstitution *> QUmlClassifier::substitution() const
{
// This is a read-write association end
@@ -593,8 +643,7 @@ void QUmlClassifier::removeSubstitution(QUmlSubstitution *substitution)
/*!
The template parameter that exposes this element as a formal parameter.
*/
-QUmlClassifierTemplateParameter *
-QUmlClassifier::templateParameter() const
+QUmlClassifierTemplateParameter *QUmlClassifier::templateParameter() const
{
// This is a read-write association end
@@ -615,8 +664,7 @@ void QUmlClassifier::setTemplateParameter(QUmlClassifierTemplateParameter *templ
/*!
The set of use cases for which this Classifier is the subject.
*/
-const QSet<QUmlUseCase *>
-QUmlClassifier::useCase() const
+const QSet<QUmlUseCase *> QUmlClassifier::useCase() const
{
// This is a read-write association end
diff --git a/src/uml/qumlclassifier.h b/src/uml/qumlclassifier.h
index 8377d92c..5b974b81 100644
--- a/src/uml/qumlclassifier.h
+++ b/src/uml/qumlclassifier.h
@@ -71,6 +71,8 @@ class Q_UML_EXPORT QUmlClassifier : public QUmlNamespace, public QUmlType, publi
public:
virtual ~QUmlClassifier();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlProperty *> attribute() const;
Q_DECL_HIDDEN void addAttribute(QUmlProperty *attribute);
diff --git a/src/uml/qumlclassifiertemplateparameter.cpp b/src/uml/qumlclassifiertemplateparameter.cpp
index 9b8c1004..2c87f114 100644
--- a/src/uml/qumlclassifiertemplateparameter.cpp
+++ b/src/uml/qumlclassifiertemplateparameter.cpp
@@ -43,7 +43,10 @@
#include "private/qumlclassifiertemplateparameterobject_p.h"
#include <QtUml/QUmlClassifier>
-
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlTemplateSignature>
/*!
\class QUmlClassifierTemplateParameter
@@ -68,13 +71,33 @@ QUmlClassifierTemplateParameter::~QUmlClassifierTemplateParameter()
}
}
+QModelingObject *QUmlClassifierTemplateParameter::clone() const
+{
+ QUmlClassifierTemplateParameter *c = new QUmlClassifierTemplateParameter;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (default_())
+ c->setDefault(dynamic_cast<QUmlParameterableElement *>(default_()->clone()));
+ if (ownedDefault())
+ c->setOwnedDefault(dynamic_cast<QUmlParameterableElement *>(ownedDefault()->clone()));
+ if (ownedParameteredElement())
+ c->setOwnedParameteredElement(dynamic_cast<QUmlParameterableElement *>(ownedParameteredElement()->clone()));
+ if (signature())
+ c->setSignature(dynamic_cast<QUmlTemplateSignature *>(signature()->clone()));
+ c->setAllowSubstitutable(allowSubstitutable());
+ foreach (QUmlClassifier *element, constrainingClassifier())
+ c->addConstrainingClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (parameteredElement())
+ c->setParameteredElement(dynamic_cast<QUmlClassifier *>(parameteredElement()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Constrains the required relationship between an actual parameter and the parameteredElement for this formal parameter.
*/
-bool
-QUmlClassifierTemplateParameter::allowSubstitutable() const
+bool QUmlClassifierTemplateParameter::allowSubstitutable() const
{
// This is a read-write property
@@ -93,8 +116,7 @@ void QUmlClassifierTemplateParameter::setAllowSubstitutable(bool allowSubstituta
/*!
The classifiers that constrain the argument that can be used for the parameter. If the allowSubstitutable attribute is true, then any classifier that is compatible with this constraining classifier can be substituted; otherwise, it must be either this classifier or one of its subclasses. If this property is empty, there are no constraints on the classifier that can be used as an argument.
*/
-const QSet<QUmlClassifier *>
-QUmlClassifierTemplateParameter::constrainingClassifier() const
+const QSet<QUmlClassifier *> QUmlClassifierTemplateParameter::constrainingClassifier() const
{
// This is a read-write association end
@@ -124,8 +146,7 @@ void QUmlClassifierTemplateParameter::removeConstrainingClassifier(QUmlClassifie
/*!
The parameterable classifier for this template parameter.
*/
-QUmlClassifier *
-QUmlClassifierTemplateParameter::parameteredElement() const
+QUmlClassifier *QUmlClassifierTemplateParameter::parameteredElement() const
{
// This is a read-write association end
diff --git a/src/uml/qumlclassifiertemplateparameter.h b/src/uml/qumlclassifiertemplateparameter.h
index 428b7377..f2cc4465 100644
--- a/src/uml/qumlclassifiertemplateparameter.h
+++ b/src/uml/qumlclassifiertemplateparameter.h
@@ -60,6 +60,8 @@ public:
explicit QUmlClassifierTemplateParameter(bool createQObject = true);
virtual ~QUmlClassifierTemplateParameter();
+ QModelingObject *clone() const;
+
// Owned attributes
bool allowSubstitutable() const;
void setAllowSubstitutable(bool allowSubstitutable);
diff --git a/src/uml/qumlclause.cpp b/src/uml/qumlclause.cpp
index bea90b3f..e26eb5c1 100644
--- a/src/uml/qumlclause.cpp
+++ b/src/uml/qumlclause.cpp
@@ -42,9 +42,10 @@
#include "private/qumlclauseobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlExecutableNode>
#include <QtUml/QUmlOutputPin>
-
/*!
\class QUmlClause
@@ -67,13 +68,32 @@ QUmlClause::~QUmlClause()
}
}
+QModelingObject *QUmlClause::clone() const
+{
+ QUmlClause *c = new QUmlClause;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlExecutableNode *element, body())
+ c->addBody(dynamic_cast<QUmlExecutableNode *>(element->clone()));
+ foreach (QUmlOutputPin *element, bodyOutput())
+ c->addBodyOutput(dynamic_cast<QUmlOutputPin *>(element->clone()));
+ if (decider())
+ c->setDecider(dynamic_cast<QUmlOutputPin *>(decider()->clone()));
+ foreach (QUmlClause *element, predecessorClause())
+ c->addPredecessorClause(dynamic_cast<QUmlClause *>(element->clone()));
+ foreach (QUmlClause *element, successorClause())
+ c->addSuccessorClause(dynamic_cast<QUmlClause *>(element->clone()));
+ foreach (QUmlExecutableNode *element, test())
+ c->addTest(dynamic_cast<QUmlExecutableNode *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
A nested activity fragment that is executed if the test evaluates to true and the clause is chosen over any concurrent clauses that also evaluate to true.
*/
-const QSet<QUmlExecutableNode *>
-QUmlClause::body() const
+const QSet<QUmlExecutableNode *> QUmlClause::body() const
{
// This is a read-write association end
@@ -103,8 +123,7 @@ void QUmlClause::removeBody(QUmlExecutableNode *body)
/*!
A list of output pins within the body fragment whose values are moved to the result pins of the containing conditional node after execution of the clause body.
*/
-const QList<QUmlOutputPin *>
-QUmlClause::bodyOutput() const
+const QList<QUmlOutputPin *> QUmlClause::bodyOutput() const
{
// This is a read-write association end
@@ -134,8 +153,7 @@ void QUmlClause::removeBodyOutput(QUmlOutputPin *bodyOutput)
/*!
An output pin within the test fragment the value of which is examined after execution of the test to determine whether the body should be executed.
*/
-QUmlOutputPin *
-QUmlClause::decider() const
+QUmlOutputPin *QUmlClause::decider() const
{
// This is a read-write association end
@@ -156,8 +174,7 @@ void QUmlClause::setDecider(QUmlOutputPin *decider)
/*!
A set of clauses whose tests must all evaluate false before the current clause can be tested.
*/
-const QSet<QUmlClause *>
-QUmlClause::predecessorClause() const
+const QSet<QUmlClause *> QUmlClause::predecessorClause() const
{
// This is a read-write association end
@@ -187,8 +204,7 @@ void QUmlClause::removePredecessorClause(QUmlClause *predecessorClause)
/*!
A set of clauses which may not be tested unless the current clause tests false.
*/
-const QSet<QUmlClause *>
-QUmlClause::successorClause() const
+const QSet<QUmlClause *> QUmlClause::successorClause() const
{
// This is a read-write association end
@@ -218,8 +234,7 @@ void QUmlClause::removeSuccessorClause(QUmlClause *successorClause)
/*!
A nested activity fragment with a designated output pin that specifies the result of the test.
*/
-const QSet<QUmlExecutableNode *>
-QUmlClause::test() const
+const QSet<QUmlExecutableNode *> QUmlClause::test() const
{
// This is a read-write association end
diff --git a/src/uml/qumlclause.h b/src/uml/qumlclause.h
index 0b88247c..4fc31841 100644
--- a/src/uml/qumlclause.h
+++ b/src/uml/qumlclause.h
@@ -61,6 +61,8 @@ public:
explicit QUmlClause(bool createQObject = true);
virtual ~QUmlClause();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlExecutableNode *> body() const;
void addBody(QUmlExecutableNode *body);
diff --git a/src/uml/qumlclearassociationaction.cpp b/src/uml/qumlclearassociationaction.cpp
index c87b3123..e5d077db 100644
--- a/src/uml/qumlclearassociationaction.cpp
+++ b/src/uml/qumlclearassociationaction.cpp
@@ -42,9 +42,27 @@
#include "private/qumlclearassociationactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
#include <QtUml/QUmlAssociation>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
-
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlClearAssociationAction
@@ -68,13 +86,52 @@ QUmlClearAssociationAction::~QUmlClearAssociationAction()
}
}
+QModelingObject *QUmlClearAssociationAction::clone() const
+{
+ QUmlClearAssociationAction *c = new QUmlClearAssociationAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (association())
+ c->setAssociation(dynamic_cast<QUmlAssociation *>(association()->clone()));
+ if (object())
+ c->setObject(dynamic_cast<QUmlInputPin *>(object()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Association to be cleared.
*/
-QUmlAssociation *
-QUmlClearAssociationAction::association() const
+QUmlAssociation *QUmlClearAssociationAction::association() const
{
// This is a read-write association end
@@ -95,8 +152,7 @@ void QUmlClearAssociationAction::setAssociation(QUmlAssociation *association)
/*!
Gives the input pin from which is obtained the object whose participation in the association is to be cleared.
*/
-QUmlInputPin *
-QUmlClearAssociationAction::object() const
+QUmlInputPin *QUmlClearAssociationAction::object() const
{
// This is a read-write association end
diff --git a/src/uml/qumlclearassociationaction.h b/src/uml/qumlclearassociationaction.h
index d25ed4d5..0f8613a6 100644
--- a/src/uml/qumlclearassociationaction.h
+++ b/src/uml/qumlclearassociationaction.h
@@ -61,6 +61,8 @@ public:
explicit QUmlClearAssociationAction(bool createQObject = true);
virtual ~QUmlClearAssociationAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlAssociation *association() const;
void setAssociation(QUmlAssociation *association);
diff --git a/src/uml/qumlclearstructuralfeatureaction.cpp b/src/uml/qumlclearstructuralfeatureaction.cpp
index 8201fe6e..dd7e0854 100644
--- a/src/uml/qumlclearstructuralfeatureaction.cpp
+++ b/src/uml/qumlclearstructuralfeatureaction.cpp
@@ -42,8 +42,27 @@
#include "private/qumlclearstructuralfeatureactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuralFeature>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlClearStructuralFeatureAction
@@ -66,13 +85,54 @@ QUmlClearStructuralFeatureAction::~QUmlClearStructuralFeatureAction()
}
}
+QModelingObject *QUmlClearStructuralFeatureAction::clone() const
+{
+ QUmlClearStructuralFeatureAction *c = new QUmlClearStructuralFeatureAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (object())
+ c->setObject(dynamic_cast<QUmlInputPin *>(object()->clone()));
+ if (structuralFeature())
+ c->setStructuralFeature(dynamic_cast<QUmlStructuralFeature *>(structuralFeature()->clone()));
+ if (result())
+ c->setResult(dynamic_cast<QUmlOutputPin *>(result()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Gives the output pin on which the result is put.
*/
-QUmlOutputPin *
-QUmlClearStructuralFeatureAction::result() const
+QUmlOutputPin *QUmlClearStructuralFeatureAction::result() const
{
// This is a read-write association end
diff --git a/src/uml/qumlclearstructuralfeatureaction.h b/src/uml/qumlclearstructuralfeatureaction.h
index a30a66b1..42752067 100644
--- a/src/uml/qumlclearstructuralfeatureaction.h
+++ b/src/uml/qumlclearstructuralfeatureaction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlClearStructuralFeatureAction(bool createQObject = true);
virtual ~QUmlClearStructuralFeatureAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlOutputPin *result() const;
void setResult(QUmlOutputPin *result);
diff --git a/src/uml/qumlclearvariableaction.cpp b/src/uml/qumlclearvariableaction.cpp
index c9ccd1a8..f4353d78 100644
--- a/src/uml/qumlclearvariableaction.cpp
+++ b/src/uml/qumlclearvariableaction.cpp
@@ -42,6 +42,27 @@
#include "private/qumlclearvariableactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlVariable>
/*!
\class QUmlClearVariableAction
@@ -63,3 +84,41 @@ QUmlClearVariableAction::~QUmlClearVariableAction()
}
}
+QModelingObject *QUmlClearVariableAction::clone() const
+{
+ QUmlClearVariableAction *c = new QUmlClearVariableAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (variable())
+ c->setVariable(dynamic_cast<QUmlVariable *>(variable()->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlclearvariableaction.h b/src/uml/qumlclearvariableaction.h
index 3d907221..cbddfc53 100644
--- a/src/uml/qumlclearvariableaction.h
+++ b/src/uml/qumlclearvariableaction.h
@@ -58,6 +58,8 @@ public:
explicit QUmlClearVariableAction(bool createQObject = true);
virtual ~QUmlClearVariableAction();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlcollaboration.cpp b/src/uml/qumlcollaboration.cpp
index af95049e..13ce861a 100644
--- a/src/uml/qumlcollaboration.cpp
+++ b/src/uml/qumlcollaboration.cpp
@@ -42,8 +42,37 @@
#include "private/qumlcollaborationobject_p.h"
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConnectableElement>
-
+#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlInterfaceRealization>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlCollaboration
@@ -65,13 +94,73 @@ QUmlCollaboration::~QUmlCollaboration()
}
}
+QModelingObject *QUmlCollaboration::clone() const
+{
+ QUmlCollaboration *c = new QUmlCollaboration;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlConnector *element, ownedConnector())
+ c->addOwnedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ foreach (QUmlConnectableElement *element, collaborationRole())
+ c->addCollaborationRole(dynamic_cast<QUmlConnectableElement *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References connectable elements (possibly owned by other classifiers) which represent roles that instances may play in this collaboration.
*/
-const QSet<QUmlConnectableElement *>
-QUmlCollaboration::collaborationRole() const
+const QSet<QUmlConnectableElement *> QUmlCollaboration::collaborationRole() const
{
// This is a read-write association end
diff --git a/src/uml/qumlcollaboration.h b/src/uml/qumlcollaboration.h
index 2b4df9bd..1e9e14d5 100644
--- a/src/uml/qumlcollaboration.h
+++ b/src/uml/qumlcollaboration.h
@@ -61,6 +61,8 @@ public:
explicit QUmlCollaboration(bool createQObject = true);
virtual ~QUmlCollaboration();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlConnectableElement *> collaborationRole() const;
void addCollaborationRole(QUmlConnectableElement *collaborationRole);
diff --git a/src/uml/qumlcollaborationuse.cpp b/src/uml/qumlcollaborationuse.cpp
index 5f351d0f..6512fa81 100644
--- a/src/uml/qumlcollaborationuse.cpp
+++ b/src/uml/qumlcollaborationuse.cpp
@@ -43,8 +43,13 @@
#include "private/qumlcollaborationuseobject_p.h"
#include <QtUml/QUmlCollaboration>
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlDependency>
-
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlCollaborationUse
@@ -67,13 +72,30 @@ QUmlCollaborationUse::~QUmlCollaborationUse()
}
}
+QModelingObject *QUmlCollaborationUse::clone() const
+{
+ QUmlCollaborationUse *c = new QUmlCollaborationUse;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlDependency *element, roleBinding())
+ c->addRoleBinding(dynamic_cast<QUmlDependency *>(element->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlCollaboration *>(type()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
A mapping between features of the collaboration type and features of the owning classifier. This mapping indicates which connectable element of the classifier plays which role(s) in the collaboration. A connectable element may be bound to multiple roles in the same collaboration use (that is, it may play multiple roles).
*/
-const QSet<QUmlDependency *>
-QUmlCollaborationUse::roleBinding() const
+const QSet<QUmlDependency *> QUmlCollaborationUse::roleBinding() const
{
// This is a read-write association end
@@ -112,8 +134,7 @@ void QUmlCollaborationUse::removeRoleBinding(QUmlDependency *roleBinding)
/*!
The collaboration which is used in this occurrence. The collaboration defines the cooperation between its roles which are mapped to properties of the classifier owning the collaboration use.
*/
-QUmlCollaboration *
-QUmlCollaborationUse::type() const
+QUmlCollaboration *QUmlCollaborationUse::type() const
{
// This is a read-write association end
diff --git a/src/uml/qumlcollaborationuse.h b/src/uml/qumlcollaborationuse.h
index c780cc84..7fb1d7ad 100644
--- a/src/uml/qumlcollaborationuse.h
+++ b/src/uml/qumlcollaborationuse.h
@@ -61,6 +61,8 @@ public:
explicit QUmlCollaborationUse(bool createQObject = true);
virtual ~QUmlCollaborationUse();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlDependency *> roleBinding() const;
void addRoleBinding(QUmlDependency *roleBinding);
diff --git a/src/uml/qumlcombinedfragment.cpp b/src/uml/qumlcombinedfragment.cpp
index 0ef6497d..052621b6 100644
--- a/src/uml/qumlcombinedfragment.cpp
+++ b/src/uml/qumlcombinedfragment.cpp
@@ -42,9 +42,18 @@
#include "private/qumlcombinedfragmentobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlGate>
+#include <QtUml/QUmlGeneralOrdering>
+#include <QtUml/QUmlInteraction>
#include <QtUml/QUmlInteractionOperand>
-
+#include <QtUml/QUmlLifeline>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlCombinedFragment
@@ -67,13 +76,39 @@ QUmlCombinedFragment::~QUmlCombinedFragment()
}
}
+QModelingObject *QUmlCombinedFragment::clone() const
+{
+ QUmlCombinedFragment *c = new QUmlCombinedFragment;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlLifeline *element, covered())
+ c->addCovered(dynamic_cast<QUmlLifeline *>(element->clone()));
+ if (enclosingInteraction())
+ c->setEnclosingInteraction(dynamic_cast<QUmlInteraction *>(enclosingInteraction()->clone()));
+ if (enclosingOperand())
+ c->setEnclosingOperand(dynamic_cast<QUmlInteractionOperand *>(enclosingOperand()->clone()));
+ foreach (QUmlGeneralOrdering *element, generalOrdering())
+ c->addGeneralOrdering(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ foreach (QUmlGate *element, cfragmentGate())
+ c->addCfragmentGate(dynamic_cast<QUmlGate *>(element->clone()));
+ c->setInteractionOperator(interactionOperator());
+ foreach (QUmlInteractionOperand *element, operand())
+ c->addOperand(dynamic_cast<QUmlInteractionOperand *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies the gates that form the interface between this CombinedFragment and its surroundings
*/
-const QSet<QUmlGate *>
-QUmlCombinedFragment::cfragmentGate() const
+const QSet<QUmlGate *> QUmlCombinedFragment::cfragmentGate() const
{
// This is a read-write association end
@@ -112,8 +147,7 @@ void QUmlCombinedFragment::removeCfragmentGate(QUmlGate *cfragmentGate)
/*!
Specifies the operation which defines the semantics of this combination of InteractionFragments.
*/
-QtUml::InteractionOperatorKind
-QUmlCombinedFragment::interactionOperator() const
+QtUml::InteractionOperatorKind QUmlCombinedFragment::interactionOperator() const
{
// This is a read-write property
@@ -132,8 +166,7 @@ void QUmlCombinedFragment::setInteractionOperator(QtUml::InteractionOperatorKind
/*!
The set of operands of the combined fragment.
*/
-const QList<QUmlInteractionOperand *>
-QUmlCombinedFragment::operand() const
+const QList<QUmlInteractionOperand *> QUmlCombinedFragment::operand() const
{
// This is a read-write association end
diff --git a/src/uml/qumlcombinedfragment.h b/src/uml/qumlcombinedfragment.h
index c38f1af9..2491ac5a 100644
--- a/src/uml/qumlcombinedfragment.h
+++ b/src/uml/qumlcombinedfragment.h
@@ -63,6 +63,8 @@ public:
explicit QUmlCombinedFragment(bool createQObject = true);
virtual ~QUmlCombinedFragment();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlGate *> cfragmentGate() const;
void addCfragmentGate(QUmlGate *cfragmentGate);
diff --git a/src/uml/qumlcomment.cpp b/src/uml/qumlcomment.cpp
index 08c72b36..40e1367b 100644
--- a/src/uml/qumlcomment.cpp
+++ b/src/uml/qumlcomment.cpp
@@ -42,6 +42,7 @@
#include "private/qumlcommentobject_p.h"
+#include <QtUml/QUmlElement>
/*!
\class QUmlComment
@@ -63,13 +64,23 @@ QUmlComment::~QUmlComment()
}
}
+QModelingObject *QUmlComment::clone() const
+{
+ QUmlComment *c = new QUmlComment;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlElement *element, annotatedElement())
+ c->addAnnotatedElement(dynamic_cast<QUmlElement *>(element->clone()));
+ c->setBody(body());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the Element(s) being commented.
*/
-const QSet<QUmlElement *>
-QUmlComment::annotatedElement() const
+const QSet<QUmlElement *> QUmlComment::annotatedElement() const
{
// This is a read-write association end
@@ -99,8 +110,7 @@ void QUmlComment::removeAnnotatedElement(QUmlElement *annotatedElement)
/*!
Specifies a string that is the comment.
*/
-QString
-QUmlComment::body() const
+QString QUmlComment::body() const
{
// This is a read-write property
diff --git a/src/uml/qumlcomment.h b/src/uml/qumlcomment.h
index 628c0d0f..b1b39612 100644
--- a/src/uml/qumlcomment.h
+++ b/src/uml/qumlcomment.h
@@ -58,6 +58,8 @@ public:
explicit QUmlComment(bool createQObject = true);
virtual ~QUmlComment();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlElement *> annotatedElement() const;
void addAnnotatedElement(QUmlElement *annotatedElement);
diff --git a/src/uml/qumlcommunicationpath.cpp b/src/uml/qumlcommunicationpath.cpp
index 4641fa11..f89f3fdd 100644
--- a/src/uml/qumlcommunicationpath.cpp
+++ b/src/uml/qumlcommunicationpath.cpp
@@ -42,6 +42,33 @@
#include "private/qumlcommunicationpathobject_p.h"
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlCommunicationPath
@@ -64,3 +91,59 @@ QUmlCommunicationPath::~QUmlCommunicationPath()
}
}
+QModelingObject *QUmlCommunicationPath::clone() const
+{
+ QUmlCommunicationPath *c = new QUmlCommunicationPath;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ c->setDerived(isDerived());
+ foreach (QUmlProperty *element, memberEnd())
+ c->addMemberEnd(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlProperty *element, navigableOwnedEnd())
+ c->addNavigableOwnedEnd(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlProperty *element, ownedEnd())
+ c->addOwnedEnd(dynamic_cast<QUmlProperty *>(element->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlcommunicationpath.h b/src/uml/qumlcommunicationpath.h
index e0b3083a..205c6510 100644
--- a/src/uml/qumlcommunicationpath.h
+++ b/src/uml/qumlcommunicationpath.h
@@ -58,6 +58,8 @@ public:
explicit QUmlCommunicationPath(bool createQObject = true);
virtual ~QUmlCommunicationPath();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlcomponent.cpp b/src/uml/qumlcomponent.cpp
index c5ced21a..88295d22 100644
--- a/src/uml/qumlcomponent.cpp
+++ b/src/uml/qumlcomponent.cpp
@@ -42,11 +42,44 @@
#include "private/qumlcomponentobject_p.h"
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClass>
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlComponentRealization>
+#include <QtUml/QUmlConnectableElement>
+#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExtension>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
#include <QtUml/QUmlInterface>
+#include <QtUml/QUmlInterfaceRealization>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
#include <QtUml/QUmlPackageableElement>
-
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlReception>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlComponent
@@ -70,13 +103,83 @@ QUmlComponent::~QUmlComponent()
}
}
+QModelingObject *QUmlComponent::clone() const
+{
+ QUmlComponent *c = new QUmlComponent;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlConnector *element, ownedConnector())
+ c->addOwnedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setActive(isActive());
+ foreach (QUmlClassifier *element, nestedClassifier())
+ c->addNestedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ foreach (QUmlReception *element, ownedReception())
+ c->addOwnedReception(dynamic_cast<QUmlReception *>(element->clone()));
+ c->setIndirectlyInstantiated(isIndirectlyInstantiated());
+ foreach (QUmlPackageableElement *element, packagedElement())
+ c->addPackagedElement(dynamic_cast<QUmlPackageableElement *>(element->clone()));
+ foreach (QUmlComponentRealization *element, realization())
+ c->addRealization(dynamic_cast<QUmlComponentRealization *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
isIndirectlyInstantiated : Boolean {default = true} The kind of instantiation that applies to a Component. If false, the component is instantiated as an addressable object. If true, the Component is defined at design-time, but at run-time (or execution-time) an object specified by the Component does not exist, that is, the component is instantiated indirectly, through the instantiation of its realizing classifiers or parts. Several standard stereotypes use this meta attribute (e.g., «specification», «focus», «subsystem»).
*/
-bool
-QUmlComponent::isIndirectlyInstantiated() const
+bool QUmlComponent::isIndirectlyInstantiated() const
{
// This is a read-write property
@@ -95,8 +198,7 @@ void QUmlComponent::setIndirectlyInstantiated(bool isIndirectlyInstantiated)
/*!
The set of PackageableElements that a Component owns. In the namespace of a component, all model elements that are involved in or related to its definition may be owned or imported explicitly. These may include e.g. Classes, Interfaces, Components, Packages, Use cases, Dependencies (e.g. mappings), and Artifacts.
*/
-const QSet<QUmlPackageableElement *>
-QUmlComponent::packagedElement() const
+const QSet<QUmlPackageableElement *> QUmlComponent::packagedElement() const
{
// This is a read-write association end
@@ -135,8 +237,7 @@ void QUmlComponent::removePackagedElement(QUmlPackageableElement *packagedElemen
/*!
The interfaces that the component exposes to its environment. These interfaces may be Realized by the Component or any of its realizingClassifiers, or they may be the Interfaces that are provided by its public Ports.
*/
-const QSet<QUmlInterface *>
-QUmlComponent::provided() const
+const QSet<QUmlInterface *> QUmlComponent::provided() const
{
// This is a read-only derived association end
@@ -172,8 +273,7 @@ void QUmlComponent::removeProvided(QUmlInterface *provided)
/*!
The set of Realizations owned by the Component. Realizations reference the Classifiers of which the Component is an abstraction; i.e., that realize its behavior.
*/
-const QSet<QUmlComponentRealization *>
-QUmlComponent::realization() const
+const QSet<QUmlComponentRealization *> QUmlComponent::realization() const
{
// This is a read-write association end
@@ -222,8 +322,7 @@ void QUmlComponent::removeRealization(QUmlComponentRealization *realization)
/*!
The interfaces that the component requires from other components in its environment in order to be able to offer its full set of provided functionality. These interfaces may be used by the Component or any of its realizingClassifiers, or they may be the Interfaces that are required by its public Ports.
*/
-const QSet<QUmlInterface *>
-QUmlComponent::required() const
+const QSet<QUmlInterface *> QUmlComponent::required() const
{
// This is a read-only derived association end
diff --git a/src/uml/qumlcomponent.h b/src/uml/qumlcomponent.h
index 03f82831..6b859e5a 100644
--- a/src/uml/qumlcomponent.h
+++ b/src/uml/qumlcomponent.h
@@ -63,6 +63,8 @@ public:
explicit QUmlComponent(bool createQObject = true);
virtual ~QUmlComponent();
+ QModelingObject *clone() const;
+
// Owned attributes
bool isIndirectlyInstantiated() const;
void setIndirectlyInstantiated(bool isIndirectlyInstantiated);
diff --git a/src/uml/qumlcomponentrealization.cpp b/src/uml/qumlcomponentrealization.cpp
index 37b33800..07ed78d2 100644
--- a/src/uml/qumlcomponentrealization.cpp
+++ b/src/uml/qumlcomponentrealization.cpp
@@ -43,8 +43,17 @@
#include "private/qumlcomponentrealizationobject_p.h"
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlComponent>
-
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOpaqueExpression>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlComponentRealization
@@ -68,13 +77,40 @@ QUmlComponentRealization::~QUmlComponentRealization()
}
}
+QModelingObject *QUmlComponentRealization::clone() const
+{
+ QUmlComponentRealization *c = new QUmlComponentRealization;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlNamedElement *element, client())
+ c->addClient(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ foreach (QUmlNamedElement *element, supplier())
+ c->addSupplier(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ if (mapping())
+ c->setMapping(dynamic_cast<QUmlOpaqueExpression *>(mapping()->clone()));
+ if (abstraction())
+ c->setAbstraction(dynamic_cast<QUmlComponent *>(abstraction()->clone()));
+ foreach (QUmlClassifier *element, realizingClassifier())
+ c->addRealizingClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The Component that owns this ComponentRealization and which is implemented by its realizing classifiers.
*/
-QUmlComponent *
-QUmlComponentRealization::abstraction() const
+QUmlComponent *QUmlComponentRealization::abstraction() const
{
// This is a read-write association end
@@ -104,8 +140,7 @@ void QUmlComponentRealization::setAbstraction(QUmlComponent *abstraction)
/*!
The classifiers that are involved in the implementation of the Component that owns this Realization.
*/
-const QSet<QUmlClassifier *>
-QUmlComponentRealization::realizingClassifier() const
+const QSet<QUmlClassifier *> QUmlComponentRealization::realizingClassifier() const
{
// This is a read-write association end
diff --git a/src/uml/qumlcomponentrealization.h b/src/uml/qumlcomponentrealization.h
index 3bad4749..f663c446 100644
--- a/src/uml/qumlcomponentrealization.h
+++ b/src/uml/qumlcomponentrealization.h
@@ -61,6 +61,8 @@ public:
explicit QUmlComponentRealization(bool createQObject = true);
virtual ~QUmlComponentRealization();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlComponent *abstraction() const;
void setAbstraction(QUmlComponent *abstraction);
diff --git a/src/uml/qumlconditionalnode.cpp b/src/uml/qumlconditionalnode.cpp
index dd82c5df..670a8513 100644
--- a/src/uml/qumlconditionalnode.cpp
+++ b/src/uml/qumlconditionalnode.cpp
@@ -42,9 +42,31 @@
#include "private/qumlconditionalnodeobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
#include <QtUml/QUmlClause>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlVariable>
/*!
\class QUmlConditionalNode
@@ -69,13 +91,69 @@ QUmlConditionalNode::~QUmlConditionalNode()
}
}
+QModelingObject *QUmlConditionalNode::clone() const
+{
+ QUmlConditionalNode *c = new QUmlConditionalNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlActivityEdge *element, edge())
+ c->addEdge(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ c->setMustIsolate(mustIsolate());
+ foreach (QUmlActivityNode *element, node())
+ c->addNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlInputPin *element, structuredNodeInput())
+ c->addStructuredNodeInput(dynamic_cast<QUmlInputPin *>(element->clone()));
+ foreach (QUmlVariable *element, variable())
+ c->addVariable(dynamic_cast<QUmlVariable *>(element->clone()));
+ foreach (QUmlClause *element, clause())
+ c->addClause(dynamic_cast<QUmlClause *>(element->clone()));
+ c->setAssured(isAssured());
+ c->setDeterminate(isDeterminate());
+ foreach (QUmlOutputPin *element, result())
+ c->addResult(dynamic_cast<QUmlOutputPin *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Set of clauses composing the conditional.
*/
-const QSet<QUmlClause *>
-QUmlConditionalNode::clause() const
+const QSet<QUmlClause *> QUmlConditionalNode::clause() const
{
// This is a read-write association end
@@ -114,8 +192,7 @@ void QUmlConditionalNode::removeClause(QUmlClause *clause)
/*!
If true, the modeler asserts that at least one test will succeed.
*/
-bool
-QUmlConditionalNode::isAssured() const
+bool QUmlConditionalNode::isAssured() const
{
// This is a read-write property
@@ -134,8 +211,7 @@ void QUmlConditionalNode::setAssured(bool isAssured)
/*!
If true, the modeler asserts that at most one test will succeed.
*/
-bool
-QUmlConditionalNode::isDeterminate() const
+bool QUmlConditionalNode::isDeterminate() const
{
// This is a read-write property
@@ -154,8 +230,7 @@ void QUmlConditionalNode::setDeterminate(bool isDeterminate)
/*!
A list of output pins that constitute the data flow outputs of the conditional.
*/
-const QList<QUmlOutputPin *>
-QUmlConditionalNode::result() const
+const QList<QUmlOutputPin *> QUmlConditionalNode::result() const
{
// This is a read-write association end
diff --git a/src/uml/qumlconditionalnode.h b/src/uml/qumlconditionalnode.h
index 1c33f235..c0aa07b5 100644
--- a/src/uml/qumlconditionalnode.h
+++ b/src/uml/qumlconditionalnode.h
@@ -61,6 +61,8 @@ public:
explicit QUmlConditionalNode(bool createQObject = true);
virtual ~QUmlConditionalNode();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlClause *> clause() const;
void addClause(QUmlClause *clause);
diff --git a/src/uml/qumlconnectableelement.cpp b/src/uml/qumlconnectableelement.cpp
index f97e8ef9..e13c0c94 100644
--- a/src/uml/qumlconnectableelement.cpp
+++ b/src/uml/qumlconnectableelement.cpp
@@ -40,9 +40,18 @@
****************************************************************************/
#include "qumlconnectableelement.h"
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConnectableElementTemplateParameter>
#include <QtUml/QUmlConnectorEnd>
-
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
/*!
\class QUmlConnectableElement
@@ -59,13 +68,32 @@ QUmlConnectableElement::~QUmlConnectableElement()
{
}
+QModelingObject *QUmlConnectableElement::clone() const
+{
+ QUmlConnectableElement *c = new QUmlConnectableElement;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlConnectableElementTemplateParameter *>(templateParameter()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Denotes a set of connector ends that attaches to this connectable element.
*/
-const QList<QUmlConnectorEnd *>
-QUmlConnectableElement::end() const
+const QList<QUmlConnectorEnd *> QUmlConnectableElement::end() const
{
// This is a read-only derived association end
@@ -111,8 +139,7 @@ void QUmlConnectableElement::removeEnd(QUmlConnectorEnd *end)
/*!
The ConnectableElementTemplateParameter for this ConnectableElement parameter.
*/
-QUmlConnectableElementTemplateParameter *
-QUmlConnectableElement::templateParameter() const
+QUmlConnectableElementTemplateParameter *QUmlConnectableElement::templateParameter() const
{
// This is a read-write association end
diff --git a/src/uml/qumlconnectableelement.h b/src/uml/qumlconnectableelement.h
index c102b8be..65c58d70 100644
--- a/src/uml/qumlconnectableelement.h
+++ b/src/uml/qumlconnectableelement.h
@@ -61,6 +61,8 @@ class Q_UML_EXPORT QUmlConnectableElement : public virtual QUmlTypedElement, pub
public:
virtual ~QUmlConnectableElement();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
const QList<QUmlConnectorEnd *> end() const;
Q_DECL_HIDDEN void addEnd(QUmlConnectorEnd *end);
diff --git a/src/uml/qumlconnectableelementtemplateparameter.cpp b/src/uml/qumlconnectableelementtemplateparameter.cpp
index 0a1c56bb..93b4e7bb 100644
--- a/src/uml/qumlconnectableelementtemplateparameter.cpp
+++ b/src/uml/qumlconnectableelementtemplateparameter.cpp
@@ -42,8 +42,11 @@
#include "private/qumlconnectableelementtemplateparameterobject_p.h"
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConnectableElement>
-
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlTemplateSignature>
/*!
\class QUmlConnectableElementTemplateParameter
@@ -67,13 +70,30 @@ QUmlConnectableElementTemplateParameter::~QUmlConnectableElementTemplateParamete
}
}
+QModelingObject *QUmlConnectableElementTemplateParameter::clone() const
+{
+ QUmlConnectableElementTemplateParameter *c = new QUmlConnectableElementTemplateParameter;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (default_())
+ c->setDefault(dynamic_cast<QUmlParameterableElement *>(default_()->clone()));
+ if (ownedDefault())
+ c->setOwnedDefault(dynamic_cast<QUmlParameterableElement *>(ownedDefault()->clone()));
+ if (ownedParameteredElement())
+ c->setOwnedParameteredElement(dynamic_cast<QUmlParameterableElement *>(ownedParameteredElement()->clone()));
+ if (signature())
+ c->setSignature(dynamic_cast<QUmlTemplateSignature *>(signature()->clone()));
+ if (parameteredElement())
+ c->setParameteredElement(dynamic_cast<QUmlConnectableElement *>(parameteredElement()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The ConnectableElement for this template parameter.
*/
-QUmlConnectableElement *
-QUmlConnectableElementTemplateParameter::parameteredElement() const
+QUmlConnectableElement *QUmlConnectableElementTemplateParameter::parameteredElement() const
{
// This is a read-write association end
diff --git a/src/uml/qumlconnectableelementtemplateparameter.h b/src/uml/qumlconnectableelementtemplateparameter.h
index 94cccdd0..19a8cf6a 100644
--- a/src/uml/qumlconnectableelementtemplateparameter.h
+++ b/src/uml/qumlconnectableelementtemplateparameter.h
@@ -60,6 +60,8 @@ public:
explicit QUmlConnectableElementTemplateParameter(bool createQObject = true);
virtual ~QUmlConnectableElementTemplateParameter();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlConnectableElement *parameteredElement() const;
void setParameteredElement(QUmlConnectableElement *parameteredElement);
diff --git a/src/uml/qumlconnectionpointreference.cpp b/src/uml/qumlconnectionpointreference.cpp
index 67faa499..0f7103f7 100644
--- a/src/uml/qumlconnectionpointreference.cpp
+++ b/src/uml/qumlconnectionpointreference.cpp
@@ -42,9 +42,18 @@
#include "private/qumlconnectionpointreferenceobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
#include <QtUml/QUmlPseudostate>
+#include <QtUml/QUmlRegion>
#include <QtUml/QUmlState>
-
+#include <QtUml/QUmlStateMachine>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTransition>
/*!
\class QUmlConnectionPointReference
@@ -67,13 +76,34 @@ QUmlConnectionPointReference::~QUmlConnectionPointReference()
}
}
+QModelingObject *QUmlConnectionPointReference::clone() const
+{
+ QUmlConnectionPointReference *c = new QUmlConnectionPointReference;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (container())
+ c->setContainer(dynamic_cast<QUmlRegion *>(container()->clone()));
+ foreach (QUmlPseudostate *element, entry())
+ c->addEntry(dynamic_cast<QUmlPseudostate *>(element->clone()));
+ foreach (QUmlPseudostate *element, exit())
+ c->addExit(dynamic_cast<QUmlPseudostate *>(element->clone()));
+ if (state())
+ c->setState(dynamic_cast<QUmlState *>(state()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The entryPoint kind pseudo states corresponding to this connection point.
*/
-const QSet<QUmlPseudostate *>
-QUmlConnectionPointReference::entry() const
+const QSet<QUmlPseudostate *> QUmlConnectionPointReference::entry() const
{
// This is a read-write association end
@@ -103,8 +133,7 @@ void QUmlConnectionPointReference::removeEntry(QUmlPseudostate *entry)
/*!
The exitPoints kind pseudo states corresponding to this connection point.
*/
-const QSet<QUmlPseudostate *>
-QUmlConnectionPointReference::exit() const
+const QSet<QUmlPseudostate *> QUmlConnectionPointReference::exit() const
{
// This is a read-write association end
@@ -134,8 +163,7 @@ void QUmlConnectionPointReference::removeExit(QUmlPseudostate *exit)
/*!
The State in which the connection point refreshens are defined.
*/
-QUmlState *
-QUmlConnectionPointReference::state() const
+QUmlState *QUmlConnectionPointReference::state() const
{
// This is a read-write association end
diff --git a/src/uml/qumlconnectionpointreference.h b/src/uml/qumlconnectionpointreference.h
index 2653530d..58ea0796 100644
--- a/src/uml/qumlconnectionpointreference.h
+++ b/src/uml/qumlconnectionpointreference.h
@@ -61,6 +61,8 @@ public:
explicit QUmlConnectionPointReference(bool createQObject = true);
virtual ~QUmlConnectionPointReference();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlPseudostate *> entry() const;
void addEntry(QUmlPseudostate *entry);
diff --git a/src/uml/qumlconnector.cpp b/src/uml/qumlconnector.cpp
index 5af1de42..c123a632 100644
--- a/src/uml/qumlconnector.cpp
+++ b/src/uml/qumlconnector.cpp
@@ -44,8 +44,16 @@
#include <QtUml/QUmlAssociation>
#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConnectorEnd>
-
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlConnector
@@ -68,13 +76,36 @@ QUmlConnector::~QUmlConnector()
}
}
+QModelingObject *QUmlConnector::clone() const
+{
+ QUmlConnector *c = new QUmlConnector;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ c->setStatic(isStatic());
+ foreach (QUmlBehavior *element, contract())
+ c->addContract(dynamic_cast<QUmlBehavior *>(element->clone()));
+ foreach (QUmlConnectorEnd *element, end())
+ c->addEnd(dynamic_cast<QUmlConnectorEnd *>(element->clone()));
+ foreach (QUmlConnector *element, redefinedConnector())
+ c->addRedefinedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlAssociation *>(type()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The set of Behaviors that specify the valid interaction patterns across the connector.
*/
-const QSet<QUmlBehavior *>
-QUmlConnector::contract() const
+const QSet<QUmlBehavior *> QUmlConnector::contract() const
{
// This is a read-write association end
@@ -104,8 +135,7 @@ void QUmlConnector::removeContract(QUmlBehavior *contract)
/*!
A connector consists of at least two connector ends, each representing the participation of instances of the classifiers typing the connectable elements attached to this end. The set of connector ends is ordered.
*/
-const QList<QUmlConnectorEnd *>
-QUmlConnector::end() const
+const QList<QUmlConnectorEnd *> QUmlConnector::end() const
{
// This is a read-write association end
@@ -144,8 +174,7 @@ void QUmlConnector::removeEnd(QUmlConnectorEnd *end)
/*!
Indicates the kind of connector. This is derived: a connector with one or more ends connected to a Port which is not on a Part and which is not a behavior port is a delegation; otherwise it is an assembly.
*/
-QtUml::ConnectorKind
-QUmlConnector::kind() const
+QtUml::ConnectorKind QUmlConnector::kind() const
{
// This is a read-only derived property
@@ -169,8 +198,7 @@ void QUmlConnector::setKind(QtUml::ConnectorKind kind)
/*!
A connector may be redefined when its containing classifier is specialized. The redefining connector may have a type that specializes the type of the redefined connector. The types of the connector ends of the redefining connector may specialize the types of the connector ends of the redefined connector. The properties of the connector ends of the redefining connector may be replaced.
*/
-const QSet<QUmlConnector *>
-QUmlConnector::redefinedConnector() const
+const QSet<QUmlConnector *> QUmlConnector::redefinedConnector() const
{
// This is a read-write association end
@@ -206,8 +234,7 @@ void QUmlConnector::removeRedefinedConnector(QUmlConnector *redefinedConnector)
/*!
An optional association that specifies the link corresponding to this connector.
*/
-QUmlAssociation *
-QUmlConnector::type() const
+QUmlAssociation *QUmlConnector::type() const
{
// This is a read-write association end
diff --git a/src/uml/qumlconnector.h b/src/uml/qumlconnector.h
index 593a7139..8a5e08d0 100644
--- a/src/uml/qumlconnector.h
+++ b/src/uml/qumlconnector.h
@@ -64,6 +64,8 @@ public:
explicit QUmlConnector(bool createQObject = true);
virtual ~QUmlConnector();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlBehavior *> contract() const;
void addContract(QUmlBehavior *contract);
diff --git a/src/uml/qumlconnectorend.cpp b/src/uml/qumlconnectorend.cpp
index 0f0239f3..23110df2 100644
--- a/src/uml/qumlconnectorend.cpp
+++ b/src/uml/qumlconnectorend.cpp
@@ -42,9 +42,12 @@
#include "private/qumlconnectorendobject_p.h"
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConnectableElement>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlMultiplicityElement>
#include <QtUml/QUmlProperty>
-
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlConnectorEnd
@@ -68,13 +71,30 @@ QUmlConnectorEnd::~QUmlConnectorEnd()
}
}
+QModelingObject *QUmlConnectorEnd::clone() const
+{
+ QUmlConnectorEnd *c = new QUmlConnectorEnd;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ c->setOrdered(isOrdered());
+ c->setUnique(isUnique());
+ if (lowerValue())
+ c->setLowerValue(dynamic_cast<QUmlValueSpecification *>(lowerValue()->clone()));
+ if (upperValue())
+ c->setUpperValue(dynamic_cast<QUmlValueSpecification *>(upperValue()->clone()));
+ if (partWithPort())
+ c->setPartWithPort(dynamic_cast<QUmlProperty *>(partWithPort()->clone()));
+ if (role())
+ c->setRole(dynamic_cast<QUmlConnectableElement *>(role()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
A derived association referencing the corresponding association end on the association which types the connector owing this connector end. This association is derived by selecting the association end at the same place in the ordering of association ends as this connector end.
*/
-QUmlProperty *
-QUmlConnectorEnd::definingEnd() const
+QUmlProperty *QUmlConnectorEnd::definingEnd() const
{
// This is a read-only derived association end
@@ -98,8 +118,7 @@ void QUmlConnectorEnd::setDefiningEnd(QUmlProperty *definingEnd)
/*!
Indicates the role of the internal structure of a classifier with the port to which the connector end is attached.
*/
-QUmlProperty *
-QUmlConnectorEnd::partWithPort() const
+QUmlProperty *QUmlConnectorEnd::partWithPort() const
{
// This is a read-write association end
@@ -120,8 +139,7 @@ void QUmlConnectorEnd::setPartWithPort(QUmlProperty *partWithPort)
/*!
The connectable element attached at this connector end. When an instance of the containing classifier is created, a link may (depending on the multiplicities) be created to an instance of the classifier that types this connectable element.
*/
-QUmlConnectableElement *
-QUmlConnectorEnd::role() const
+QUmlConnectableElement *QUmlConnectorEnd::role() const
{
// This is a read-write association end
diff --git a/src/uml/qumlconnectorend.h b/src/uml/qumlconnectorend.h
index 0defec7b..90c494d4 100644
--- a/src/uml/qumlconnectorend.h
+++ b/src/uml/qumlconnectorend.h
@@ -61,6 +61,8 @@ public:
explicit QUmlConnectorEnd(bool createQObject = true);
virtual ~QUmlConnectorEnd();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlProperty *definingEnd() const;
Q_DECL_HIDDEN void setDefiningEnd(QUmlProperty *definingEnd);
diff --git a/src/uml/qumlconsiderignorefragment.cpp b/src/uml/qumlconsiderignorefragment.cpp
index a23c5eeb..04125073 100644
--- a/src/uml/qumlconsiderignorefragment.cpp
+++ b/src/uml/qumlconsiderignorefragment.cpp
@@ -42,8 +42,18 @@
#include "private/qumlconsiderignorefragmentobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlGate>
+#include <QtUml/QUmlGeneralOrdering>
+#include <QtUml/QUmlInteraction>
+#include <QtUml/QUmlInteractionOperand>
+#include <QtUml/QUmlLifeline>
#include <QtUml/QUmlNamedElement>
-
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlConsiderIgnoreFragment
@@ -66,13 +76,41 @@ QUmlConsiderIgnoreFragment::~QUmlConsiderIgnoreFragment()
}
}
+QModelingObject *QUmlConsiderIgnoreFragment::clone() const
+{
+ QUmlConsiderIgnoreFragment *c = new QUmlConsiderIgnoreFragment;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlLifeline *element, covered())
+ c->addCovered(dynamic_cast<QUmlLifeline *>(element->clone()));
+ if (enclosingInteraction())
+ c->setEnclosingInteraction(dynamic_cast<QUmlInteraction *>(enclosingInteraction()->clone()));
+ if (enclosingOperand())
+ c->setEnclosingOperand(dynamic_cast<QUmlInteractionOperand *>(enclosingOperand()->clone()));
+ foreach (QUmlGeneralOrdering *element, generalOrdering())
+ c->addGeneralOrdering(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ foreach (QUmlGate *element, cfragmentGate())
+ c->addCfragmentGate(dynamic_cast<QUmlGate *>(element->clone()));
+ c->setInteractionOperator(interactionOperator());
+ foreach (QUmlInteractionOperand *element, operand())
+ c->addOperand(dynamic_cast<QUmlInteractionOperand *>(element->clone()));
+ foreach (QUmlNamedElement *element, message())
+ c->addMessage(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The set of messages that apply to this fragment
*/
-const QSet<QUmlNamedElement *>
-QUmlConsiderIgnoreFragment::message() const
+const QSet<QUmlNamedElement *> QUmlConsiderIgnoreFragment::message() const
{
// This is a read-write association end
diff --git a/src/uml/qumlconsiderignorefragment.h b/src/uml/qumlconsiderignorefragment.h
index f280ac11..53cd54d1 100644
--- a/src/uml/qumlconsiderignorefragment.h
+++ b/src/uml/qumlconsiderignorefragment.h
@@ -60,6 +60,8 @@ public:
explicit QUmlConsiderIgnoreFragment(bool createQObject = true);
virtual ~QUmlConsiderIgnoreFragment();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlNamedElement *> message() const;
void addMessage(QUmlNamedElement *message);
diff --git a/src/uml/qumlconstraint.cpp b/src/uml/qumlconstraint.cpp
index 05c2de72..dc424c22 100644
--- a/src/uml/qumlconstraint.cpp
+++ b/src/uml/qumlconstraint.cpp
@@ -42,10 +42,16 @@
#include "private/qumlconstraintobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
#include <QtUml/QUmlValueSpecification>
-
/*!
\class QUmlConstraint
@@ -69,13 +75,36 @@ QUmlConstraint::~QUmlConstraint()
}
}
+QModelingObject *QUmlConstraint::clone() const
+{
+ QUmlConstraint *c = new QUmlConstraint;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlElement *element, constrainedElement())
+ c->addConstrainedElement(dynamic_cast<QUmlElement *>(element->clone()));
+ if (context())
+ c->setContext(dynamic_cast<QUmlNamespace *>(context()->clone()));
+ if (specification())
+ c->setSpecification(dynamic_cast<QUmlValueSpecification *>(specification()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The ordered set of Elements referenced by this Constraint.
*/
-const QList<QUmlElement *>
-QUmlConstraint::constrainedElement() const
+const QList<QUmlElement *> QUmlConstraint::constrainedElement() const
{
// This is a read-write association end
@@ -105,8 +134,7 @@ void QUmlConstraint::removeConstrainedElement(QUmlElement *constrainedElement)
/*!
Specifies the namespace that owns the NamedElement.
*/
-QUmlNamespace *
-QUmlConstraint::context() const
+QUmlNamespace *QUmlConstraint::context() const
{
// This is a read-write association end
@@ -132,8 +160,7 @@ void QUmlConstraint::setContext(QUmlNamespace *context)
/*!
A condition that must be true when evaluated in order for the constraint to be satisfied.
*/
-QUmlValueSpecification *
-QUmlConstraint::specification() const
+QUmlValueSpecification *QUmlConstraint::specification() const
{
// This is a read-write association end
diff --git a/src/uml/qumlconstraint.h b/src/uml/qumlconstraint.h
index 01b7b099..e02ccc8d 100644
--- a/src/uml/qumlconstraint.h
+++ b/src/uml/qumlconstraint.h
@@ -62,6 +62,8 @@ public:
explicit QUmlConstraint(bool createQObject = true);
virtual ~QUmlConstraint();
+ QModelingObject *clone() const;
+
// Owned attributes
const QList<QUmlElement *> constrainedElement() const;
void addConstrainedElement(QUmlElement *constrainedElement);
diff --git a/src/uml/qumlcontinuation.cpp b/src/uml/qumlcontinuation.cpp
index c9950614..7601d404 100644
--- a/src/uml/qumlcontinuation.cpp
+++ b/src/uml/qumlcontinuation.cpp
@@ -42,6 +42,17 @@
#include "private/qumlcontinuationobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlGeneralOrdering>
+#include <QtUml/QUmlInteraction>
+#include <QtUml/QUmlInteractionOperand>
+#include <QtUml/QUmlLifeline>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlContinuation
@@ -64,13 +75,35 @@ QUmlContinuation::~QUmlContinuation()
}
}
+QModelingObject *QUmlContinuation::clone() const
+{
+ QUmlContinuation *c = new QUmlContinuation;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlLifeline *element, covered())
+ c->addCovered(dynamic_cast<QUmlLifeline *>(element->clone()));
+ if (enclosingInteraction())
+ c->setEnclosingInteraction(dynamic_cast<QUmlInteraction *>(enclosingInteraction()->clone()));
+ if (enclosingOperand())
+ c->setEnclosingOperand(dynamic_cast<QUmlInteractionOperand *>(enclosingOperand()->clone()));
+ foreach (QUmlGeneralOrdering *element, generalOrdering())
+ c->addGeneralOrdering(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ c->setSetting(setting());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
True: when the Continuation is at the end of the enclosing InteractionFragment and False when it is in the beginning.
*/
-bool
-QUmlContinuation::setting() const
+bool QUmlContinuation::setting() const
{
// This is a read-write property
diff --git a/src/uml/qumlcontinuation.h b/src/uml/qumlcontinuation.h
index 30f1f6da..f1313584 100644
--- a/src/uml/qumlcontinuation.h
+++ b/src/uml/qumlcontinuation.h
@@ -58,6 +58,8 @@ public:
explicit QUmlContinuation(bool createQObject = true);
virtual ~QUmlContinuation();
+ QModelingObject *clone() const;
+
// Owned attributes
bool setting() const;
void setSetting(bool setting);
diff --git a/src/uml/qumlcontrolflow.cpp b/src/uml/qumlcontrolflow.cpp
index 42ec1ce7..e11295ff 100644
--- a/src/uml/qumlcontrolflow.cpp
+++ b/src/uml/qumlcontrolflow.cpp
@@ -42,6 +42,23 @@
#include "private/qumlcontrolflowobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlControlFlow
@@ -63,3 +80,36 @@ QUmlControlFlow::~QUmlControlFlow()
}
}
+QModelingObject *QUmlControlFlow::clone() const
+{
+ QUmlControlFlow *c = new QUmlControlFlow;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ if (guard())
+ c->setGuard(dynamic_cast<QUmlValueSpecification *>(guard()->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ if (interrupts())
+ c->setInterrupts(dynamic_cast<QUmlInterruptibleActivityRegion *>(interrupts()->clone()));
+ foreach (QUmlActivityEdge *element, redefinedEdge())
+ c->addRedefinedEdge(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ if (source())
+ c->setSource(dynamic_cast<QUmlActivityNode *>(source()->clone()));
+ if (target())
+ c->setTarget(dynamic_cast<QUmlActivityNode *>(target()->clone()));
+ if (weight())
+ c->setWeight(dynamic_cast<QUmlValueSpecification *>(weight()->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlcontrolflow.h b/src/uml/qumlcontrolflow.h
index c32014e5..e0d61527 100644
--- a/src/uml/qumlcontrolflow.h
+++ b/src/uml/qumlcontrolflow.h
@@ -58,6 +58,8 @@ public:
explicit QUmlControlFlow(bool createQObject = true);
virtual ~QUmlControlFlow();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlcontrolnode.cpp b/src/uml/qumlcontrolnode.cpp
index 345a06bd..0dbb2c2a 100644
--- a/src/uml/qumlcontrolnode.cpp
+++ b/src/uml/qumlcontrolnode.cpp
@@ -40,6 +40,22 @@
****************************************************************************/
#include "qumlcontrolnode.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlControlNode
@@ -55,3 +71,32 @@ QUmlControlNode::~QUmlControlNode()
{
}
+QModelingObject *QUmlControlNode::clone() const
+{
+ QUmlControlNode *c = new QUmlControlNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlcontrolnode.h b/src/uml/qumlcontrolnode.h
index 81101ba5..81fc2b6e 100644
--- a/src/uml/qumlcontrolnode.h
+++ b/src/uml/qumlcontrolnode.h
@@ -57,6 +57,8 @@ class Q_UML_EXPORT QUmlControlNode : public QUmlActivityNode
public:
virtual ~QUmlControlNode();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
protected:
explicit QUmlControlNode();
diff --git a/src/uml/qumlcreatelinkaction.cpp b/src/uml/qumlcreatelinkaction.cpp
index e411427a..a713b8b8 100644
--- a/src/uml/qumlcreatelinkaction.cpp
+++ b/src/uml/qumlcreatelinkaction.cpp
@@ -42,8 +42,29 @@
#include "private/qumlcreatelinkactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlAssociation>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
#include <QtUml/QUmlLinkEndCreationData>
-
+#include <QtUml/QUmlLinkEndData>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlCreateLinkAction
@@ -65,13 +86,52 @@ QUmlCreateLinkAction::~QUmlCreateLinkAction()
}
}
+QModelingObject *QUmlCreateLinkAction::clone() const
+{
+ QUmlCreateLinkAction *c = new QUmlCreateLinkAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlInputPin *element, inputValue())
+ c->addInputValue(dynamic_cast<QUmlInputPin *>(element->clone()));
+ foreach (QUmlLinkEndCreationData *element, endData())
+ c->addEndData(dynamic_cast<QUmlLinkEndCreationData *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies ends of association and inputs.
*/
-const QSet<QUmlLinkEndCreationData *>
-QUmlCreateLinkAction::endData() const
+const QSet<QUmlLinkEndCreationData *> QUmlCreateLinkAction::endData() const
{
// This is a read-write association end
diff --git a/src/uml/qumlcreatelinkaction.h b/src/uml/qumlcreatelinkaction.h
index 4a9f36a0..4e79423e 100644
--- a/src/uml/qumlcreatelinkaction.h
+++ b/src/uml/qumlcreatelinkaction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlCreateLinkAction(bool createQObject = true);
virtual ~QUmlCreateLinkAction();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlLinkEndCreationData *> endData() const;
void addEndData(QUmlLinkEndCreationData *endData);
diff --git a/src/uml/qumlcreatelinkobjectaction.cpp b/src/uml/qumlcreatelinkobjectaction.cpp
index 52c9f18d..31a72f6a 100644
--- a/src/uml/qumlcreatelinkobjectaction.cpp
+++ b/src/uml/qumlcreatelinkobjectaction.cpp
@@ -42,8 +42,29 @@
#include "private/qumlcreatelinkobjectactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlAssociation>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlLinkEndCreationData>
+#include <QtUml/QUmlLinkEndData>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlCreateLinkObjectAction
@@ -67,13 +88,54 @@ QUmlCreateLinkObjectAction::~QUmlCreateLinkObjectAction()
}
}
+QModelingObject *QUmlCreateLinkObjectAction::clone() const
+{
+ QUmlCreateLinkObjectAction *c = new QUmlCreateLinkObjectAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlInputPin *element, inputValue())
+ c->addInputValue(dynamic_cast<QUmlInputPin *>(element->clone()));
+ foreach (QUmlLinkEndCreationData *element, endData())
+ c->addEndData(dynamic_cast<QUmlLinkEndCreationData *>(element->clone()));
+ if (result())
+ c->setResult(dynamic_cast<QUmlOutputPin *>(result()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Gives the output pin on which the result is put.
*/
-QUmlOutputPin *
-QUmlCreateLinkObjectAction::result() const
+QUmlOutputPin *QUmlCreateLinkObjectAction::result() const
{
// This is a read-write association end
diff --git a/src/uml/qumlcreatelinkobjectaction.h b/src/uml/qumlcreatelinkobjectaction.h
index f60ea25f..86be6b30 100644
--- a/src/uml/qumlcreatelinkobjectaction.h
+++ b/src/uml/qumlcreatelinkobjectaction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlCreateLinkObjectAction(bool createQObject = true);
virtual ~QUmlCreateLinkObjectAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlOutputPin *result() const;
void setResult(QUmlOutputPin *result);
diff --git a/src/uml/qumlcreateobjectaction.cpp b/src/uml/qumlcreateobjectaction.cpp
index 73496e9a..d3856aff 100644
--- a/src/uml/qumlcreateobjectaction.cpp
+++ b/src/uml/qumlcreateobjectaction.cpp
@@ -42,9 +42,26 @@
#include "private/qumlcreateobjectactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlCreateObjectAction
@@ -68,13 +85,52 @@ QUmlCreateObjectAction::~QUmlCreateObjectAction()
}
}
+QModelingObject *QUmlCreateObjectAction::clone() const
+{
+ QUmlCreateObjectAction *c = new QUmlCreateObjectAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (classifier())
+ c->setClassifier(dynamic_cast<QUmlClassifier *>(classifier()->clone()));
+ if (result())
+ c->setResult(dynamic_cast<QUmlOutputPin *>(result()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Classifier to be instantiated.
*/
-QUmlClassifier *
-QUmlCreateObjectAction::classifier() const
+QUmlClassifier *QUmlCreateObjectAction::classifier() const
{
// This is a read-write association end
@@ -95,8 +151,7 @@ void QUmlCreateObjectAction::setClassifier(QUmlClassifier *classifier)
/*!
Gives the output pin on which the result is put.
*/
-QUmlOutputPin *
-QUmlCreateObjectAction::result() const
+QUmlOutputPin *QUmlCreateObjectAction::result() const
{
// This is a read-write association end
diff --git a/src/uml/qumlcreateobjectaction.h b/src/uml/qumlcreateobjectaction.h
index f8258076..fe9860b7 100644
--- a/src/uml/qumlcreateobjectaction.h
+++ b/src/uml/qumlcreateobjectaction.h
@@ -61,6 +61,8 @@ public:
explicit QUmlCreateObjectAction(bool createQObject = true);
virtual ~QUmlCreateObjectAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlClassifier *classifier() const;
void setClassifier(QUmlClassifier *classifier);
diff --git a/src/uml/qumldatastorenode.cpp b/src/uml/qumldatastorenode.cpp
index ef73c620..9a3a2ad0 100644
--- a/src/uml/qumldatastorenode.cpp
+++ b/src/uml/qumldatastorenode.cpp
@@ -42,6 +42,26 @@
#include "private/qumldatastorenodeobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlState>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlDataStoreNode
@@ -64,3 +84,42 @@ QUmlDataStoreNode::~QUmlDataStoreNode()
}
}
+QModelingObject *QUmlDataStoreNode::clone() const
+{
+ QUmlDataStoreNode *c = new QUmlDataStoreNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ foreach (QUmlState *element, inState())
+ c->addInState(dynamic_cast<QUmlState *>(element->clone()));
+ c->setControlType(isControlType());
+ c->setOrdering(ordering());
+ if (selection())
+ c->setSelection(dynamic_cast<QUmlBehavior *>(selection()->clone()));
+ if (upperBound())
+ c->setUpperBound(dynamic_cast<QUmlValueSpecification *>(upperBound()->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumldatastorenode.h b/src/uml/qumldatastorenode.h
index 791e736f..c8936c5f 100644
--- a/src/uml/qumldatastorenode.h
+++ b/src/uml/qumldatastorenode.h
@@ -58,6 +58,8 @@ public:
explicit QUmlDataStoreNode(bool createQObject = true);
virtual ~QUmlDataStoreNode();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumldatatype.cpp b/src/uml/qumldatatype.cpp
index 545dbb04..244dc7ca 100644
--- a/src/uml/qumldatatype.cpp
+++ b/src/uml/qumldatatype.cpp
@@ -42,10 +42,34 @@
#include "private/qumldatatypeobject_p.h"
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlProperty>
-
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlDataType
@@ -67,13 +91,65 @@ QUmlDataType::~QUmlDataType()
}
}
+QModelingObject *QUmlDataType::clone() const
+{
+ QUmlDataType *c = new QUmlDataType;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The Attributes owned by the DataType.
*/
-const QList<QUmlProperty *>
-QUmlDataType::ownedAttribute() const
+const QList<QUmlProperty *> QUmlDataType::ownedAttribute() const
{
// This is a read-write association end
@@ -124,8 +200,7 @@ void QUmlDataType::removeOwnedAttribute(QUmlProperty *ownedAttribute)
/*!
The Operations owned by the DataType.
*/
-const QList<QUmlOperation *>
-QUmlDataType::ownedOperation() const
+const QList<QUmlOperation *> QUmlDataType::ownedOperation() const
{
// This is a read-write association end
diff --git a/src/uml/qumldatatype.h b/src/uml/qumldatatype.h
index e1ebc978..bc04e48c 100644
--- a/src/uml/qumldatatype.h
+++ b/src/uml/qumldatatype.h
@@ -62,6 +62,8 @@ public:
explicit QUmlDataType(bool createQObject = true);
virtual ~QUmlDataType();
+ QModelingObject *clone() const;
+
// Owned attributes
const QList<QUmlProperty *> ownedAttribute() const;
void addOwnedAttribute(QUmlProperty *ownedAttribute);
diff --git a/src/uml/qumldecisionnode.cpp b/src/uml/qumldecisionnode.cpp
index cb1d6773..f27e5bb7 100644
--- a/src/uml/qumldecisionnode.cpp
+++ b/src/uml/qumldecisionnode.cpp
@@ -42,9 +42,24 @@
#include "private/qumldecisionnodeobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlObjectFlow>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlDecisionNode
@@ -68,13 +83,45 @@ QUmlDecisionNode::~QUmlDecisionNode()
}
}
+QModelingObject *QUmlDecisionNode::clone() const
+{
+ QUmlDecisionNode *c = new QUmlDecisionNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ if (decisionInput())
+ c->setDecisionInput(dynamic_cast<QUmlBehavior *>(decisionInput()->clone()));
+ if (decisionInputFlow())
+ c->setDecisionInputFlow(dynamic_cast<QUmlObjectFlow *>(decisionInputFlow()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Provides input to guard specifications on edges outgoing from the decision node.
*/
-QUmlBehavior *
-QUmlDecisionNode::decisionInput() const
+QUmlBehavior *QUmlDecisionNode::decisionInput() const
{
// This is a read-write association end
@@ -95,8 +142,7 @@ void QUmlDecisionNode::setDecisionInput(QUmlBehavior *decisionInput)
/*!
An additional edge incoming to the decision node that provides a decision input value.
*/
-QUmlObjectFlow *
-QUmlDecisionNode::decisionInputFlow() const
+QUmlObjectFlow *QUmlDecisionNode::decisionInputFlow() const
{
// This is a read-write association end
diff --git a/src/uml/qumldecisionnode.h b/src/uml/qumldecisionnode.h
index 6815b48b..2b9ca9fb 100644
--- a/src/uml/qumldecisionnode.h
+++ b/src/uml/qumldecisionnode.h
@@ -61,6 +61,8 @@ public:
explicit QUmlDecisionNode(bool createQObject = true);
virtual ~QUmlDecisionNode();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlBehavior *decisionInput() const;
void setDecisionInput(QUmlBehavior *decisionInput);
diff --git a/src/uml/qumldependency.cpp b/src/uml/qumldependency.cpp
index 2e57403f..0f307ff5 100644
--- a/src/uml/qumldependency.cpp
+++ b/src/uml/qumldependency.cpp
@@ -42,8 +42,14 @@
#include "private/qumldependencyobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlNamedElement>
-
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlDependency
@@ -65,13 +71,34 @@ QUmlDependency::~QUmlDependency()
}
}
+QModelingObject *QUmlDependency::clone() const
+{
+ QUmlDependency *c = new QUmlDependency;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlNamedElement *element, client())
+ c->addClient(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ foreach (QUmlNamedElement *element, supplier())
+ c->addSupplier(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The element(s) dependent on the supplier element(s). In some cases (such as a Trace Abstraction) the assignment of direction (that is, the designation of the client element) is at the discretion of the modeler, and is a stipulation.
*/
-const QSet<QUmlNamedElement *>
-QUmlDependency::client() const
+const QSet<QUmlNamedElement *> QUmlDependency::client() const
{
// This is a read-write association end
@@ -117,8 +144,7 @@ void QUmlDependency::removeClient(QUmlNamedElement *client)
/*!
The element(s) independent of the client element(s), in the same respect and the same dependency relationship. In some directed dependency relationships (such as Refinement Abstractions), a common convention in the domain of class-based OO software is to put the more abstract element in this role. Despite this convention, users of UML may stipulate a sense of dependency suitable for their domain, which makes a more abstract element dependent on that which is more specific.
*/
-const QSet<QUmlNamedElement *>
-QUmlDependency::supplier() const
+const QSet<QUmlNamedElement *> QUmlDependency::supplier() const
{
// This is a read-write association end
diff --git a/src/uml/qumldependency.h b/src/uml/qumldependency.h
index fb7f8653..fe887803 100644
--- a/src/uml/qumldependency.h
+++ b/src/uml/qumldependency.h
@@ -61,6 +61,8 @@ public:
explicit QUmlDependency(bool createQObject = true);
virtual ~QUmlDependency();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlNamedElement *> client() const;
void addClient(QUmlNamedElement *client);
diff --git a/src/uml/qumldeployedartifact.cpp b/src/uml/qumldeployedartifact.cpp
index 5fcc7d19..97463d26 100644
--- a/src/uml/qumldeployedartifact.cpp
+++ b/src/uml/qumldeployedartifact.cpp
@@ -40,6 +40,13 @@
****************************************************************************/
#include "qumldeployedartifact.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlDeployedArtifact
@@ -55,3 +62,17 @@ QUmlDeployedArtifact::~QUmlDeployedArtifact()
{
}
+QModelingObject *QUmlDeployedArtifact::clone() const
+{
+ QUmlDeployedArtifact *c = new QUmlDeployedArtifact;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ return c;
+}
+
diff --git a/src/uml/qumldeployedartifact.h b/src/uml/qumldeployedartifact.h
index 818949d5..00f5a67f 100644
--- a/src/uml/qumldeployedartifact.h
+++ b/src/uml/qumldeployedartifact.h
@@ -57,6 +57,8 @@ class Q_UML_EXPORT QUmlDeployedArtifact : public virtual QUmlNamedElement
public:
virtual ~QUmlDeployedArtifact();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
protected:
explicit QUmlDeployedArtifact();
diff --git a/src/uml/qumldeployment.cpp b/src/uml/qumldeployment.cpp
index c53bb063..f3be5944 100644
--- a/src/uml/qumldeployment.cpp
+++ b/src/uml/qumldeployment.cpp
@@ -42,10 +42,18 @@
#include "private/qumldeploymentobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
#include <QtUml/QUmlDeployedArtifact>
#include <QtUml/QUmlDeploymentSpecification>
#include <QtUml/QUmlDeploymentTarget>
-
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlDeployment
@@ -69,13 +77,40 @@ QUmlDeployment::~QUmlDeployment()
}
}
+QModelingObject *QUmlDeployment::clone() const
+{
+ QUmlDeployment *c = new QUmlDeployment;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlNamedElement *element, client())
+ c->addClient(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ foreach (QUmlNamedElement *element, supplier())
+ c->addSupplier(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ foreach (QUmlDeploymentSpecification *element, configuration())
+ c->addConfiguration(dynamic_cast<QUmlDeploymentSpecification *>(element->clone()));
+ foreach (QUmlDeployedArtifact *element, deployedArtifact())
+ c->addDeployedArtifact(dynamic_cast<QUmlDeployedArtifact *>(element->clone()));
+ if (location())
+ c->setLocation(dynamic_cast<QUmlDeploymentTarget *>(location()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The specification of properties that parameterize the deployment and execution of one or more Artifacts.
*/
-const QSet<QUmlDeploymentSpecification *>
-QUmlDeployment::configuration() const
+const QSet<QUmlDeploymentSpecification *> QUmlDeployment::configuration() const
{
// This is a read-write association end
@@ -124,8 +159,7 @@ void QUmlDeployment::removeConfiguration(QUmlDeploymentSpecification *configurat
/*!
The Artifacts that are deployed onto a Node. This association specializes the supplier association.
*/
-const QSet<QUmlDeployedArtifact *>
-QUmlDeployment::deployedArtifact() const
+const QSet<QUmlDeployedArtifact *> QUmlDeployment::deployedArtifact() const
{
// This is a read-write association end
@@ -161,8 +195,7 @@ void QUmlDeployment::removeDeployedArtifact(QUmlDeployedArtifact *deployedArtifa
/*!
The DeployedTarget which is the target of a Deployment.
*/
-QUmlDeploymentTarget *
-QUmlDeployment::location() const
+QUmlDeploymentTarget *QUmlDeployment::location() const
{
// This is a read-write association end
diff --git a/src/uml/qumldeployment.h b/src/uml/qumldeployment.h
index 8501af88..f552c37f 100644
--- a/src/uml/qumldeployment.h
+++ b/src/uml/qumldeployment.h
@@ -62,6 +62,8 @@ public:
explicit QUmlDeployment(bool createQObject = true);
virtual ~QUmlDeployment();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlDeploymentSpecification *> configuration() const;
void addConfiguration(QUmlDeploymentSpecification *configuration);
diff --git a/src/uml/qumldeploymentspecification.cpp b/src/uml/qumldeploymentspecification.cpp
index 48537c3b..049021fe 100644
--- a/src/uml/qumldeploymentspecification.cpp
+++ b/src/uml/qumldeploymentspecification.cpp
@@ -42,8 +42,37 @@
#include "private/qumldeploymentspecificationobject_p.h"
+#include <QtUml/QUmlArtifact>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
#include <QtUml/QUmlDeployment>
-
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlManifestation>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlDeploymentSpecification
@@ -67,13 +96,74 @@ QUmlDeploymentSpecification::~QUmlDeploymentSpecification()
}
}
+QModelingObject *QUmlDeploymentSpecification::clone() const
+{
+ QUmlDeploymentSpecification *c = new QUmlDeploymentSpecification;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ c->setFileName(fileName());
+ foreach (QUmlManifestation *element, manifestation())
+ c->addManifestation(dynamic_cast<QUmlManifestation *>(element->clone()));
+ foreach (QUmlArtifact *element, nestedArtifact())
+ c->addNestedArtifact(dynamic_cast<QUmlArtifact *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ if (deployment())
+ c->setDeployment(dynamic_cast<QUmlDeployment *>(deployment()->clone()));
+ c->setDeploymentLocation(deploymentLocation());
+ c->setExecutionLocation(executionLocation());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The deployment with which the DeploymentSpecification is associated.
*/
-QUmlDeployment *
-QUmlDeploymentSpecification::deployment() const
+QUmlDeployment *QUmlDeploymentSpecification::deployment() const
{
// This is a read-write association end
@@ -99,8 +189,7 @@ void QUmlDeploymentSpecification::setDeployment(QUmlDeployment *deployment)
/*!
The location where an Artifact is deployed onto a Node. This is typically a 'directory' or 'memory address'.
*/
-QString
-QUmlDeploymentSpecification::deploymentLocation() const
+QString QUmlDeploymentSpecification::deploymentLocation() const
{
// This is a read-write property
@@ -119,8 +208,7 @@ void QUmlDeploymentSpecification::setDeploymentLocation(QString deploymentLocati
/*!
The location where a component Artifact executes. This may be a local or remote location.
*/
-QString
-QUmlDeploymentSpecification::executionLocation() const
+QString QUmlDeploymentSpecification::executionLocation() const
{
// This is a read-write property
diff --git a/src/uml/qumldeploymentspecification.h b/src/uml/qumldeploymentspecification.h
index 01214b93..2eb2b7cc 100644
--- a/src/uml/qumldeploymentspecification.h
+++ b/src/uml/qumldeploymentspecification.h
@@ -60,6 +60,8 @@ public:
explicit QUmlDeploymentSpecification(bool createQObject = true);
virtual ~QUmlDeploymentSpecification();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlDeployment *deployment() const;
void setDeployment(QUmlDeployment *deployment);
diff --git a/src/uml/qumldeploymenttarget.cpp b/src/uml/qumldeploymenttarget.cpp
index 2397a486..e755e9ae 100644
--- a/src/uml/qumldeploymenttarget.cpp
+++ b/src/uml/qumldeploymenttarget.cpp
@@ -40,9 +40,15 @@
****************************************************************************/
#include "qumldeploymenttarget.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
#include <QtUml/QUmlDeployment>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
#include <QtUml/QUmlPackageableElement>
-
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlDeploymentTarget
@@ -58,13 +64,28 @@ QUmlDeploymentTarget::~QUmlDeploymentTarget()
{
}
+QModelingObject *QUmlDeploymentTarget::clone() const
+{
+ QUmlDeploymentTarget *c = new QUmlDeploymentTarget;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlDeployment *element, deployment())
+ c->addDeployment(dynamic_cast<QUmlDeployment *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The set of elements that are manifested in an Artifact that is involved in Deployment to a DeploymentTarget.
*/
-const QSet<QUmlPackageableElement *>
-QUmlDeploymentTarget::deployedElement() const
+const QSet<QUmlPackageableElement *> QUmlDeploymentTarget::deployedElement() const
{
// This is a read-only derived association end
@@ -100,8 +121,7 @@ void QUmlDeploymentTarget::removeDeployedElement(QUmlPackageableElement *deploye
/*!
The set of Deployments for a DeploymentTarget.
*/
-const QSet<QUmlDeployment *>
-QUmlDeploymentTarget::deployment() const
+const QSet<QUmlDeployment *> QUmlDeploymentTarget::deployment() const
{
// This is a read-write association end
diff --git a/src/uml/qumldeploymenttarget.h b/src/uml/qumldeploymenttarget.h
index 0ee2e37d..f1c0a49c 100644
--- a/src/uml/qumldeploymenttarget.h
+++ b/src/uml/qumldeploymenttarget.h
@@ -60,6 +60,8 @@ class Q_UML_EXPORT QUmlDeploymentTarget : public virtual QUmlNamedElement
public:
virtual ~QUmlDeploymentTarget();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlPackageableElement *> deployedElement() const;
Q_DECL_HIDDEN void addDeployedElement(QUmlPackageableElement *deployedElement);
diff --git a/src/uml/qumldestroylinkaction.cpp b/src/uml/qumldestroylinkaction.cpp
index 4c60415f..41866a33 100644
--- a/src/uml/qumldestroylinkaction.cpp
+++ b/src/uml/qumldestroylinkaction.cpp
@@ -42,8 +42,29 @@
#include "private/qumldestroylinkactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlAssociation>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlLinkEndData>
#include <QtUml/QUmlLinkEndDestructionData>
-
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlDestroyLinkAction
@@ -65,13 +86,52 @@ QUmlDestroyLinkAction::~QUmlDestroyLinkAction()
}
}
+QModelingObject *QUmlDestroyLinkAction::clone() const
+{
+ QUmlDestroyLinkAction *c = new QUmlDestroyLinkAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlInputPin *element, inputValue())
+ c->addInputValue(dynamic_cast<QUmlInputPin *>(element->clone()));
+ foreach (QUmlLinkEndDestructionData *element, endData())
+ c->addEndData(dynamic_cast<QUmlLinkEndDestructionData *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies ends of association and inputs.
*/
-const QSet<QUmlLinkEndDestructionData *>
-QUmlDestroyLinkAction::endData() const
+const QSet<QUmlLinkEndDestructionData *> QUmlDestroyLinkAction::endData() const
{
// This is a read-write association end
diff --git a/src/uml/qumldestroylinkaction.h b/src/uml/qumldestroylinkaction.h
index bf91798a..93aeb7bf 100644
--- a/src/uml/qumldestroylinkaction.h
+++ b/src/uml/qumldestroylinkaction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlDestroyLinkAction(bool createQObject = true);
virtual ~QUmlDestroyLinkAction();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlLinkEndDestructionData *> endData() const;
void addEndData(QUmlLinkEndDestructionData *endData);
diff --git a/src/uml/qumldestroyobjectaction.cpp b/src/uml/qumldestroyobjectaction.cpp
index c8240f9c..451fafc6 100644
--- a/src/uml/qumldestroyobjectaction.cpp
+++ b/src/uml/qumldestroyobjectaction.cpp
@@ -42,8 +42,26 @@
#include "private/qumldestroyobjectactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
-
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlDestroyObjectAction
@@ -68,13 +86,52 @@ QUmlDestroyObjectAction::~QUmlDestroyObjectAction()
}
}
+QModelingObject *QUmlDestroyObjectAction::clone() const
+{
+ QUmlDestroyObjectAction *c = new QUmlDestroyObjectAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ c->setDestroyLinks(isDestroyLinks());
+ c->setDestroyOwnedObjects(isDestroyOwnedObjects());
+ if (target())
+ c->setTarget(dynamic_cast<QUmlInputPin *>(target()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies whether links in which the object participates are destroyed along with the object.
*/
-bool
-QUmlDestroyObjectAction::isDestroyLinks() const
+bool QUmlDestroyObjectAction::isDestroyLinks() const
{
// This is a read-write property
@@ -93,8 +150,7 @@ void QUmlDestroyObjectAction::setDestroyLinks(bool isDestroyLinks)
/*!
Specifies whether objects owned by the object are destroyed along with the object.
*/
-bool
-QUmlDestroyObjectAction::isDestroyOwnedObjects() const
+bool QUmlDestroyObjectAction::isDestroyOwnedObjects() const
{
// This is a read-write property
@@ -113,8 +169,7 @@ void QUmlDestroyObjectAction::setDestroyOwnedObjects(bool isDestroyOwnedObjects)
/*!
The input pin providing the object to be destroyed.
*/
-QUmlInputPin *
-QUmlDestroyObjectAction::target() const
+QUmlInputPin *QUmlDestroyObjectAction::target() const
{
// This is a read-write association end
diff --git a/src/uml/qumldestroyobjectaction.h b/src/uml/qumldestroyobjectaction.h
index 941f9a1b..02e3fb55 100644
--- a/src/uml/qumldestroyobjectaction.h
+++ b/src/uml/qumldestroyobjectaction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlDestroyObjectAction(bool createQObject = true);
virtual ~QUmlDestroyObjectAction();
+ QModelingObject *clone() const;
+
// Owned attributes
bool isDestroyLinks() const;
void setDestroyLinks(bool isDestroyLinks);
diff --git a/src/uml/qumldestructionoccurrencespecification.cpp b/src/uml/qumldestructionoccurrencespecification.cpp
index 9dfd2667..b3f07f71 100644
--- a/src/uml/qumldestructionoccurrencespecification.cpp
+++ b/src/uml/qumldestructionoccurrencespecification.cpp
@@ -42,6 +42,18 @@
#include "private/qumldestructionoccurrencespecificationobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlGeneralOrdering>
+#include <QtUml/QUmlInteraction>
+#include <QtUml/QUmlInteractionOperand>
+#include <QtUml/QUmlLifeline>
+#include <QtUml/QUmlMessage>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlDestructionOccurrenceSpecification
@@ -64,3 +76,31 @@ QUmlDestructionOccurrenceSpecification::~QUmlDestructionOccurrenceSpecification(
}
}
+QModelingObject *QUmlDestructionOccurrenceSpecification::clone() const
+{
+ QUmlDestructionOccurrenceSpecification *c = new QUmlDestructionOccurrenceSpecification;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (enclosingInteraction())
+ c->setEnclosingInteraction(dynamic_cast<QUmlInteraction *>(enclosingInteraction()->clone()));
+ if (enclosingOperand())
+ c->setEnclosingOperand(dynamic_cast<QUmlInteractionOperand *>(enclosingOperand()->clone()));
+ foreach (QUmlGeneralOrdering *element, generalOrdering())
+ c->addGeneralOrdering(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ if (covered())
+ c->setCovered(dynamic_cast<QUmlLifeline *>(covered()->clone()));
+ foreach (QUmlGeneralOrdering *element, toAfter())
+ c->addToAfter(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ foreach (QUmlGeneralOrdering *element, toBefore())
+ c->addToBefore(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ if (message())
+ c->setMessage(dynamic_cast<QUmlMessage *>(message()->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumldestructionoccurrencespecification.h b/src/uml/qumldestructionoccurrencespecification.h
index 2e3dcc13..f83fb0c2 100644
--- a/src/uml/qumldestructionoccurrencespecification.h
+++ b/src/uml/qumldestructionoccurrencespecification.h
@@ -58,6 +58,8 @@ public:
explicit QUmlDestructionOccurrenceSpecification(bool createQObject = true);
virtual ~QUmlDestructionOccurrenceSpecification();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumldevice.cpp b/src/uml/qumldevice.cpp
index f271e22a..cab1aa0b 100644
--- a/src/uml/qumldevice.cpp
+++ b/src/uml/qumldevice.cpp
@@ -42,6 +42,44 @@
#include "private/qumldeviceobject_p.h"
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClass>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElement>
+#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlDeployment>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExtension>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlInterfaceRealization>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlNode>
+#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlReception>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlDevice
@@ -64,3 +102,73 @@ QUmlDevice::~QUmlDevice()
}
}
+QModelingObject *QUmlDevice::clone() const
+{
+ QUmlDevice *c = new QUmlDevice;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlConnector *element, ownedConnector())
+ c->addOwnedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setActive(isActive());
+ foreach (QUmlClassifier *element, nestedClassifier())
+ c->addNestedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ foreach (QUmlReception *element, ownedReception())
+ c->addOwnedReception(dynamic_cast<QUmlReception *>(element->clone()));
+ foreach (QUmlDeployment *element, deployment())
+ c->addDeployment(dynamic_cast<QUmlDeployment *>(element->clone()));
+ foreach (QUmlNode *element, nestedNode())
+ c->addNestedNode(dynamic_cast<QUmlNode *>(element->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumldevice.h b/src/uml/qumldevice.h
index d63c13ec..5c54c521 100644
--- a/src/uml/qumldevice.h
+++ b/src/uml/qumldevice.h
@@ -58,6 +58,8 @@ public:
explicit QUmlDevice(bool createQObject = true);
virtual ~QUmlDevice();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumldirectedrelationship.cpp b/src/uml/qumldirectedrelationship.cpp
index 322e6568..4091a6a3 100644
--- a/src/uml/qumldirectedrelationship.cpp
+++ b/src/uml/qumldirectedrelationship.cpp
@@ -40,8 +40,8 @@
****************************************************************************/
#include "qumldirectedrelationship.h"
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlElement>
-
/*!
\class QUmlDirectedRelationship
@@ -57,13 +57,20 @@ QUmlDirectedRelationship::~QUmlDirectedRelationship()
{
}
+QModelingObject *QUmlDirectedRelationship::clone() const
+{
+ QUmlDirectedRelationship *c = new QUmlDirectedRelationship;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies the sources of the DirectedRelationship.
*/
-const QSet<QUmlElement *>
-QUmlDirectedRelationship::source() const
+const QSet<QUmlElement *> QUmlDirectedRelationship::source() const
{
// This is a read-only derived union association end
@@ -99,8 +106,7 @@ void QUmlDirectedRelationship::removeSource(QUmlElement *source)
/*!
Specifies the targets of the DirectedRelationship.
*/
-const QSet<QUmlElement *>
-QUmlDirectedRelationship::target() const
+const QSet<QUmlElement *> QUmlDirectedRelationship::target() const
{
// This is a read-only derived union association end
diff --git a/src/uml/qumldirectedrelationship.h b/src/uml/qumldirectedrelationship.h
index d7a465d7..5c201a09 100644
--- a/src/uml/qumldirectedrelationship.h
+++ b/src/uml/qumldirectedrelationship.h
@@ -59,6 +59,8 @@ class Q_UML_EXPORT QUmlDirectedRelationship : public QUmlRelationship
public:
virtual ~QUmlDirectedRelationship();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlElement *> source() const;
Q_DECL_HIDDEN void addSource(QUmlElement *source);
diff --git a/src/uml/qumlduration.cpp b/src/uml/qumlduration.cpp
index 0c724f6b..3324f0b2 100644
--- a/src/uml/qumlduration.cpp
+++ b/src/uml/qumlduration.cpp
@@ -42,8 +42,18 @@
#include "private/qumldurationobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlObservation>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlDuration
@@ -66,13 +76,36 @@ QUmlDuration::~QUmlDuration()
}
}
+QModelingObject *QUmlDuration::clone() const
+{
+ QUmlDuration *c = new QUmlDuration;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (expr())
+ c->setExpr(dynamic_cast<QUmlValueSpecification *>(expr()->clone()));
+ foreach (QUmlObservation *element, observation())
+ c->addObservation(dynamic_cast<QUmlObservation *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The value of the Duration.
*/
-QUmlValueSpecification *
-QUmlDuration::expr() const
+QUmlValueSpecification *QUmlDuration::expr() const
{
// This is a read-write association end
@@ -102,8 +135,7 @@ void QUmlDuration::setExpr(QUmlValueSpecification *expr)
/*!
Refers to the time and duration observations that are involved in expr.
*/
-const QSet<QUmlObservation *>
-QUmlDuration::observation() const
+const QSet<QUmlObservation *> QUmlDuration::observation() const
{
// This is a read-write association end
diff --git a/src/uml/qumlduration.h b/src/uml/qumlduration.h
index f3efba30..7f3137d4 100644
--- a/src/uml/qumlduration.h
+++ b/src/uml/qumlduration.h
@@ -60,6 +60,8 @@ public:
explicit QUmlDuration(bool createQObject = true);
virtual ~QUmlDuration();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlValueSpecification *expr() const;
void setExpr(QUmlValueSpecification *expr);
diff --git a/src/uml/qumldurationconstraint.cpp b/src/uml/qumldurationconstraint.cpp
index a4a2c53d..fee2e52f 100644
--- a/src/uml/qumldurationconstraint.cpp
+++ b/src/uml/qumldurationconstraint.cpp
@@ -42,8 +42,18 @@
#include "private/qumldurationconstraintobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
#include <QtUml/QUmlDurationInterval>
-
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterval>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlDurationConstraint
@@ -67,13 +77,37 @@ QUmlDurationConstraint::~QUmlDurationConstraint()
}
}
+QModelingObject *QUmlDurationConstraint::clone() const
+{
+ QUmlDurationConstraint *c = new QUmlDurationConstraint;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlElement *element, constrainedElement())
+ c->addConstrainedElement(dynamic_cast<QUmlElement *>(element->clone()));
+ if (context())
+ c->setContext(dynamic_cast<QUmlNamespace *>(context()->clone()));
+ c->setFirstEvent(firstEvent());
+ if (specification())
+ c->setSpecification(dynamic_cast<QUmlDurationInterval *>(specification()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The value of firstEvent[i] is related to constrainedElement[i] (where i is 1 or 2). If firstEvent[i] is true, then the corresponding observation event is the first time instant the execution enters constrainedElement[i]. If firstEvent[i] is false, then the corresponding observation event is the last time instant the execution is within constrainedElement[i]. Default value is true applied when constrainedElement[i] refers an element that represents only one time instant.
*/
-bool
-QUmlDurationConstraint::firstEvent() const
+bool QUmlDurationConstraint::firstEvent() const
{
// This is a read-write property
@@ -92,8 +126,7 @@ void QUmlDurationConstraint::setFirstEvent(bool firstEvent)
/*!
The interval constraining the duration.
*/
-QUmlDurationInterval *
-QUmlDurationConstraint::specification() const
+QUmlDurationInterval *QUmlDurationConstraint::specification() const
{
// This is a read-write association end
diff --git a/src/uml/qumldurationconstraint.h b/src/uml/qumldurationconstraint.h
index e95dac73..76496a9c 100644
--- a/src/uml/qumldurationconstraint.h
+++ b/src/uml/qumldurationconstraint.h
@@ -60,6 +60,8 @@ public:
explicit QUmlDurationConstraint(bool createQObject = true);
virtual ~QUmlDurationConstraint();
+ QModelingObject *clone() const;
+
// Owned attributes
bool firstEvent() const;
void setFirstEvent(bool firstEvent);
diff --git a/src/uml/qumldurationinterval.cpp b/src/uml/qumldurationinterval.cpp
index 96e2e430..450760ef 100644
--- a/src/uml/qumldurationinterval.cpp
+++ b/src/uml/qumldurationinterval.cpp
@@ -42,8 +42,18 @@
#include "private/qumldurationintervalobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
#include <QtUml/QUmlDuration>
-
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlDurationInterval
@@ -68,13 +78,36 @@ QUmlDurationInterval::~QUmlDurationInterval()
}
}
+QModelingObject *QUmlDurationInterval::clone() const
+{
+ QUmlDurationInterval *c = new QUmlDurationInterval;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (max())
+ c->setMax(dynamic_cast<QUmlDuration *>(max()->clone()));
+ if (min())
+ c->setMin(dynamic_cast<QUmlDuration *>(min()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Refers to the Duration denoting the maximum value of the range.
*/
-QUmlDuration *
-QUmlDurationInterval::max() const
+QUmlDuration *QUmlDurationInterval::max() const
{
// This is a read-write association end
@@ -95,8 +128,7 @@ void QUmlDurationInterval::setMax(QUmlDuration *max)
/*!
Refers to the Duration denoting the minimum value of the range.
*/
-QUmlDuration *
-QUmlDurationInterval::min() const
+QUmlDuration *QUmlDurationInterval::min() const
{
// This is a read-write association end
diff --git a/src/uml/qumldurationinterval.h b/src/uml/qumldurationinterval.h
index 1a39be91..65625e21 100644
--- a/src/uml/qumldurationinterval.h
+++ b/src/uml/qumldurationinterval.h
@@ -60,6 +60,8 @@ public:
explicit QUmlDurationInterval(bool createQObject = true);
virtual ~QUmlDurationInterval();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlDuration *max() const;
void setMax(QUmlDuration *max);
diff --git a/src/uml/qumldurationobservation.cpp b/src/uml/qumldurationobservation.cpp
index e774f4ba..7c2130ce 100644
--- a/src/uml/qumldurationobservation.cpp
+++ b/src/uml/qumldurationobservation.cpp
@@ -42,8 +42,15 @@
#include "private/qumldurationobservationobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlNamedElement>
-
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlDurationObservation
@@ -66,13 +73,33 @@ QUmlDurationObservation::~QUmlDurationObservation()
}
}
+QModelingObject *QUmlDurationObservation::clone() const
+{
+ QUmlDurationObservation *c = new QUmlDurationObservation;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (event())
+ c->setEvent(dynamic_cast<QUmlNamedElement *>(event()->clone()));
+ c->setFirstEvent(firstEvent());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The observation is determined by the entering or exiting of the event element during execution.
*/
-QUmlNamedElement *
-QUmlDurationObservation::event() const
+QUmlNamedElement *QUmlDurationObservation::event() const
{
// This is a read-write association end
@@ -93,8 +120,7 @@ void QUmlDurationObservation::setEvent(QUmlNamedElement *event)
/*!
The value of firstEvent[i] is related to event[i] (where i is 1 or 2). If firstEvent[i] is true, then the corresponding observation event is the first time instant the execution enters event[i]. If firstEvent[i] is false, then the corresponding observation event is the time instant the execution exits event[i]. Default value is true applied when event[i] refers an element that represents only one time instant.
*/
-bool
-QUmlDurationObservation::firstEvent() const
+bool QUmlDurationObservation::firstEvent() const
{
// This is a read-write property
diff --git a/src/uml/qumldurationobservation.h b/src/uml/qumldurationobservation.h
index 96333fac..54422206 100644
--- a/src/uml/qumldurationobservation.h
+++ b/src/uml/qumldurationobservation.h
@@ -60,6 +60,8 @@ public:
explicit QUmlDurationObservation(bool createQObject = true);
virtual ~QUmlDurationObservation();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlNamedElement *event() const;
void setEvent(QUmlNamedElement *event);
diff --git a/src/uml/qumlelement.cpp b/src/uml/qumlelement.cpp
index 5f91b89b..25a6013a 100644
--- a/src/uml/qumlelement.cpp
+++ b/src/uml/qumlelement.cpp
@@ -41,7 +41,6 @@
#include "qumlelement.h"
#include <QtUml/QUmlComment>
-
/*!
\class QUmlElement
@@ -58,13 +57,20 @@ QUmlElement::~QUmlElement()
{
}
+QModelingObject *QUmlElement::clone() const
+{
+ QUmlElement *c = new QUmlElement;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The Comments owned by this element.
*/
-const QSet<QUmlComment *>
-QUmlElement::ownedComment() const
+const QSet<QUmlComment *> QUmlElement::ownedComment() const
{
// This is a read-write association end
@@ -103,8 +109,7 @@ void QUmlElement::removeOwnedComment(QUmlComment *ownedComment)
/*!
The Elements owned by this element.
*/
-const QSet<QUmlElement *>
-QUmlElement::ownedElement() const
+const QSet<QUmlElement *> QUmlElement::ownedElement() const
{
// This is a read-only derived union association end
@@ -137,8 +142,7 @@ void QUmlElement::removeOwnedElement(QUmlElement *ownedElement)
/*!
The Element that owns this element.
*/
-QUmlElement *
-QUmlElement::owner() const
+QUmlElement *QUmlElement::owner() const
{
// This is a read-only derived union association end
diff --git a/src/uml/qumlelement.h b/src/uml/qumlelement.h
index 38fa9fe6..7ee0785b 100644
--- a/src/uml/qumlelement.h
+++ b/src/uml/qumlelement.h
@@ -59,6 +59,8 @@ class Q_UML_EXPORT QUmlElement : public QModelingObject
public:
virtual ~QUmlElement();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlComment *> ownedComment() const;
void addOwnedComment(QUmlComment *ownedComment);
diff --git a/src/uml/qumlelementimport.cpp b/src/uml/qumlelementimport.cpp
index d45bd5dd..24ed67e7 100644
--- a/src/uml/qumlelementimport.cpp
+++ b/src/uml/qumlelementimport.cpp
@@ -42,9 +42,10 @@
#include "private/qumlelementimportobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlPackageableElement>
-
/*!
\class QUmlElementImport
@@ -69,13 +70,26 @@ QUmlElementImport::~QUmlElementImport()
}
}
+QModelingObject *QUmlElementImport::clone() const
+{
+ QUmlElementImport *c = new QUmlElementImport;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ c->setAlias(alias());
+ if (importedElement())
+ c->setImportedElement(dynamic_cast<QUmlPackageableElement *>(importedElement()->clone()));
+ if (importingNamespace())
+ c->setImportingNamespace(dynamic_cast<QUmlNamespace *>(importingNamespace()->clone()));
+ c->setVisibility(visibility());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies the name that should be added to the namespace of the importing package in lieu of the name of the imported packagable element. The aliased name must not clash with any other member name in the importing package. By default, no alias is used.
*/
-QString
-QUmlElementImport::alias() const
+QString QUmlElementImport::alias() const
{
// This is a read-write property
@@ -94,8 +108,7 @@ void QUmlElementImport::setAlias(QString alias)
/*!
Specifies the PackageableElement whose name is to be added to a Namespace.
*/
-QUmlPackageableElement *
-QUmlElementImport::importedElement() const
+QUmlPackageableElement *QUmlElementImport::importedElement() const
{
// This is a read-write association end
@@ -124,8 +137,7 @@ void QUmlElementImport::setImportedElement(QUmlPackageableElement *importedEleme
/*!
Specifies the Namespace that imports a PackageableElement from another Package.
*/
-QUmlNamespace *
-QUmlElementImport::importingNamespace() const
+QUmlNamespace *QUmlElementImport::importingNamespace() const
{
// This is a read-write association end
@@ -155,8 +167,7 @@ void QUmlElementImport::setImportingNamespace(QUmlNamespace *importingNamespace)
/*!
Specifies the visibility of the imported PackageableElement within the importing Package. The default visibility is the same as that of the imported element. If the imported element does not have a visibility, it is possible to add visibility to the element import.
*/
-QtUml::VisibilityKind
-QUmlElementImport::visibility() const
+QtUml::VisibilityKind QUmlElementImport::visibility() const
{
// This is a read-write property
diff --git a/src/uml/qumlelementimport.h b/src/uml/qumlelementimport.h
index 67cb9a2f..b8ecb073 100644
--- a/src/uml/qumlelementimport.h
+++ b/src/uml/qumlelementimport.h
@@ -63,6 +63,8 @@ public:
explicit QUmlElementImport(bool createQObject = true);
virtual ~QUmlElementImport();
+ QModelingObject *clone() const;
+
// Owned attributes
QString alias() const;
void setAlias(QString alias);
diff --git a/src/uml/qumlencapsulatedclassifier.cpp b/src/uml/qumlencapsulatedclassifier.cpp
index c1dc07fb..d304a6d6 100644
--- a/src/uml/qumlencapsulatedclassifier.cpp
+++ b/src/uml/qumlencapsulatedclassifier.cpp
@@ -40,8 +40,36 @@
****************************************************************************/
#include "qumlencapsulatedclassifier.h"
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElement>
+#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlPort>
-
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlEncapsulatedClassifier
@@ -57,13 +85,65 @@ QUmlEncapsulatedClassifier::~QUmlEncapsulatedClassifier()
{
}
+QModelingObject *QUmlEncapsulatedClassifier::clone() const
+{
+ QUmlEncapsulatedClassifier *c = new QUmlEncapsulatedClassifier;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlConnector *element, ownedConnector())
+ c->addOwnedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References a set of ports that an encapsulated classifier owns.
*/
-const QSet<QUmlPort *>
-QUmlEncapsulatedClassifier::ownedPort() const
+const QSet<QUmlPort *> QUmlEncapsulatedClassifier::ownedPort() const
{
// This is a read-only derived association end
diff --git a/src/uml/qumlencapsulatedclassifier.h b/src/uml/qumlencapsulatedclassifier.h
index d1472953..52b33d31 100644
--- a/src/uml/qumlencapsulatedclassifier.h
+++ b/src/uml/qumlencapsulatedclassifier.h
@@ -59,6 +59,8 @@ class Q_UML_EXPORT QUmlEncapsulatedClassifier : public QUmlStructuredClassifier
public:
virtual ~QUmlEncapsulatedClassifier();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlPort *> ownedPort() const;
Q_DECL_HIDDEN void addOwnedPort(QUmlPort *ownedPort);
diff --git a/src/uml/qumlenumeration.cpp b/src/uml/qumlenumeration.cpp
index bcd2cc95..561d1733 100644
--- a/src/uml/qumlenumeration.cpp
+++ b/src/uml/qumlenumeration.cpp
@@ -42,8 +42,35 @@
#include "private/qumlenumerationobject_p.h"
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
#include <QtUml/QUmlEnumerationLiteral>
-
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlEnumeration
@@ -66,13 +93,67 @@ QUmlEnumeration::~QUmlEnumeration()
}
}
+QModelingObject *QUmlEnumeration::clone() const
+{
+ QUmlEnumeration *c = new QUmlEnumeration;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ foreach (QUmlEnumerationLiteral *element, ownedLiteral())
+ c->addOwnedLiteral(dynamic_cast<QUmlEnumerationLiteral *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The ordered set of literals for this Enumeration.
*/
-const QList<QUmlEnumerationLiteral *>
-QUmlEnumeration::ownedLiteral() const
+const QList<QUmlEnumerationLiteral *> QUmlEnumeration::ownedLiteral() const
{
// This is a read-write association end
diff --git a/src/uml/qumlenumeration.h b/src/uml/qumlenumeration.h
index 08c451cf..d6b23c65 100644
--- a/src/uml/qumlenumeration.h
+++ b/src/uml/qumlenumeration.h
@@ -60,6 +60,8 @@ public:
explicit QUmlEnumeration(bool createQObject = true);
virtual ~QUmlEnumeration();
+ QModelingObject *clone() const;
+
// Owned attributes
const QList<QUmlEnumerationLiteral *> ownedLiteral() const;
void addOwnedLiteral(QUmlEnumerationLiteral *ownedLiteral);
diff --git a/src/uml/qumlenumerationliteral.cpp b/src/uml/qumlenumerationliteral.cpp
index e7d7590a..201ca442 100644
--- a/src/uml/qumlenumerationliteral.cpp
+++ b/src/uml/qumlenumerationliteral.cpp
@@ -42,8 +42,21 @@
#include "private/qumlenumerationliteralobject_p.h"
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlDeployment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlEnumeration>
-
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlSlot>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlEnumerationLiteral
@@ -67,13 +80,38 @@ QUmlEnumerationLiteral::~QUmlEnumerationLiteral()
}
}
+QModelingObject *QUmlEnumerationLiteral::clone() const
+{
+ QUmlEnumerationLiteral *c = new QUmlEnumerationLiteral;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlDeployment *element, deployment())
+ c->addDeployment(dynamic_cast<QUmlDeployment *>(element->clone()));
+ foreach (QUmlSlot *element, slot_())
+ c->addSlot(dynamic_cast<QUmlSlot *>(element->clone()));
+ if (specification())
+ c->setSpecification(dynamic_cast<QUmlValueSpecification *>(specification()->clone()));
+ if (enumeration())
+ c->setEnumeration(dynamic_cast<QUmlEnumeration *>(enumeration()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The classifier of this EnumerationLiteral derived to be equal to its enumeration.
*/
-QUmlEnumeration *
-QUmlEnumerationLiteral::classifier() const
+QUmlEnumeration *QUmlEnumerationLiteral::classifier() const
{
// This is a read-only derived association end
@@ -97,8 +135,7 @@ void QUmlEnumerationLiteral::setClassifier(QUmlEnumeration *classifier)
/*!
The Enumeration that this EnumerationLiteral is a member of.
*/
-QUmlEnumeration *
-QUmlEnumerationLiteral::enumeration() const
+QUmlEnumeration *QUmlEnumerationLiteral::enumeration() const
{
// This is a read-write association end
diff --git a/src/uml/qumlenumerationliteral.h b/src/uml/qumlenumerationliteral.h
index 9f0d8496..c7bbffc6 100644
--- a/src/uml/qumlenumerationliteral.h
+++ b/src/uml/qumlenumerationliteral.h
@@ -60,6 +60,8 @@ public:
explicit QUmlEnumerationLiteral(bool createQObject = true);
virtual ~QUmlEnumerationLiteral();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlEnumeration *classifier() const;
Q_DECL_HIDDEN void setClassifier(QUmlEnumeration *classifier);
diff --git a/src/uml/qumlevent.cpp b/src/uml/qumlevent.cpp
index 5b105e27..96abd8cc 100644
--- a/src/uml/qumlevent.cpp
+++ b/src/uml/qumlevent.cpp
@@ -40,6 +40,15 @@
****************************************************************************/
#include "qumlevent.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlEvent
@@ -55,3 +64,21 @@ QUmlEvent::~QUmlEvent()
{
}
+QModelingObject *QUmlEvent::clone() const
+{
+ QUmlEvent *c = new QUmlEvent;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ return c;
+}
+
diff --git a/src/uml/qumlevent.h b/src/uml/qumlevent.h
index e4ce9884..a328841b 100644
--- a/src/uml/qumlevent.h
+++ b/src/uml/qumlevent.h
@@ -57,6 +57,8 @@ class Q_UML_EXPORT QUmlEvent : public QUmlPackageableElement
public:
virtual ~QUmlEvent();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
protected:
explicit QUmlEvent();
diff --git a/src/uml/qumlexceptionhandler.cpp b/src/uml/qumlexceptionhandler.cpp
index ad60255b..f189089e 100644
--- a/src/uml/qumlexceptionhandler.cpp
+++ b/src/uml/qumlexceptionhandler.cpp
@@ -43,9 +43,10 @@
#include "private/qumlexceptionhandlerobject_p.h"
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlExecutableNode>
#include <QtUml/QUmlObjectNode>
-
/*!
\class QUmlExceptionHandler
@@ -70,13 +71,28 @@ QUmlExceptionHandler::~QUmlExceptionHandler()
}
}
+QModelingObject *QUmlExceptionHandler::clone() const
+{
+ QUmlExceptionHandler *c = new QUmlExceptionHandler;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (exceptionInput())
+ c->setExceptionInput(dynamic_cast<QUmlObjectNode *>(exceptionInput()->clone()));
+ foreach (QUmlClassifier *element, exceptionType())
+ c->addExceptionType(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (handlerBody())
+ c->setHandlerBody(dynamic_cast<QUmlExecutableNode *>(handlerBody()->clone()));
+ if (protectedNode())
+ c->setProtectedNode(dynamic_cast<QUmlExecutableNode *>(protectedNode()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
An object node within the handler body. When the handler catches an exception, the exception token is placed in this node, causing the body to execute.
*/
-QUmlObjectNode *
-QUmlExceptionHandler::exceptionInput() const
+QUmlObjectNode *QUmlExceptionHandler::exceptionInput() const
{
// This is a read-write association end
@@ -97,8 +113,7 @@ void QUmlExceptionHandler::setExceptionInput(QUmlObjectNode *exceptionInput)
/*!
The kind of instances that the handler catches. If an exception occurs whose type is any of the classifiers in the set, the handler catches the exception and executes its body.
*/
-const QSet<QUmlClassifier *>
-QUmlExceptionHandler::exceptionType() const
+const QSet<QUmlClassifier *> QUmlExceptionHandler::exceptionType() const
{
// This is a read-write association end
@@ -128,8 +143,7 @@ void QUmlExceptionHandler::removeExceptionType(QUmlClassifier *exceptionType)
/*!
A node that is executed if the handler satisfies an uncaught exception.
*/
-QUmlExecutableNode *
-QUmlExceptionHandler::handlerBody() const
+QUmlExecutableNode *QUmlExceptionHandler::handlerBody() const
{
// This is a read-write association end
@@ -150,8 +164,7 @@ void QUmlExceptionHandler::setHandlerBody(QUmlExecutableNode *handlerBody)
/*!
The node protected by the handler. The handler is examined if an exception propagates to the outside of the node.
*/
-QUmlExecutableNode *
-QUmlExceptionHandler::protectedNode() const
+QUmlExecutableNode *QUmlExceptionHandler::protectedNode() const
{
// This is a read-write association end
diff --git a/src/uml/qumlexceptionhandler.h b/src/uml/qumlexceptionhandler.h
index 2ffa2ec6..5370863c 100644
--- a/src/uml/qumlexceptionhandler.h
+++ b/src/uml/qumlexceptionhandler.h
@@ -62,6 +62,8 @@ public:
explicit QUmlExceptionHandler(bool createQObject = true);
virtual ~QUmlExceptionHandler();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlObjectNode *exceptionInput() const;
void setExceptionInput(QUmlObjectNode *exceptionInput);
diff --git a/src/uml/qumlexecutablenode.cpp b/src/uml/qumlexecutablenode.cpp
index 2c50b0b4..0a6aa992 100644
--- a/src/uml/qumlexecutablenode.cpp
+++ b/src/uml/qumlexecutablenode.cpp
@@ -40,8 +40,23 @@
****************************************************************************/
#include "qumlexecutablenode.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlExceptionHandler>
-
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlExecutableNode
@@ -57,13 +72,43 @@ QUmlExecutableNode::~QUmlExecutableNode()
{
}
+QModelingObject *QUmlExecutableNode::clone() const
+{
+ QUmlExecutableNode *c = new QUmlExecutableNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
A set of exception handlers that are examined if an uncaught exception propagates to the outer level of the executable node.
*/
-const QSet<QUmlExceptionHandler *>
-QUmlExecutableNode::handler() const
+const QSet<QUmlExceptionHandler *> QUmlExecutableNode::handler() const
{
// This is a read-write association end
diff --git a/src/uml/qumlexecutablenode.h b/src/uml/qumlexecutablenode.h
index 5af049ef..9587cc71 100644
--- a/src/uml/qumlexecutablenode.h
+++ b/src/uml/qumlexecutablenode.h
@@ -59,6 +59,8 @@ class Q_UML_EXPORT QUmlExecutableNode : public QUmlActivityNode
public:
virtual ~QUmlExecutableNode();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlExceptionHandler *> handler() const;
void addHandler(QUmlExceptionHandler *handler);
diff --git a/src/uml/qumlexecutionenvironment.cpp b/src/uml/qumlexecutionenvironment.cpp
index 1e5bcaf6..aee2c5a4 100644
--- a/src/uml/qumlexecutionenvironment.cpp
+++ b/src/uml/qumlexecutionenvironment.cpp
@@ -42,6 +42,44 @@
#include "private/qumlexecutionenvironmentobject_p.h"
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClass>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElement>
+#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlDeployment>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExtension>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlInterfaceRealization>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlNode>
+#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlReception>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlExecutionEnvironment
@@ -64,3 +102,73 @@ QUmlExecutionEnvironment::~QUmlExecutionEnvironment()
}
}
+QModelingObject *QUmlExecutionEnvironment::clone() const
+{
+ QUmlExecutionEnvironment *c = new QUmlExecutionEnvironment;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlConnector *element, ownedConnector())
+ c->addOwnedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setActive(isActive());
+ foreach (QUmlClassifier *element, nestedClassifier())
+ c->addNestedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ foreach (QUmlReception *element, ownedReception())
+ c->addOwnedReception(dynamic_cast<QUmlReception *>(element->clone()));
+ foreach (QUmlDeployment *element, deployment())
+ c->addDeployment(dynamic_cast<QUmlDeployment *>(element->clone()));
+ foreach (QUmlNode *element, nestedNode())
+ c->addNestedNode(dynamic_cast<QUmlNode *>(element->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlexecutionenvironment.h b/src/uml/qumlexecutionenvironment.h
index 2ee3e02e..1b9c813c 100644
--- a/src/uml/qumlexecutionenvironment.h
+++ b/src/uml/qumlexecutionenvironment.h
@@ -58,6 +58,8 @@ public:
explicit QUmlExecutionEnvironment(bool createQObject = true);
virtual ~QUmlExecutionEnvironment();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlexecutionoccurrencespecification.cpp b/src/uml/qumlexecutionoccurrencespecification.cpp
index b7e2d266..d8f2b0ce 100644
--- a/src/uml/qumlexecutionoccurrencespecification.cpp
+++ b/src/uml/qumlexecutionoccurrencespecification.cpp
@@ -42,8 +42,18 @@
#include "private/qumlexecutionoccurrencespecificationobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlExecutionSpecification>
-
+#include <QtUml/QUmlGeneralOrdering>
+#include <QtUml/QUmlInteraction>
+#include <QtUml/QUmlInteractionOperand>
+#include <QtUml/QUmlLifeline>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlExecutionOccurrenceSpecification
@@ -67,13 +77,40 @@ QUmlExecutionOccurrenceSpecification::~QUmlExecutionOccurrenceSpecification()
}
}
+QModelingObject *QUmlExecutionOccurrenceSpecification::clone() const
+{
+ QUmlExecutionOccurrenceSpecification *c = new QUmlExecutionOccurrenceSpecification;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (enclosingInteraction())
+ c->setEnclosingInteraction(dynamic_cast<QUmlInteraction *>(enclosingInteraction()->clone()));
+ if (enclosingOperand())
+ c->setEnclosingOperand(dynamic_cast<QUmlInteractionOperand *>(enclosingOperand()->clone()));
+ foreach (QUmlGeneralOrdering *element, generalOrdering())
+ c->addGeneralOrdering(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ if (covered())
+ c->setCovered(dynamic_cast<QUmlLifeline *>(covered()->clone()));
+ foreach (QUmlGeneralOrdering *element, toAfter())
+ c->addToAfter(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ foreach (QUmlGeneralOrdering *element, toBefore())
+ c->addToBefore(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ if (execution())
+ c->setExecution(dynamic_cast<QUmlExecutionSpecification *>(execution()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the execution specification describing the execution that is started or finished at this execution event.
*/
-QUmlExecutionSpecification *
-QUmlExecutionOccurrenceSpecification::execution() const
+QUmlExecutionSpecification *QUmlExecutionOccurrenceSpecification::execution() const
{
// This is a read-write association end
diff --git a/src/uml/qumlexecutionoccurrencespecification.h b/src/uml/qumlexecutionoccurrencespecification.h
index 9d49a8ac..db49027a 100644
--- a/src/uml/qumlexecutionoccurrencespecification.h
+++ b/src/uml/qumlexecutionoccurrencespecification.h
@@ -60,6 +60,8 @@ public:
explicit QUmlExecutionOccurrenceSpecification(bool createQObject = true);
virtual ~QUmlExecutionOccurrenceSpecification();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlExecutionSpecification *execution() const;
void setExecution(QUmlExecutionSpecification *execution);
diff --git a/src/uml/qumlexecutionspecification.cpp b/src/uml/qumlexecutionspecification.cpp
index 965e73a1..4005a7ec 100644
--- a/src/uml/qumlexecutionspecification.cpp
+++ b/src/uml/qumlexecutionspecification.cpp
@@ -40,8 +40,18 @@
****************************************************************************/
#include "qumlexecutionspecification.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlGeneralOrdering>
+#include <QtUml/QUmlInteraction>
+#include <QtUml/QUmlInteractionOperand>
+#include <QtUml/QUmlLifeline>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOccurrenceSpecification>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlExecutionSpecification
@@ -59,13 +69,38 @@ QUmlExecutionSpecification::~QUmlExecutionSpecification()
{
}
+QModelingObject *QUmlExecutionSpecification::clone() const
+{
+ QUmlExecutionSpecification *c = new QUmlExecutionSpecification;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlLifeline *element, covered())
+ c->addCovered(dynamic_cast<QUmlLifeline *>(element->clone()));
+ if (enclosingInteraction())
+ c->setEnclosingInteraction(dynamic_cast<QUmlInteraction *>(enclosingInteraction()->clone()));
+ if (enclosingOperand())
+ c->setEnclosingOperand(dynamic_cast<QUmlInteractionOperand *>(enclosingOperand()->clone()));
+ foreach (QUmlGeneralOrdering *element, generalOrdering())
+ c->addGeneralOrdering(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ if (finish())
+ c->setFinish(dynamic_cast<QUmlOccurrenceSpecification *>(finish()->clone()));
+ if (start())
+ c->setStart(dynamic_cast<QUmlOccurrenceSpecification *>(start()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the OccurrenceSpecification that designates the finish of the Action or Behavior.
*/
-QUmlOccurrenceSpecification *
-QUmlExecutionSpecification::finish() const
+QUmlOccurrenceSpecification *QUmlExecutionSpecification::finish() const
{
// This is a read-write association end
@@ -86,8 +121,7 @@ void QUmlExecutionSpecification::setFinish(QUmlOccurrenceSpecification *finish)
/*!
References the OccurrenceSpecification that designates the start of the Action or Behavior
*/
-QUmlOccurrenceSpecification *
-QUmlExecutionSpecification::start() const
+QUmlOccurrenceSpecification *QUmlExecutionSpecification::start() const
{
// This is a read-write association end
diff --git a/src/uml/qumlexecutionspecification.h b/src/uml/qumlexecutionspecification.h
index e8ce1ef4..afbf11e1 100644
--- a/src/uml/qumlexecutionspecification.h
+++ b/src/uml/qumlexecutionspecification.h
@@ -59,6 +59,8 @@ class Q_UML_EXPORT QUmlExecutionSpecification : public QUmlInteractionFragment
public:
virtual ~QUmlExecutionSpecification();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QUmlOccurrenceSpecification *finish() const;
void setFinish(QUmlOccurrenceSpecification *finish);
diff --git a/src/uml/qumlexpansionnode.cpp b/src/uml/qumlexpansionnode.cpp
index b2dd8457..b5524ae8 100644
--- a/src/uml/qumlexpansionnode.cpp
+++ b/src/uml/qumlexpansionnode.cpp
@@ -42,8 +42,27 @@
#include "private/qumlexpansionnodeobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlExpansionRegion>
-
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlState>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlExpansionNode
@@ -67,13 +86,55 @@ QUmlExpansionNode::~QUmlExpansionNode()
}
}
+QModelingObject *QUmlExpansionNode::clone() const
+{
+ QUmlExpansionNode *c = new QUmlExpansionNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ foreach (QUmlState *element, inState())
+ c->addInState(dynamic_cast<QUmlState *>(element->clone()));
+ c->setControlType(isControlType());
+ c->setOrdering(ordering());
+ if (selection())
+ c->setSelection(dynamic_cast<QUmlBehavior *>(selection()->clone()));
+ if (upperBound())
+ c->setUpperBound(dynamic_cast<QUmlValueSpecification *>(upperBound()->clone()));
+ if (regionAsInput())
+ c->setRegionAsInput(dynamic_cast<QUmlExpansionRegion *>(regionAsInput()->clone()));
+ if (regionAsOutput())
+ c->setRegionAsOutput(dynamic_cast<QUmlExpansionRegion *>(regionAsOutput()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The expansion region for which the node is an input.
*/
-QUmlExpansionRegion *
-QUmlExpansionNode::regionAsInput() const
+QUmlExpansionRegion *QUmlExpansionNode::regionAsInput() const
{
// This is a read-write association end
@@ -94,8 +155,7 @@ void QUmlExpansionNode::setRegionAsInput(QUmlExpansionRegion *regionAsInput)
/*!
The expansion region for which the node is an output.
*/
-QUmlExpansionRegion *
-QUmlExpansionNode::regionAsOutput() const
+QUmlExpansionRegion *QUmlExpansionNode::regionAsOutput() const
{
// This is a read-write association end
diff --git a/src/uml/qumlexpansionnode.h b/src/uml/qumlexpansionnode.h
index b06cd3d8..4195ad03 100644
--- a/src/uml/qumlexpansionnode.h
+++ b/src/uml/qumlexpansionnode.h
@@ -60,6 +60,8 @@ public:
explicit QUmlExpansionNode(bool createQObject = true);
virtual ~QUmlExpansionNode();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlExpansionRegion *regionAsInput() const;
void setRegionAsInput(QUmlExpansionRegion *regionAsInput);
diff --git a/src/uml/qumlexpansionregion.cpp b/src/uml/qumlexpansionregion.cpp
index 0f7109c4..a6522d62 100644
--- a/src/uml/qumlexpansionregion.cpp
+++ b/src/uml/qumlexpansionregion.cpp
@@ -42,8 +42,31 @@
#include "private/qumlexpansionregionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlExpansionNode>
-
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlVariable>
/*!
\class QUmlExpansionRegion
@@ -67,13 +90,70 @@ QUmlExpansionRegion::~QUmlExpansionRegion()
}
}
+QModelingObject *QUmlExpansionRegion::clone() const
+{
+ QUmlExpansionRegion *c = new QUmlExpansionRegion;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlActivityEdge *element, edge())
+ c->addEdge(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ c->setMustIsolate(mustIsolate());
+ foreach (QUmlActivityNode *element, node())
+ c->addNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlInputPin *element, structuredNodeInput())
+ c->addStructuredNodeInput(dynamic_cast<QUmlInputPin *>(element->clone()));
+ foreach (QUmlOutputPin *element, structuredNodeOutput())
+ c->addStructuredNodeOutput(dynamic_cast<QUmlOutputPin *>(element->clone()));
+ foreach (QUmlVariable *element, variable())
+ c->addVariable(dynamic_cast<QUmlVariable *>(element->clone()));
+ foreach (QUmlExpansionNode *element, inputElement())
+ c->addInputElement(dynamic_cast<QUmlExpansionNode *>(element->clone()));
+ c->setMode(mode());
+ foreach (QUmlExpansionNode *element, outputElement())
+ c->addOutputElement(dynamic_cast<QUmlExpansionNode *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
An object node that holds a separate element of the input collection during each of the multiple executions of the region.
*/
-const QSet<QUmlExpansionNode *>
-QUmlExpansionRegion::inputElement() const
+const QSet<QUmlExpansionNode *> QUmlExpansionRegion::inputElement() const
{
// This is a read-write association end
@@ -113,8 +193,7 @@ void QUmlExpansionRegion::removeInputElement(QUmlExpansionNode *inputElement)
/*!
The way in which the executions interact: parallel: all interactions are independent iterative: the interactions occur in order of the elements stream: a stream of values flows into a single execution
*/
-QtUml::ExpansionKind
-QUmlExpansionRegion::mode() const
+QtUml::ExpansionKind QUmlExpansionRegion::mode() const
{
// This is a read-write property
@@ -133,8 +212,7 @@ void QUmlExpansionRegion::setMode(QtUml::ExpansionKind mode)
/*!
An object node that accepts a separate element of the output collection during each of the multiple executions of the region. The values are formed into a collection that is available when the execution of the region is complete.
*/
-const QSet<QUmlExpansionNode *>
-QUmlExpansionRegion::outputElement() const
+const QSet<QUmlExpansionNode *> QUmlExpansionRegion::outputElement() const
{
// This is a read-write association end
diff --git a/src/uml/qumlexpansionregion.h b/src/uml/qumlexpansionregion.h
index 7dc7f617..124fdc1a 100644
--- a/src/uml/qumlexpansionregion.h
+++ b/src/uml/qumlexpansionregion.h
@@ -62,6 +62,8 @@ public:
explicit QUmlExpansionRegion(bool createQObject = true);
virtual ~QUmlExpansionRegion();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlExpansionNode *> inputElement() const;
void addInputElement(QUmlExpansionNode *inputElement);
diff --git a/src/uml/qumlexpression.cpp b/src/uml/qumlexpression.cpp
index 8fdd8a0c..87463eef 100644
--- a/src/uml/qumlexpression.cpp
+++ b/src/uml/qumlexpression.cpp
@@ -42,6 +42,17 @@
#include "private/qumlexpressionobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlExpression
@@ -63,13 +74,35 @@ QUmlExpression::~QUmlExpression()
}
}
+QModelingObject *QUmlExpression::clone() const
+{
+ QUmlExpression *c = new QUmlExpression;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlValueSpecification *element, operand())
+ c->addOperand(dynamic_cast<QUmlValueSpecification *>(element->clone()));
+ c->setSymbol(symbol());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies a sequence of operands.
*/
-const QList<QUmlValueSpecification *>
-QUmlExpression::operand() const
+const QList<QUmlValueSpecification *> QUmlExpression::operand() const
{
// This is a read-write association end
@@ -108,8 +141,7 @@ void QUmlExpression::removeOperand(QUmlValueSpecification *operand)
/*!
The symbol associated with the node in the expression tree.
*/
-QString
-QUmlExpression::symbol() const
+QString QUmlExpression::symbol() const
{
// This is a read-write property
diff --git a/src/uml/qumlexpression.h b/src/uml/qumlexpression.h
index f59adee2..c600e0c1 100644
--- a/src/uml/qumlexpression.h
+++ b/src/uml/qumlexpression.h
@@ -58,6 +58,8 @@ public:
explicit QUmlExpression(bool createQObject = true);
virtual ~QUmlExpression();
+ QModelingObject *clone() const;
+
// Owned attributes
const QList<QUmlValueSpecification *> operand() const;
void addOperand(QUmlValueSpecification *operand);
diff --git a/src/uml/qumlextend.cpp b/src/uml/qumlextend.cpp
index 605d9486..5b33204c 100644
--- a/src/uml/qumlextend.cpp
+++ b/src/uml/qumlextend.cpp
@@ -42,10 +42,16 @@
#include "private/qumlextendobject_p.h"
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlExtensionPoint>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlUseCase>
-
/*!
\class QUmlExtend
@@ -70,13 +76,34 @@ QUmlExtend::~QUmlExtend()
}
}
+QModelingObject *QUmlExtend::clone() const
+{
+ QUmlExtend *c = new QUmlExtend;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (condition())
+ c->setCondition(dynamic_cast<QUmlConstraint *>(condition()->clone()));
+ if (extendedCase())
+ c->setExtendedCase(dynamic_cast<QUmlUseCase *>(extendedCase()->clone()));
+ if (extension())
+ c->setExtension(dynamic_cast<QUmlUseCase *>(extension()->clone()));
+ foreach (QUmlExtensionPoint *element, extensionLocation())
+ c->addExtensionLocation(dynamic_cast<QUmlExtensionPoint *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the condition that must hold when the first extension point is reached for the extension to take place. If no constraint is associated with the extend relationship, the extension is unconditional.
*/
-QUmlConstraint *
-QUmlExtend::condition() const
+QUmlConstraint *QUmlExtend::condition() const
{
// This is a read-write association end
@@ -106,8 +133,7 @@ void QUmlExtend::setCondition(QUmlConstraint *condition)
/*!
References the use case that is being extended.
*/
-QUmlUseCase *
-QUmlExtend::extendedCase() const
+QUmlUseCase *QUmlExtend::extendedCase() const
{
// This is a read-write association end
@@ -136,8 +162,7 @@ void QUmlExtend::setExtendedCase(QUmlUseCase *extendedCase)
/*!
References the use case that represents the extension and owns the extend relationship.
*/
-QUmlUseCase *
-QUmlExtend::extension() const
+QUmlUseCase *QUmlExtend::extension() const
{
// This is a read-write association end
@@ -167,8 +192,7 @@ void QUmlExtend::setExtension(QUmlUseCase *extension)
/*!
An ordered list of extension points belonging to the extended use case, specifying where the respective behavioral fragments of the extending use case are to be inserted. The first fragment in the extending use case is associated with the first extension point in the list, the second fragment with the second point, and so on. (Note that, in most practical cases, the extending use case has just a single behavior fragment, so that the list of extension points is trivial.)
*/
-const QList<QUmlExtensionPoint *>
-QUmlExtend::extensionLocation() const
+const QList<QUmlExtensionPoint *> QUmlExtend::extensionLocation() const
{
// This is a read-write association end
diff --git a/src/uml/qumlextend.h b/src/uml/qumlextend.h
index 11165338..f5f857a2 100644
--- a/src/uml/qumlextend.h
+++ b/src/uml/qumlextend.h
@@ -63,6 +63,8 @@ public:
explicit QUmlExtend(bool createQObject = true);
virtual ~QUmlExtend();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlConstraint *condition() const;
void setCondition(QUmlConstraint *condition);
diff --git a/src/uml/qumlextension.cpp b/src/uml/qumlextension.cpp
index ddbd91da..c31681a0 100644
--- a/src/uml/qumlextension.cpp
+++ b/src/uml/qumlextension.cpp
@@ -43,9 +43,34 @@
#include "private/qumlextensionobject_p.h"
#include <QtUml/QUmlClass>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
#include <QtUml/QUmlExtensionEnd>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlProperty>
-
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlExtension
@@ -69,13 +94,68 @@ QUmlExtension::~QUmlExtension()
}
}
+QModelingObject *QUmlExtension::clone() const
+{
+ QUmlExtension *c = new QUmlExtension;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ c->setDerived(isDerived());
+ foreach (QUmlProperty *element, memberEnd())
+ c->addMemberEnd(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlProperty *element, navigableOwnedEnd())
+ c->addNavigableOwnedEnd(dynamic_cast<QUmlProperty *>(element->clone()));
+ if (ownedEnd())
+ c->setOwnedEnd(dynamic_cast<QUmlExtensionEnd *>(ownedEnd()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Indicates whether an instance of the extending stereotype must be created when an instance of the extended class is created. The attribute value is derived from the value of the lower property of the ExtensionEnd referenced by Extension::ownedEnd; a lower value of 1 means that isRequired is true, but otherwise it is false. Since the default value of ExtensionEnd::lower is 0, the default value of isRequired is false.
*/
-bool
-QUmlExtension::isRequired() const
+bool QUmlExtension::isRequired() const
{
// This is a read-only derived property
@@ -99,8 +179,7 @@ void QUmlExtension::setRequired(bool isRequired)
/*!
References the Class that is extended through an Extension. The property is derived from the type of the memberEnd that is not the ownedEnd.
*/
-QUmlClass *
-QUmlExtension::metaclass() const
+QUmlClass *QUmlExtension::metaclass() const
{
// This is a read-only derived association end
@@ -124,8 +203,7 @@ void QUmlExtension::setMetaclass(QUmlClass *metaclass)
/*!
References the end of the extension that is typed by a Stereotype.
*/
-QUmlExtensionEnd *
-QUmlExtension::ownedEnd() const
+QUmlExtensionEnd *QUmlExtension::ownedEnd() const
{
// This is a read-write association end
diff --git a/src/uml/qumlextension.h b/src/uml/qumlextension.h
index 26d7ea57..ce45ed8c 100644
--- a/src/uml/qumlextension.h
+++ b/src/uml/qumlextension.h
@@ -62,6 +62,8 @@ public:
explicit QUmlExtension(bool createQObject = true);
virtual ~QUmlExtension();
+ QModelingObject *clone() const;
+
// Owned attributes
bool isRequired() const;
Q_DECL_HIDDEN void setRequired(bool isRequired);
diff --git a/src/uml/qumlextensionend.cpp b/src/uml/qumlextensionend.cpp
index 26386516..c50291b0 100644
--- a/src/uml/qumlextensionend.cpp
+++ b/src/uml/qumlextensionend.cpp
@@ -42,8 +42,30 @@
#include "private/qumlextensionendobject_p.h"
+#include <QtUml/QUmlAssociation>
+#include <QtUml/QUmlClass>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElementTemplateParameter>
+#include <QtUml/QUmlConnectorEnd>
+#include <QtUml/QUmlDataType>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlDeployment>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterface>
+#include <QtUml/QUmlMultiplicityElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlRedefinableElement>
#include <QtUml/QUmlStereotype>
-
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlExtensionEnd
@@ -67,13 +89,67 @@ QUmlExtensionEnd::~QUmlExtensionEnd()
}
}
+QModelingObject *QUmlExtensionEnd::clone() const
+{
+ QUmlExtensionEnd *c = new QUmlExtensionEnd;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setOrdered(isOrdered());
+ c->setUnique(isUnique());
+ if (lowerValue())
+ c->setLowerValue(dynamic_cast<QUmlValueSpecification *>(lowerValue()->clone()));
+ if (upperValue())
+ c->setUpperValue(dynamic_cast<QUmlValueSpecification *>(upperValue()->clone()));
+ c->setLeaf(isLeaf());
+ c->setStatic(isStatic());
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlConnectableElementTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDeployment *element, deployment())
+ c->addDeployment(dynamic_cast<QUmlDeployment *>(element->clone()));
+ c->setAggregation(aggregation());
+ if (association())
+ c->setAssociation(dynamic_cast<QUmlAssociation *>(association()->clone()));
+ if (associationEnd())
+ c->setAssociationEnd(dynamic_cast<QUmlProperty *>(associationEnd()->clone()));
+ if (class_())
+ c->setClass(dynamic_cast<QUmlClass *>(class_()->clone()));
+ if (datatype())
+ c->setDatatype(dynamic_cast<QUmlDataType *>(datatype()->clone()));
+ if (defaultValue())
+ c->setDefaultValue(dynamic_cast<QUmlValueSpecification *>(defaultValue()->clone()));
+ if (interface_())
+ c->setInterface(dynamic_cast<QUmlInterface *>(interface_()->clone()));
+ c->setDerived(isDerived());
+ c->setDerivedUnion(isDerivedUnion());
+ c->setID(isID());
+ c->setReadOnly(isReadOnly());
+ if (owningAssociation())
+ c->setOwningAssociation(dynamic_cast<QUmlAssociation *>(owningAssociation()->clone()));
+ foreach (QUmlProperty *element, qualifier())
+ c->addQualifier(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlProperty *element, redefinedProperty())
+ c->addRedefinedProperty(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlProperty *element, subsettedProperty())
+ c->addSubsettedProperty(dynamic_cast<QUmlProperty *>(element->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlStereotype *>(type()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
This redefinition changes the default multiplicity of association ends, since model elements are usually extended by 0 or 1 instance of the extension stereotype.
*/
-int
-QUmlExtensionEnd::lower() const
+int QUmlExtensionEnd::lower() const
{
// This is a read-write derived property
@@ -97,8 +173,7 @@ void QUmlExtensionEnd::setLower(int lower)
/*!
References the type of the ExtensionEnd. Note that this association restricts the possible types of an ExtensionEnd to only be Stereotypes.
*/
-QUmlStereotype *
-QUmlExtensionEnd::type() const
+QUmlStereotype *QUmlExtensionEnd::type() const
{
// This is a read-write association end
diff --git a/src/uml/qumlextensionend.h b/src/uml/qumlextensionend.h
index 9a60f927..186ef7f4 100644
--- a/src/uml/qumlextensionend.h
+++ b/src/uml/qumlextensionend.h
@@ -60,6 +60,8 @@ public:
explicit QUmlExtensionEnd(bool createQObject = true);
virtual ~QUmlExtensionEnd();
+ QModelingObject *clone() const;
+
// Owned attributes
int lower() const;
void setLower(int lower);
diff --git a/src/uml/qumlextensionpoint.cpp b/src/uml/qumlextensionpoint.cpp
index d1dea8b1..a75a2137 100644
--- a/src/uml/qumlextensionpoint.cpp
+++ b/src/uml/qumlextensionpoint.cpp
@@ -42,8 +42,16 @@
#include "private/qumlextensionpointobject_p.h"
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlUseCase>
-
/*!
\class QUmlExtensionPoint
@@ -66,13 +74,29 @@ QUmlExtensionPoint::~QUmlExtensionPoint()
}
}
+QModelingObject *QUmlExtensionPoint::clone() const
+{
+ QUmlExtensionPoint *c = new QUmlExtensionPoint;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (useCase())
+ c->setUseCase(dynamic_cast<QUmlUseCase *>(useCase()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the use case that owns this extension point.
*/
-QUmlUseCase *
-QUmlExtensionPoint::useCase() const
+QUmlUseCase *QUmlExtensionPoint::useCase() const
{
// This is a read-write association end
diff --git a/src/uml/qumlextensionpoint.h b/src/uml/qumlextensionpoint.h
index adf190fa..f30d03a5 100644
--- a/src/uml/qumlextensionpoint.h
+++ b/src/uml/qumlextensionpoint.h
@@ -60,6 +60,8 @@ public:
explicit QUmlExtensionPoint(bool createQObject = true);
virtual ~QUmlExtensionPoint();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlUseCase *useCase() const;
void setUseCase(QUmlUseCase *useCase);
diff --git a/src/uml/qumlfeature.cpp b/src/uml/qumlfeature.cpp
index d43f2a5d..e429a36f 100644
--- a/src/uml/qumlfeature.cpp
+++ b/src/uml/qumlfeature.cpp
@@ -41,7 +41,14 @@
#include "qumlfeature.h"
#include <QtUml/QUmlClassifier>
-
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlFeature
@@ -58,13 +65,28 @@ QUmlFeature::~QUmlFeature()
{
}
+QModelingObject *QUmlFeature::clone() const
+{
+ QUmlFeature *c = new QUmlFeature;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ c->setStatic(isStatic());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The Classifiers that have this Feature as a feature.
*/
-const QSet<QUmlClassifier *>
-QUmlFeature::featuringClassifier() const
+const QSet<QUmlClassifier *> QUmlFeature::featuringClassifier() const
{
// This is a read-only derived union association end
@@ -104,8 +126,7 @@ void QUmlFeature::removeFeaturingClassifier(QUmlClassifier *featuringClassifier)
/*!
Specifies whether this feature characterizes individual instances classified by the classifier (false) or the classifier itself (true).
*/
-bool
-QUmlFeature::isStatic() const
+bool QUmlFeature::isStatic() const
{
// This is a read-write property
diff --git a/src/uml/qumlfeature.h b/src/uml/qumlfeature.h
index b98c9947..d73f8d4f 100644
--- a/src/uml/qumlfeature.h
+++ b/src/uml/qumlfeature.h
@@ -59,6 +59,8 @@ class Q_UML_EXPORT QUmlFeature : public QUmlRedefinableElement
public:
virtual ~QUmlFeature();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlClassifier *> featuringClassifier() const;
Q_DECL_HIDDEN void addFeaturingClassifier(QUmlClassifier *featuringClassifier);
diff --git a/src/uml/qumlfinalnode.cpp b/src/uml/qumlfinalnode.cpp
index da781a70..12697ae9 100644
--- a/src/uml/qumlfinalnode.cpp
+++ b/src/uml/qumlfinalnode.cpp
@@ -40,6 +40,22 @@
****************************************************************************/
#include "qumlfinalnode.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlFinalNode
@@ -55,3 +71,32 @@ QUmlFinalNode::~QUmlFinalNode()
{
}
+QModelingObject *QUmlFinalNode::clone() const
+{
+ QUmlFinalNode *c = new QUmlFinalNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlfinalnode.h b/src/uml/qumlfinalnode.h
index e71466eb..51256d3c 100644
--- a/src/uml/qumlfinalnode.h
+++ b/src/uml/qumlfinalnode.h
@@ -57,6 +57,8 @@ class Q_UML_EXPORT QUmlFinalNode : public QUmlControlNode
public:
virtual ~QUmlFinalNode();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
protected:
explicit QUmlFinalNode();
diff --git a/src/uml/qumlfinalstate.cpp b/src/uml/qumlfinalstate.cpp
index e9ee211f..1779c982 100644
--- a/src/uml/qumlfinalstate.cpp
+++ b/src/uml/qumlfinalstate.cpp
@@ -42,6 +42,27 @@
#include "private/qumlfinalstateobject_p.h"
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectionPointReference>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlPseudostate>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRegion>
+#include <QtUml/QUmlState>
+#include <QtUml/QUmlStateMachine>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTransition>
+#include <QtUml/QUmlTrigger>
/*!
\class QUmlFinalState
@@ -64,3 +85,46 @@ QUmlFinalState::~QUmlFinalState()
}
}
+QModelingObject *QUmlFinalState::clone() const
+{
+ QUmlFinalState *c = new QUmlFinalState;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ c->setLeaf(isLeaf());
+ if (container())
+ c->setContainer(dynamic_cast<QUmlRegion *>(container()->clone()));
+ foreach (QUmlConnectionPointReference *element, connection())
+ c->addConnection(dynamic_cast<QUmlConnectionPointReference *>(element->clone()));
+ foreach (QUmlPseudostate *element, connectionPoint())
+ c->addConnectionPoint(dynamic_cast<QUmlPseudostate *>(element->clone()));
+ foreach (QUmlTrigger *element, deferrableTrigger())
+ c->addDeferrableTrigger(dynamic_cast<QUmlTrigger *>(element->clone()));
+ if (doActivity())
+ c->setDoActivity(dynamic_cast<QUmlBehavior *>(doActivity()->clone()));
+ if (entry())
+ c->setEntry(dynamic_cast<QUmlBehavior *>(entry()->clone()));
+ if (exit())
+ c->setExit(dynamic_cast<QUmlBehavior *>(exit()->clone()));
+ if (redefinedState())
+ c->setRedefinedState(dynamic_cast<QUmlState *>(redefinedState()->clone()));
+ foreach (QUmlRegion *element, region())
+ c->addRegion(dynamic_cast<QUmlRegion *>(element->clone()));
+ if (stateInvariant())
+ c->setStateInvariant(dynamic_cast<QUmlConstraint *>(stateInvariant()->clone()));
+ if (submachine())
+ c->setSubmachine(dynamic_cast<QUmlStateMachine *>(submachine()->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlfinalstate.h b/src/uml/qumlfinalstate.h
index 9eb5c1a2..787488af 100644
--- a/src/uml/qumlfinalstate.h
+++ b/src/uml/qumlfinalstate.h
@@ -58,6 +58,8 @@ public:
explicit QUmlFinalState(bool createQObject = true);
virtual ~QUmlFinalState();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlflowfinalnode.cpp b/src/uml/qumlflowfinalnode.cpp
index 11967912..1fbbccda 100644
--- a/src/uml/qumlflowfinalnode.cpp
+++ b/src/uml/qumlflowfinalnode.cpp
@@ -42,6 +42,22 @@
#include "private/qumlflowfinalnodeobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlFlowFinalNode
@@ -63,3 +79,32 @@ QUmlFlowFinalNode::~QUmlFlowFinalNode()
}
}
+QModelingObject *QUmlFlowFinalNode::clone() const
+{
+ QUmlFlowFinalNode *c = new QUmlFlowFinalNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlflowfinalnode.h b/src/uml/qumlflowfinalnode.h
index 8d9c9e96..0a93b9e2 100644
--- a/src/uml/qumlflowfinalnode.h
+++ b/src/uml/qumlflowfinalnode.h
@@ -58,6 +58,8 @@ public:
explicit QUmlFlowFinalNode(bool createQObject = true);
virtual ~QUmlFlowFinalNode();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlforknode.cpp b/src/uml/qumlforknode.cpp
index 87627bdb..6a171a78 100644
--- a/src/uml/qumlforknode.cpp
+++ b/src/uml/qumlforknode.cpp
@@ -42,6 +42,22 @@
#include "private/qumlforknodeobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlForkNode
@@ -63,3 +79,32 @@ QUmlForkNode::~QUmlForkNode()
}
}
+QModelingObject *QUmlForkNode::clone() const
+{
+ QUmlForkNode *c = new QUmlForkNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlforknode.h b/src/uml/qumlforknode.h
index 94a50a09..e17cdcaf 100644
--- a/src/uml/qumlforknode.h
+++ b/src/uml/qumlforknode.h
@@ -58,6 +58,8 @@ public:
explicit QUmlForkNode(bool createQObject = true);
virtual ~QUmlForkNode();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlfunctionbehavior.cpp b/src/uml/qumlfunctionbehavior.cpp
index 10ef995b..2355362a 100644
--- a/src/uml/qumlfunctionbehavior.cpp
+++ b/src/uml/qumlfunctionbehavior.cpp
@@ -42,6 +42,46 @@
#include "private/qumlfunctionbehaviorobject_p.h"
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlBehavioralFeature>
+#include <QtUml/QUmlBehavioredClassifier>
+#include <QtUml/QUmlClass>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElement>
+#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExtension>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlInterfaceRealization>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameter>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlParameterSet>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlReception>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlFunctionBehavior
@@ -64,3 +104,84 @@ QUmlFunctionBehavior::~QUmlFunctionBehavior()
}
}
+QModelingObject *QUmlFunctionBehavior::clone() const
+{
+ QUmlFunctionBehavior *c = new QUmlFunctionBehavior;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlConnector *element, ownedConnector())
+ c->addOwnedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setActive(isActive());
+ foreach (QUmlClassifier *element, nestedClassifier())
+ c->addNestedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ foreach (QUmlReception *element, ownedReception())
+ c->addOwnedReception(dynamic_cast<QUmlReception *>(element->clone()));
+ c->setReentrant(isReentrant());
+ foreach (QUmlParameter *element, ownedParameter())
+ c->addOwnedParameter(dynamic_cast<QUmlParameter *>(element->clone()));
+ foreach (QUmlParameterSet *element, ownedParameterSet())
+ c->addOwnedParameterSet(dynamic_cast<QUmlParameterSet *>(element->clone()));
+ foreach (QUmlConstraint *element, postcondition())
+ c->addPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, precondition())
+ c->addPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlBehavior *element, redefinedBehavior())
+ c->addRedefinedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ if (specification())
+ c->setSpecification(dynamic_cast<QUmlBehavioralFeature *>(specification()->clone()));
+// c->setBody(body());
+// c->setLanguage(language());
+ return c;
+}
+
diff --git a/src/uml/qumlfunctionbehavior.h b/src/uml/qumlfunctionbehavior.h
index fce9a079..f77c5b46 100644
--- a/src/uml/qumlfunctionbehavior.h
+++ b/src/uml/qumlfunctionbehavior.h
@@ -58,6 +58,8 @@ public:
explicit QUmlFunctionBehavior(bool createQObject = true);
virtual ~QUmlFunctionBehavior();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlgate.cpp b/src/uml/qumlgate.cpp
index 94e38d76..d1a9f9d2 100644
--- a/src/uml/qumlgate.cpp
+++ b/src/uml/qumlgate.cpp
@@ -42,6 +42,14 @@
#include "private/qumlgateobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlMessage>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlGate
@@ -63,3 +71,19 @@ QUmlGate::~QUmlGate()
}
}
+QModelingObject *QUmlGate::clone() const
+{
+ QUmlGate *c = new QUmlGate;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (message())
+ c->setMessage(dynamic_cast<QUmlMessage *>(message()->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlgate.h b/src/uml/qumlgate.h
index 51ce07e4..74275010 100644
--- a/src/uml/qumlgate.h
+++ b/src/uml/qumlgate.h
@@ -58,6 +58,8 @@ public:
explicit QUmlGate(bool createQObject = true);
virtual ~QUmlGate();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlgeneralization.cpp b/src/uml/qumlgeneralization.cpp
index 0674bfd0..a4c8a03c 100644
--- a/src/uml/qumlgeneralization.cpp
+++ b/src/uml/qumlgeneralization.cpp
@@ -43,8 +43,9 @@
#include "private/qumlgeneralizationobject_p.h"
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlGeneralizationSet>
-
/*!
\class QUmlGeneralization
@@ -69,13 +70,27 @@ QUmlGeneralization::~QUmlGeneralization()
}
}
+QModelingObject *QUmlGeneralization::clone() const
+{
+ QUmlGeneralization *c = new QUmlGeneralization;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (general())
+ c->setGeneral(dynamic_cast<QUmlClassifier *>(general()->clone()));
+ foreach (QUmlGeneralizationSet *element, generalizationSet())
+ c->addGeneralizationSet(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ c->setSubstitutable(isSubstitutable());
+ if (specific())
+ c->setSpecific(dynamic_cast<QUmlClassifier *>(specific()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the general classifier in the Generalization relationship.
*/
-QUmlClassifier *
-QUmlGeneralization::general() const
+QUmlClassifier *QUmlGeneralization::general() const
{
// This is a read-write association end
@@ -104,8 +119,7 @@ void QUmlGeneralization::setGeneral(QUmlClassifier *general)
/*!
Designates a set in which instances of Generalization is considered members.
*/
-const QSet<QUmlGeneralizationSet *>
-QUmlGeneralization::generalizationSet() const
+const QSet<QUmlGeneralizationSet *> QUmlGeneralization::generalizationSet() const
{
// This is a read-write association end
@@ -145,8 +159,7 @@ void QUmlGeneralization::removeGeneralizationSet(QUmlGeneralizationSet *generali
/*!
Indicates whether the specific classifier can be used wherever the general classifier can be used. If true, the execution traces of the specific classifier will be a superset of the execution traces of the general classifier.
*/
-bool
-QUmlGeneralization::isSubstitutable() const
+bool QUmlGeneralization::isSubstitutable() const
{
// This is a read-write property
@@ -165,8 +178,7 @@ void QUmlGeneralization::setSubstitutable(bool isSubstitutable)
/*!
References the specializing classifier in the Generalization relationship.
*/
-QUmlClassifier *
-QUmlGeneralization::specific() const
+QUmlClassifier *QUmlGeneralization::specific() const
{
// This is a read-write association end
diff --git a/src/uml/qumlgeneralization.h b/src/uml/qumlgeneralization.h
index 1fe36aee..628ef5f3 100644
--- a/src/uml/qumlgeneralization.h
+++ b/src/uml/qumlgeneralization.h
@@ -61,6 +61,8 @@ public:
explicit QUmlGeneralization(bool createQObject = true);
virtual ~QUmlGeneralization();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlClassifier *general() const;
void setGeneral(QUmlClassifier *general);
diff --git a/src/uml/qumlgeneralizationset.cpp b/src/uml/qumlgeneralizationset.cpp
index fc51e6ff..6782ab01 100644
--- a/src/uml/qumlgeneralizationset.cpp
+++ b/src/uml/qumlgeneralizationset.cpp
@@ -43,8 +43,16 @@
#include "private/qumlgeneralizationsetobject_p.h"
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlGeneralization>
-
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlGeneralizationSet
@@ -69,13 +77,36 @@ QUmlGeneralizationSet::~QUmlGeneralizationSet()
}
}
+QModelingObject *QUmlGeneralizationSet::clone() const
+{
+ QUmlGeneralizationSet *c = new QUmlGeneralizationSet;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setCovering(isCovering());
+ c->setDisjoint(isDisjoint());
+ if (powertype())
+ c->setPowertype(dynamic_cast<QUmlClassifier *>(powertype()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Designates the instances of Generalization which are members of a given GeneralizationSet.
*/
-const QSet<QUmlGeneralization *>
-QUmlGeneralizationSet::generalization() const
+const QSet<QUmlGeneralization *> QUmlGeneralizationSet::generalization() const
{
// This is a read-write association end
@@ -115,8 +146,7 @@ void QUmlGeneralizationSet::removeGeneralization(QUmlGeneralization *generalizat
/*!
Indicates (via the associated Generalizations) whether or not the set of specific Classifiers are covering for a particular general classifier. When isCovering is true, every instance of a particular general Classifier is also an instance of at least one of its specific Classifiers for the GeneralizationSet. When isCovering is false, there are one or more instances of the particular general Classifier that are not instances of at least one of its specific Classifiers defined for the GeneralizationSet.
*/
-bool
-QUmlGeneralizationSet::isCovering() const
+bool QUmlGeneralizationSet::isCovering() const
{
// This is a read-write property
@@ -135,8 +165,7 @@ void QUmlGeneralizationSet::setCovering(bool isCovering)
/*!
Indicates whether or not the set of specific Classifiers in a Generalization relationship have instance in common. If isDisjoint is true, the specific Classifiers for a particular GeneralizationSet have no members in common; that is, their intersection is empty. If isDisjoint is false, the specific Classifiers in a particular GeneralizationSet have one or more members in common; that is, their intersection is not empty. For example, Person could have two Generalization relationships, each with the different specific Classifier: Manager or Staff. This would be disjoint because every instance of Person must either be a Manager or Staff. In contrast, Person could have two Generalization relationships involving two specific (and non-covering) Classifiers: Sales Person and Manager. This GeneralizationSet would not be disjoint because there are instances of Person which can be a Sales Person and a Manager.
*/
-bool
-QUmlGeneralizationSet::isDisjoint() const
+bool QUmlGeneralizationSet::isDisjoint() const
{
// This is a read-write property
@@ -155,8 +184,7 @@ void QUmlGeneralizationSet::setDisjoint(bool isDisjoint)
/*!
Designates the Classifier that is defined as the power type for the associated GeneralizationSet.
*/
-QUmlClassifier *
-QUmlGeneralizationSet::powertype() const
+QUmlClassifier *QUmlGeneralizationSet::powertype() const
{
// This is a read-write association end
diff --git a/src/uml/qumlgeneralizationset.h b/src/uml/qumlgeneralizationset.h
index efdf6a88..8a7b5764 100644
--- a/src/uml/qumlgeneralizationset.h
+++ b/src/uml/qumlgeneralizationset.h
@@ -61,6 +61,8 @@ public:
explicit QUmlGeneralizationSet(bool createQObject = true);
virtual ~QUmlGeneralizationSet();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlGeneralization *> generalization() const;
void addGeneralization(QUmlGeneralization *generalization);
diff --git a/src/uml/qumlgeneralordering.cpp b/src/uml/qumlgeneralordering.cpp
index 80132d45..3250bab8 100644
--- a/src/uml/qumlgeneralordering.cpp
+++ b/src/uml/qumlgeneralordering.cpp
@@ -42,8 +42,14 @@
#include "private/qumlgeneralorderingobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOccurrenceSpecification>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlGeneralOrdering
@@ -67,13 +73,30 @@ QUmlGeneralOrdering::~QUmlGeneralOrdering()
}
}
+QModelingObject *QUmlGeneralOrdering::clone() const
+{
+ QUmlGeneralOrdering *c = new QUmlGeneralOrdering;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (after())
+ c->setAfter(dynamic_cast<QUmlOccurrenceSpecification *>(after()->clone()));
+ if (before())
+ c->setBefore(dynamic_cast<QUmlOccurrenceSpecification *>(before()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The OccurrenceSpecification referenced comes after the OccurrenceSpecification referenced by before.
*/
-QUmlOccurrenceSpecification *
-QUmlGeneralOrdering::after() const
+QUmlOccurrenceSpecification *QUmlGeneralOrdering::after() const
{
// This is a read-write association end
@@ -94,8 +117,7 @@ void QUmlGeneralOrdering::setAfter(QUmlOccurrenceSpecification *after)
/*!
The OccurrenceSpecification referenced comes before the OccurrenceSpecification referenced by after.
*/
-QUmlOccurrenceSpecification *
-QUmlGeneralOrdering::before() const
+QUmlOccurrenceSpecification *QUmlGeneralOrdering::before() const
{
// This is a read-write association end
diff --git a/src/uml/qumlgeneralordering.h b/src/uml/qumlgeneralordering.h
index f3fc4bda..9592f943 100644
--- a/src/uml/qumlgeneralordering.h
+++ b/src/uml/qumlgeneralordering.h
@@ -60,6 +60,8 @@ public:
explicit QUmlGeneralOrdering(bool createQObject = true);
virtual ~QUmlGeneralOrdering();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlOccurrenceSpecification *after() const;
void setAfter(QUmlOccurrenceSpecification *after);
diff --git a/src/uml/qumlimage.cpp b/src/uml/qumlimage.cpp
index 10456ba8..d4cc594a 100644
--- a/src/uml/qumlimage.cpp
+++ b/src/uml/qumlimage.cpp
@@ -42,6 +42,8 @@
#include "private/qumlimageobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
/*!
\class QUmlImage
@@ -63,13 +65,23 @@ QUmlImage::~QUmlImage()
}
}
+QModelingObject *QUmlImage::clone() const
+{
+ QUmlImage *c = new QUmlImage;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ c->setContent(content());
+ c->setFormat(format());
+ c->setLocation(location());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
This contains the serialization of the image according to the format. The value could represent a bitmap, image such as a GIF file, or drawing 'instructions' using a standard such as Scalable Vector Graphic (SVG) (which is XML based).
*/
-QString
-QUmlImage::content() const
+QString QUmlImage::content() const
{
// This is a read-write property
@@ -88,8 +100,7 @@ void QUmlImage::setContent(QString content)
/*!
This indicates the format of the content - which is how the string content should be interpreted. The following values are reserved: SVG, GIF, PNG, JPG, WMF, EMF, BMP. In addition the prefix 'MIME: ' is also reserved. This option can be used as an alternative to express the reserved values above, for example "SVG" could instead be expressed as "MIME: image/svg+xml".
*/
-QString
-QUmlImage::format() const
+QString QUmlImage::format() const
{
// This is a read-write property
@@ -108,8 +119,7 @@ void QUmlImage::setFormat(QString format)
/*!
This contains a location that can be used by a tool to locate the image as an alternative to embedding it in the stereotype.
*/
-QString
-QUmlImage::location() const
+QString QUmlImage::location() const
{
// This is a read-write property
diff --git a/src/uml/qumlimage.h b/src/uml/qumlimage.h
index 3bc5155f..54cb3e24 100644
--- a/src/uml/qumlimage.h
+++ b/src/uml/qumlimage.h
@@ -58,6 +58,8 @@ public:
explicit QUmlImage(bool createQObject = true);
virtual ~QUmlImage();
+ QModelingObject *clone() const;
+
// Owned attributes
QString content() const;
void setContent(QString content);
diff --git a/src/uml/qumlinclude.cpp b/src/uml/qumlinclude.cpp
index c0cba095..f26ed7a6 100644
--- a/src/uml/qumlinclude.cpp
+++ b/src/uml/qumlinclude.cpp
@@ -42,8 +42,14 @@
#include "private/qumlincludeobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlUseCase>
-
/*!
\class QUmlInclude
@@ -67,13 +73,30 @@ QUmlInclude::~QUmlInclude()
}
}
+QModelingObject *QUmlInclude::clone() const
+{
+ QUmlInclude *c = new QUmlInclude;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (addition())
+ c->setAddition(dynamic_cast<QUmlUseCase *>(addition()->clone()));
+ if (includingCase())
+ c->setIncludingCase(dynamic_cast<QUmlUseCase *>(includingCase()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the use case that is to be included.
*/
-QUmlUseCase *
-QUmlInclude::addition() const
+QUmlUseCase *QUmlInclude::addition() const
{
// This is a read-write association end
@@ -102,8 +125,7 @@ void QUmlInclude::setAddition(QUmlUseCase *addition)
/*!
References the use case which will include the addition and owns the include relationship.
*/
-QUmlUseCase *
-QUmlInclude::includingCase() const
+QUmlUseCase *QUmlInclude::includingCase() const
{
// This is a read-write association end
diff --git a/src/uml/qumlinclude.h b/src/uml/qumlinclude.h
index fcdd813d..efdec84f 100644
--- a/src/uml/qumlinclude.h
+++ b/src/uml/qumlinclude.h
@@ -61,6 +61,8 @@ public:
explicit QUmlInclude(bool createQObject = true);
virtual ~QUmlInclude();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlUseCase *addition() const;
void setAddition(QUmlUseCase *addition);
diff --git a/src/uml/qumlinformationflow.cpp b/src/uml/qumlinformationflow.cpp
index 08162e48..bccdf2c2 100644
--- a/src/uml/qumlinformationflow.cpp
+++ b/src/uml/qumlinformationflow.cpp
@@ -44,11 +44,18 @@
#include <QtUml/QUmlActivityEdge>
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlMessage>
#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlRelationship>
-
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlInformationFlow
@@ -70,13 +77,44 @@ QUmlInformationFlow::~QUmlInformationFlow()
}
}
+QModelingObject *QUmlInformationFlow::clone() const
+{
+ QUmlInformationFlow *c = new QUmlInformationFlow;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlClassifier *element, conveyed())
+ c->addConveyed(dynamic_cast<QUmlClassifier *>(element->clone()));
+ foreach (QUmlNamedElement *element, informationSource())
+ c->addInformationSource(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ foreach (QUmlNamedElement *element, informationTarget())
+ c->addInformationTarget(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ foreach (QUmlRelationship *element, realization())
+ c->addRealization(dynamic_cast<QUmlRelationship *>(element->clone()));
+ foreach (QUmlActivityEdge *element, realizingActivityEdge())
+ c->addRealizingActivityEdge(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlConnector *element, realizingConnector())
+ c->addRealizingConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ foreach (QUmlMessage *element, realizingMessage())
+ c->addRealizingMessage(dynamic_cast<QUmlMessage *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies the information items that may circulate on this information flow.
*/
-const QSet<QUmlClassifier *>
-QUmlInformationFlow::conveyed() const
+const QSet<QUmlClassifier *> QUmlInformationFlow::conveyed() const
{
// This is a read-write association end
@@ -106,8 +144,7 @@ void QUmlInformationFlow::removeConveyed(QUmlClassifier *conveyed)
/*!
Defines from which source the conveyed InformationItems are initiated.
*/
-const QSet<QUmlNamedElement *>
-QUmlInformationFlow::informationSource() const
+const QSet<QUmlNamedElement *> QUmlInformationFlow::informationSource() const
{
// This is a read-write association end
@@ -143,8 +180,7 @@ void QUmlInformationFlow::removeInformationSource(QUmlNamedElement *informationS
/*!
Defines to which target the conveyed InformationItems are directed.
*/
-const QSet<QUmlNamedElement *>
-QUmlInformationFlow::informationTarget() const
+const QSet<QUmlNamedElement *> QUmlInformationFlow::informationTarget() const
{
// This is a read-write association end
@@ -180,8 +216,7 @@ void QUmlInformationFlow::removeInformationTarget(QUmlNamedElement *informationT
/*!
Determines which Relationship will realize the specified flow
*/
-const QSet<QUmlRelationship *>
-QUmlInformationFlow::realization() const
+const QSet<QUmlRelationship *> QUmlInformationFlow::realization() const
{
// This is a read-write association end
@@ -211,8 +246,7 @@ void QUmlInformationFlow::removeRealization(QUmlRelationship *realization)
/*!
Determines which ActivityEdges will realize the specified flow.
*/
-const QSet<QUmlActivityEdge *>
-QUmlInformationFlow::realizingActivityEdge() const
+const QSet<QUmlActivityEdge *> QUmlInformationFlow::realizingActivityEdge() const
{
// This is a read-write association end
@@ -242,8 +276,7 @@ void QUmlInformationFlow::removeRealizingActivityEdge(QUmlActivityEdge *realizin
/*!
Determines which Connectors will realize the specified flow.
*/
-const QSet<QUmlConnector *>
-QUmlInformationFlow::realizingConnector() const
+const QSet<QUmlConnector *> QUmlInformationFlow::realizingConnector() const
{
// This is a read-write association end
@@ -273,8 +306,7 @@ void QUmlInformationFlow::removeRealizingConnector(QUmlConnector *realizingConne
/*!
Determines which Messages will realize the specified flow.
*/
-const QSet<QUmlMessage *>
-QUmlInformationFlow::realizingMessage() const
+const QSet<QUmlMessage *> QUmlInformationFlow::realizingMessage() const
{
// This is a read-write association end
diff --git a/src/uml/qumlinformationflow.h b/src/uml/qumlinformationflow.h
index 53782212..90f8785e 100644
--- a/src/uml/qumlinformationflow.h
+++ b/src/uml/qumlinformationflow.h
@@ -66,6 +66,8 @@ public:
explicit QUmlInformationFlow(bool createQObject = true);
virtual ~QUmlInformationFlow();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlClassifier *> conveyed() const;
void addConveyed(QUmlClassifier *conveyed);
diff --git a/src/uml/qumlinformationitem.cpp b/src/uml/qumlinformationitem.cpp
index 51ea5463..d78d17a8 100644
--- a/src/uml/qumlinformationitem.cpp
+++ b/src/uml/qumlinformationitem.cpp
@@ -42,6 +42,33 @@
#include "private/qumlinformationitemobject_p.h"
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlInformationItem
@@ -63,13 +90,63 @@ QUmlInformationItem::~QUmlInformationItem()
}
}
+QModelingObject *QUmlInformationItem::clone() const
+{
+ QUmlInformationItem *c = new QUmlInformationItem;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlClassifier *element, represented())
+ c->addRepresented(dynamic_cast<QUmlClassifier *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Determines the classifiers that will specify the structure and nature of the information. An information item represents all its represented classifiers.
*/
-const QSet<QUmlClassifier *>
-QUmlInformationItem::represented() const
+const QSet<QUmlClassifier *> QUmlInformationItem::represented() const
{
// This is a read-write association end
diff --git a/src/uml/qumlinformationitem.h b/src/uml/qumlinformationitem.h
index eb6352c1..ff68ef19 100644
--- a/src/uml/qumlinformationitem.h
+++ b/src/uml/qumlinformationitem.h
@@ -58,6 +58,8 @@ public:
explicit QUmlInformationItem(bool createQObject = true);
virtual ~QUmlInformationItem();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlClassifier *> represented() const;
void addRepresented(QUmlClassifier *represented);
diff --git a/src/uml/qumlinitialnode.cpp b/src/uml/qumlinitialnode.cpp
index 7d1d0fc5..0e11f6ed 100644
--- a/src/uml/qumlinitialnode.cpp
+++ b/src/uml/qumlinitialnode.cpp
@@ -42,6 +42,22 @@
#include "private/qumlinitialnodeobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlInitialNode
@@ -63,3 +79,32 @@ QUmlInitialNode::~QUmlInitialNode()
}
}
+QModelingObject *QUmlInitialNode::clone() const
+{
+ QUmlInitialNode *c = new QUmlInitialNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlinitialnode.h b/src/uml/qumlinitialnode.h
index 0d113261..a24835d8 100644
--- a/src/uml/qumlinitialnode.h
+++ b/src/uml/qumlinitialnode.h
@@ -58,6 +58,8 @@ public:
explicit QUmlInitialNode(bool createQObject = true);
virtual ~QUmlInitialNode();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlinputpin.cpp b/src/uml/qumlinputpin.cpp
index 10b9ce37..c9c2033b 100644
--- a/src/uml/qumlinputpin.cpp
+++ b/src/uml/qumlinputpin.cpp
@@ -42,6 +42,27 @@
#include "private/qumlinputpinobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlMultiplicityElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlState>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlInputPin
@@ -63,3 +84,49 @@ QUmlInputPin::~QUmlInputPin()
}
}
+QModelingObject *QUmlInputPin::clone() const
+{
+ QUmlInputPin *c = new QUmlInputPin;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ c->setOrdered(isOrdered());
+ c->setUnique(isUnique());
+ if (lowerValue())
+ c->setLowerValue(dynamic_cast<QUmlValueSpecification *>(lowerValue()->clone()));
+ if (upperValue())
+ c->setUpperValue(dynamic_cast<QUmlValueSpecification *>(upperValue()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ foreach (QUmlState *element, inState())
+ c->addInState(dynamic_cast<QUmlState *>(element->clone()));
+ c->setControlType(isControlType());
+ c->setOrdering(ordering());
+ if (selection())
+ c->setSelection(dynamic_cast<QUmlBehavior *>(selection()->clone()));
+ if (upperBound())
+ c->setUpperBound(dynamic_cast<QUmlValueSpecification *>(upperBound()->clone()));
+ c->setControl(isControl());
+ return c;
+}
+
diff --git a/src/uml/qumlinputpin.h b/src/uml/qumlinputpin.h
index 50d91403..60767e14 100644
--- a/src/uml/qumlinputpin.h
+++ b/src/uml/qumlinputpin.h
@@ -58,6 +58,8 @@ public:
explicit QUmlInputPin(bool createQObject = true);
virtual ~QUmlInputPin();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlinstancespecification.cpp b/src/uml/qumlinstancespecification.cpp
index 41b8323d..6b433ef9 100644
--- a/src/uml/qumlinstancespecification.cpp
+++ b/src/uml/qumlinstancespecification.cpp
@@ -43,9 +43,19 @@
#include "private/qumlinstancespecificationobject_p.h"
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlDeployment>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlSlot>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
#include <QtUml/QUmlValueSpecification>
-
/*!
\class QUmlInstanceSpecification
@@ -68,13 +78,38 @@ QUmlInstanceSpecification::~QUmlInstanceSpecification()
}
}
+QModelingObject *QUmlInstanceSpecification::clone() const
+{
+ QUmlInstanceSpecification *c = new QUmlInstanceSpecification;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlDeployment *element, deployment())
+ c->addDeployment(dynamic_cast<QUmlDeployment *>(element->clone()));
+ foreach (QUmlClassifier *element, classifier())
+ c->addClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ foreach (QUmlSlot *element, slot_())
+ c->addSlot(dynamic_cast<QUmlSlot *>(element->clone()));
+ if (specification())
+ c->setSpecification(dynamic_cast<QUmlValueSpecification *>(specification()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The classifier or classifiers of the represented instance. If multiple classifiers are specified, the instance is classified by all of them.
*/
-const QSet<QUmlClassifier *>
-QUmlInstanceSpecification::classifier() const
+const QSet<QUmlClassifier *> QUmlInstanceSpecification::classifier() const
{
// This is a read-write association end
@@ -104,8 +139,7 @@ void QUmlInstanceSpecification::removeClassifier(QUmlClassifier *classifier)
/*!
A slot giving the value or values of a structural feature of the instance. An instance specification can have one slot per structural feature of its classifiers, including inherited features. It is not necessary to model a slot for each structural feature, in which case the instance specification is a partial description.
*/
-const QSet<QUmlSlot *>
-QUmlInstanceSpecification::slot_() const
+const QSet<QUmlSlot *> QUmlInstanceSpecification::slot_() const
{
// This is a read-write association end
@@ -154,8 +188,7 @@ void QUmlInstanceSpecification::removeSlot(QUmlSlot *slot_)
/*!
A specification of how to compute, derive, or construct the instance.
*/
-QUmlValueSpecification *
-QUmlInstanceSpecification::specification() const
+QUmlValueSpecification *QUmlInstanceSpecification::specification() const
{
// This is a read-write association end
diff --git a/src/uml/qumlinstancespecification.h b/src/uml/qumlinstancespecification.h
index 5f172ade..e5f99e5a 100644
--- a/src/uml/qumlinstancespecification.h
+++ b/src/uml/qumlinstancespecification.h
@@ -64,6 +64,8 @@ public:
explicit QUmlInstanceSpecification(bool createQObject = true);
virtual ~QUmlInstanceSpecification();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlClassifier *> classifier() const;
void addClassifier(QUmlClassifier *classifier);
diff --git a/src/uml/qumlinstancevalue.cpp b/src/uml/qumlinstancevalue.cpp
index 2e0f307f..3e1214a1 100644
--- a/src/uml/qumlinstancevalue.cpp
+++ b/src/uml/qumlinstancevalue.cpp
@@ -42,8 +42,17 @@
#include "private/qumlinstancevalueobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlInstanceSpecification>
-
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
/*!
\class QUmlInstanceValue
@@ -66,13 +75,34 @@ QUmlInstanceValue::~QUmlInstanceValue()
}
}
+QModelingObject *QUmlInstanceValue::clone() const
+{
+ QUmlInstanceValue *c = new QUmlInstanceValue;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (instance())
+ c->setInstance(dynamic_cast<QUmlInstanceSpecification *>(instance()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The instance that is the specified value.
*/
-QUmlInstanceSpecification *
-QUmlInstanceValue::instance() const
+QUmlInstanceSpecification *QUmlInstanceValue::instance() const
{
// This is a read-write association end
diff --git a/src/uml/qumlinstancevalue.h b/src/uml/qumlinstancevalue.h
index fdadaaae..27d91b82 100644
--- a/src/uml/qumlinstancevalue.h
+++ b/src/uml/qumlinstancevalue.h
@@ -60,6 +60,8 @@ public:
explicit QUmlInstanceValue(bool createQObject = true);
virtual ~QUmlInstanceValue();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlInstanceSpecification *instance() const;
void setInstance(QUmlInstanceSpecification *instance);
diff --git a/src/uml/qumlinteraction.cpp b/src/uml/qumlinteraction.cpp
index 14ef94b3..6c19067d 100644
--- a/src/uml/qumlinteraction.cpp
+++ b/src/uml/qumlinteraction.cpp
@@ -43,10 +43,52 @@
#include "private/qumlinteractionobject_p.h"
#include <QtUml/QUmlAction>
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlBehavioralFeature>
+#include <QtUml/QUmlBehavioredClassifier>
+#include <QtUml/QUmlClass>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElement>
+#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExtension>
+#include <QtUml/QUmlFeature>
#include <QtUml/QUmlGate>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlGeneralOrdering>
+#include <QtUml/QUmlInteractionFragment>
+#include <QtUml/QUmlInteractionOperand>
+#include <QtUml/QUmlInterfaceRealization>
#include <QtUml/QUmlLifeline>
#include <QtUml/QUmlMessage>
-
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameter>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlParameterSet>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlReception>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlInteraction
@@ -68,13 +110,109 @@ QUmlInteraction::~QUmlInteraction()
}
}
+QModelingObject *QUmlInteraction::clone() const
+{
+ QUmlInteraction *c = new QUmlInteraction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlConnector *element, ownedConnector())
+ c->addOwnedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setActive(isActive());
+ foreach (QUmlClassifier *element, nestedClassifier())
+ c->addNestedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ foreach (QUmlReception *element, ownedReception())
+ c->addOwnedReception(dynamic_cast<QUmlReception *>(element->clone()));
+ c->setReentrant(isReentrant());
+ foreach (QUmlParameter *element, ownedParameter())
+ c->addOwnedParameter(dynamic_cast<QUmlParameter *>(element->clone()));
+ foreach (QUmlParameterSet *element, ownedParameterSet())
+ c->addOwnedParameterSet(dynamic_cast<QUmlParameterSet *>(element->clone()));
+ foreach (QUmlConstraint *element, postcondition())
+ c->addPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, precondition())
+ c->addPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlBehavior *element, redefinedBehavior())
+ c->addRedefinedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ if (specification())
+ c->setSpecification(dynamic_cast<QUmlBehavioralFeature *>(specification()->clone()));
+ foreach (QUmlLifeline *element, covered())
+ c->addCovered(dynamic_cast<QUmlLifeline *>(element->clone()));
+ if (enclosingInteraction())
+ c->setEnclosingInteraction(dynamic_cast<QUmlInteraction *>(enclosingInteraction()->clone()));
+ if (enclosingOperand())
+ c->setEnclosingOperand(dynamic_cast<QUmlInteractionOperand *>(enclosingOperand()->clone()));
+ foreach (QUmlGeneralOrdering *element, generalOrdering())
+ c->addGeneralOrdering(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ foreach (QUmlAction *element, action())
+ c->addAction(dynamic_cast<QUmlAction *>(element->clone()));
+ foreach (QUmlGate *element, formalGate())
+ c->addFormalGate(dynamic_cast<QUmlGate *>(element->clone()));
+ foreach (QUmlInteractionFragment *element, fragment())
+ c->addFragment(dynamic_cast<QUmlInteractionFragment *>(element->clone()));
+ foreach (QUmlLifeline *element, lifeline())
+ c->addLifeline(dynamic_cast<QUmlLifeline *>(element->clone()));
+ foreach (QUmlMessage *element, message())
+ c->addMessage(dynamic_cast<QUmlMessage *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Actions owned by the Interaction.
*/
-const QSet<QUmlAction *>
-QUmlInteraction::action() const
+const QSet<QUmlAction *> QUmlInteraction::action() const
{
// This is a read-write association end
@@ -113,8 +251,7 @@ void QUmlInteraction::removeAction(QUmlAction *action)
/*!
Specifies the gates that form the message interface between this Interaction and any InteractionUses which reference it.
*/
-const QSet<QUmlGate *>
-QUmlInteraction::formalGate() const
+const QSet<QUmlGate *> QUmlInteraction::formalGate() const
{
// This is a read-write association end
@@ -153,8 +290,7 @@ void QUmlInteraction::removeFormalGate(QUmlGate *formalGate)
/*!
The ordered set of fragments in the Interaction.
*/
-const QList<QUmlInteractionFragment *>
-QUmlInteraction::fragment() const
+const QList<QUmlInteractionFragment *> QUmlInteraction::fragment() const
{
// This is a read-write association end
@@ -203,8 +339,7 @@ void QUmlInteraction::removeFragment(QUmlInteractionFragment *fragment)
/*!
Specifies the participants in this Interaction.
*/
-const QSet<QUmlLifeline *>
-QUmlInteraction::lifeline() const
+const QSet<QUmlLifeline *> QUmlInteraction::lifeline() const
{
// This is a read-write association end
@@ -253,8 +388,7 @@ void QUmlInteraction::removeLifeline(QUmlLifeline *lifeline)
/*!
The Messages contained in this Interaction.
*/
-const QSet<QUmlMessage *>
-QUmlInteraction::message() const
+const QSet<QUmlMessage *> QUmlInteraction::message() const
{
// This is a read-write association end
diff --git a/src/uml/qumlinteraction.h b/src/uml/qumlinteraction.h
index fa22e312..84c6ee5b 100644
--- a/src/uml/qumlinteraction.h
+++ b/src/uml/qumlinteraction.h
@@ -64,6 +64,8 @@ public:
explicit QUmlInteraction(bool createQObject = true);
virtual ~QUmlInteraction();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlAction *> action() const;
void addAction(QUmlAction *action);
diff --git a/src/uml/qumlinteractionconstraint.cpp b/src/uml/qumlinteractionconstraint.cpp
index bcadba41..63630475 100644
--- a/src/uml/qumlinteractionconstraint.cpp
+++ b/src/uml/qumlinteractionconstraint.cpp
@@ -42,8 +42,16 @@
#include "private/qumlinteractionconstraintobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
#include <QtUml/QUmlValueSpecification>
-
/*!
\class QUmlInteractionConstraint
@@ -68,13 +76,40 @@ QUmlInteractionConstraint::~QUmlInteractionConstraint()
}
}
+QModelingObject *QUmlInteractionConstraint::clone() const
+{
+ QUmlInteractionConstraint *c = new QUmlInteractionConstraint;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlElement *element, constrainedElement())
+ c->addConstrainedElement(dynamic_cast<QUmlElement *>(element->clone()));
+ if (context())
+ c->setContext(dynamic_cast<QUmlNamespace *>(context()->clone()));
+ if (specification())
+ c->setSpecification(dynamic_cast<QUmlValueSpecification *>(specification()->clone()));
+ if (maxint())
+ c->setMaxint(dynamic_cast<QUmlValueSpecification *>(maxint()->clone()));
+ if (minint())
+ c->setMinint(dynamic_cast<QUmlValueSpecification *>(minint()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The maximum number of iterations of a loop
*/
-QUmlValueSpecification *
-QUmlInteractionConstraint::maxint() const
+QUmlValueSpecification *QUmlInteractionConstraint::maxint() const
{
// This is a read-write association end
@@ -104,8 +139,7 @@ void QUmlInteractionConstraint::setMaxint(QUmlValueSpecification *maxint)
/*!
The minimum number of iterations of a loop
*/
-QUmlValueSpecification *
-QUmlInteractionConstraint::minint() const
+QUmlValueSpecification *QUmlInteractionConstraint::minint() const
{
// This is a read-write association end
diff --git a/src/uml/qumlinteractionconstraint.h b/src/uml/qumlinteractionconstraint.h
index b3e0f54d..26339e24 100644
--- a/src/uml/qumlinteractionconstraint.h
+++ b/src/uml/qumlinteractionconstraint.h
@@ -60,6 +60,8 @@ public:
explicit QUmlInteractionConstraint(bool createQObject = true);
virtual ~QUmlInteractionConstraint();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlValueSpecification *maxint() const;
void setMaxint(QUmlValueSpecification *maxint);
diff --git a/src/uml/qumlinteractionfragment.cpp b/src/uml/qumlinteractionfragment.cpp
index d984fdc1..46d1face 100644
--- a/src/uml/qumlinteractionfragment.cpp
+++ b/src/uml/qumlinteractionfragment.cpp
@@ -40,11 +40,17 @@
****************************************************************************/
#include "qumlinteractionfragment.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlGeneralOrdering>
#include <QtUml/QUmlInteraction>
#include <QtUml/QUmlInteractionOperand>
#include <QtUml/QUmlLifeline>
-
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlInteractionFragment
@@ -62,13 +68,34 @@ QUmlInteractionFragment::~QUmlInteractionFragment()
{
}
+QModelingObject *QUmlInteractionFragment::clone() const
+{
+ QUmlInteractionFragment *c = new QUmlInteractionFragment;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlLifeline *element, covered())
+ c->addCovered(dynamic_cast<QUmlLifeline *>(element->clone()));
+ if (enclosingInteraction())
+ c->setEnclosingInteraction(dynamic_cast<QUmlInteraction *>(enclosingInteraction()->clone()));
+ if (enclosingOperand())
+ c->setEnclosingOperand(dynamic_cast<QUmlInteractionOperand *>(enclosingOperand()->clone()));
+ foreach (QUmlGeneralOrdering *element, generalOrdering())
+ c->addGeneralOrdering(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the Lifelines that the InteractionFragment involves.
*/
-const QSet<QUmlLifeline *>
-QUmlInteractionFragment::covered() const
+const QSet<QUmlLifeline *> QUmlInteractionFragment::covered() const
{
// This is a read-write association end
@@ -108,8 +135,7 @@ void QUmlInteractionFragment::removeCovered(QUmlLifeline *covered)
/*!
The Interaction enclosing this InteractionFragment.
*/
-QUmlInteraction *
-QUmlInteractionFragment::enclosingInteraction() const
+QUmlInteraction *QUmlInteractionFragment::enclosingInteraction() const
{
// This is a read-write association end
@@ -135,8 +161,7 @@ void QUmlInteractionFragment::setEnclosingInteraction(QUmlInteraction *enclosing
/*!
The operand enclosing this InteractionFragment (they may nest recursively)
*/
-QUmlInteractionOperand *
-QUmlInteractionFragment::enclosingOperand() const
+QUmlInteractionOperand *QUmlInteractionFragment::enclosingOperand() const
{
// This is a read-write association end
@@ -162,8 +187,7 @@ void QUmlInteractionFragment::setEnclosingOperand(QUmlInteractionOperand *enclos
/*!
The general ordering relationships contained in this fragment.
*/
-const QSet<QUmlGeneralOrdering *>
-QUmlInteractionFragment::generalOrdering() const
+const QSet<QUmlGeneralOrdering *> QUmlInteractionFragment::generalOrdering() const
{
// This is a read-write association end
diff --git a/src/uml/qumlinteractionfragment.h b/src/uml/qumlinteractionfragment.h
index 7347aa28..0c558478 100644
--- a/src/uml/qumlinteractionfragment.h
+++ b/src/uml/qumlinteractionfragment.h
@@ -62,6 +62,8 @@ class Q_UML_EXPORT QUmlInteractionFragment : public virtual QUmlNamedElement
public:
virtual ~QUmlInteractionFragment();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlLifeline *> covered() const;
void addCovered(QUmlLifeline *covered);
diff --git a/src/uml/qumlinteractionoperand.cpp b/src/uml/qumlinteractionoperand.cpp
index 54496d5a..e24ee364 100644
--- a/src/uml/qumlinteractionoperand.cpp
+++ b/src/uml/qumlinteractionoperand.cpp
@@ -42,8 +42,22 @@
#include "private/qumlinteractionoperandobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlGeneralOrdering>
+#include <QtUml/QUmlInteraction>
#include <QtUml/QUmlInteractionConstraint>
-
+#include <QtUml/QUmlInteractionFragment>
+#include <QtUml/QUmlLifeline>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlInteractionOperand
@@ -66,13 +80,44 @@ QUmlInteractionOperand::~QUmlInteractionOperand()
}
}
+QModelingObject *QUmlInteractionOperand::clone() const
+{
+ QUmlInteractionOperand *c = new QUmlInteractionOperand;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlLifeline *element, covered())
+ c->addCovered(dynamic_cast<QUmlLifeline *>(element->clone()));
+ if (enclosingInteraction())
+ c->setEnclosingInteraction(dynamic_cast<QUmlInteraction *>(enclosingInteraction()->clone()));
+ if (enclosingOperand())
+ c->setEnclosingOperand(dynamic_cast<QUmlInteractionOperand *>(enclosingOperand()->clone()));
+ foreach (QUmlGeneralOrdering *element, generalOrdering())
+ c->addGeneralOrdering(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ foreach (QUmlInteractionFragment *element, fragment())
+ c->addFragment(dynamic_cast<QUmlInteractionFragment *>(element->clone()));
+ if (guard())
+ c->setGuard(dynamic_cast<QUmlInteractionConstraint *>(guard()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The fragments of the operand.
*/
-const QList<QUmlInteractionFragment *>
-QUmlInteractionOperand::fragment() const
+const QList<QUmlInteractionFragment *> QUmlInteractionOperand::fragment() const
{
// This is a read-write association end
@@ -121,8 +166,7 @@ void QUmlInteractionOperand::removeFragment(QUmlInteractionFragment *fragment)
/*!
Constraint of the operand.
*/
-QUmlInteractionConstraint *
-QUmlInteractionOperand::guard() const
+QUmlInteractionConstraint *QUmlInteractionOperand::guard() const
{
// This is a read-write association end
diff --git a/src/uml/qumlinteractionoperand.h b/src/uml/qumlinteractionoperand.h
index 3f1f5670..ffde9bb0 100644
--- a/src/uml/qumlinteractionoperand.h
+++ b/src/uml/qumlinteractionoperand.h
@@ -61,6 +61,8 @@ public:
explicit QUmlInteractionOperand(bool createQObject = true);
virtual ~QUmlInteractionOperand();
+ QModelingObject *clone() const;
+
// Owned attributes
const QList<QUmlInteractionFragment *> fragment() const;
void addFragment(QUmlInteractionFragment *fragment);
diff --git a/src/uml/qumlinteractionuse.cpp b/src/uml/qumlinteractionuse.cpp
index b497f7be..745dae0b 100644
--- a/src/uml/qumlinteractionuse.cpp
+++ b/src/uml/qumlinteractionuse.cpp
@@ -42,11 +42,20 @@
#include "private/qumlinteractionuseobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlGate>
+#include <QtUml/QUmlGeneralOrdering>
#include <QtUml/QUmlInteraction>
+#include <QtUml/QUmlInteractionOperand>
+#include <QtUml/QUmlLifeline>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlValueSpecification>
-
/*!
\class QUmlInteractionUse
@@ -71,13 +80,44 @@ QUmlInteractionUse::~QUmlInteractionUse()
}
}
+QModelingObject *QUmlInteractionUse::clone() const
+{
+ QUmlInteractionUse *c = new QUmlInteractionUse;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlLifeline *element, covered())
+ c->addCovered(dynamic_cast<QUmlLifeline *>(element->clone()));
+ if (enclosingInteraction())
+ c->setEnclosingInteraction(dynamic_cast<QUmlInteraction *>(enclosingInteraction()->clone()));
+ if (enclosingOperand())
+ c->setEnclosingOperand(dynamic_cast<QUmlInteractionOperand *>(enclosingOperand()->clone()));
+ foreach (QUmlGeneralOrdering *element, generalOrdering())
+ c->addGeneralOrdering(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ foreach (QUmlGate *element, actualGate())
+ c->addActualGate(dynamic_cast<QUmlGate *>(element->clone()));
+ foreach (QUmlValueSpecification *element, argument())
+ c->addArgument(dynamic_cast<QUmlValueSpecification *>(element->clone()));
+ if (refersTo())
+ c->setRefersTo(dynamic_cast<QUmlInteraction *>(refersTo()->clone()));
+ if (returnValue())
+ c->setReturnValue(dynamic_cast<QUmlValueSpecification *>(returnValue()->clone()));
+ if (returnValueRecipient())
+ c->setReturnValueRecipient(dynamic_cast<QUmlProperty *>(returnValueRecipient()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The actual gates of the InteractionUse
*/
-const QSet<QUmlGate *>
-QUmlInteractionUse::actualGate() const
+const QSet<QUmlGate *> QUmlInteractionUse::actualGate() const
{
// This is a read-write association end
@@ -116,8 +156,7 @@ void QUmlInteractionUse::removeActualGate(QUmlGate *actualGate)
/*!
The actual arguments of the Interaction
*/
-const QList<QUmlValueSpecification *>
-QUmlInteractionUse::argument() const
+const QList<QUmlValueSpecification *> QUmlInteractionUse::argument() const
{
// This is a read-write association end
@@ -156,8 +195,7 @@ void QUmlInteractionUse::removeArgument(QUmlValueSpecification *argument)
/*!
Refers to the Interaction that defines its meaning
*/
-QUmlInteraction *
-QUmlInteractionUse::refersTo() const
+QUmlInteraction *QUmlInteractionUse::refersTo() const
{
// This is a read-write association end
@@ -178,8 +216,7 @@ void QUmlInteractionUse::setRefersTo(QUmlInteraction *refersTo)
/*!
The value of the executed Interaction.
*/
-QUmlValueSpecification *
-QUmlInteractionUse::returnValue() const
+QUmlValueSpecification *QUmlInteractionUse::returnValue() const
{
// This is a read-write association end
@@ -209,8 +246,7 @@ void QUmlInteractionUse::setReturnValue(QUmlValueSpecification *returnValue)
/*!
The recipient of the return value.
*/
-QUmlProperty *
-QUmlInteractionUse::returnValueRecipient() const
+QUmlProperty *QUmlInteractionUse::returnValueRecipient() const
{
// This is a read-write association end
diff --git a/src/uml/qumlinteractionuse.h b/src/uml/qumlinteractionuse.h
index 1ac36054..84463421 100644
--- a/src/uml/qumlinteractionuse.h
+++ b/src/uml/qumlinteractionuse.h
@@ -63,6 +63,8 @@ public:
explicit QUmlInteractionUse(bool createQObject = true);
virtual ~QUmlInteractionUse();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlGate *> actualGate() const;
void addActualGate(QUmlGate *actualGate);
diff --git a/src/uml/qumlinterface.cpp b/src/uml/qumlinterface.cpp
index 22433672..610bd8ee 100644
--- a/src/uml/qumlinterface.cpp
+++ b/src/uml/qumlinterface.cpp
@@ -42,11 +42,36 @@
#include "private/qumlinterfaceobject_p.h"
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlProperty>
#include <QtUml/QUmlProtocolStateMachine>
#include <QtUml/QUmlReception>
-
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlInterface
@@ -69,13 +94,73 @@ QUmlInterface::~QUmlInterface()
}
}
+QModelingObject *QUmlInterface::clone() const
+{
+ QUmlInterface *c = new QUmlInterface;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlClassifier *element, nestedClassifier())
+ c->addNestedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ foreach (QUmlReception *element, ownedReception())
+ c->addOwnedReception(dynamic_cast<QUmlReception *>(element->clone()));
+ if (protocol())
+ c->setProtocol(dynamic_cast<QUmlProtocolStateMachine *>(protocol()->clone()));
+ foreach (QUmlInterface *element, redefinedInterface())
+ c->addRedefinedInterface(dynamic_cast<QUmlInterface *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References all the Classifiers that are defined (nested) within the Class.
*/
-const QList<QUmlClassifier *>
-QUmlInterface::nestedClassifier() const
+const QList<QUmlClassifier *> QUmlInterface::nestedClassifier() const
{
// This is a read-write association end
@@ -114,8 +199,7 @@ void QUmlInterface::removeNestedClassifier(QUmlClassifier *nestedClassifier)
/*!
The attributes (i.e. the properties) owned by the class.
*/
-const QList<QUmlProperty *>
-QUmlInterface::ownedAttribute() const
+const QList<QUmlProperty *> QUmlInterface::ownedAttribute() const
{
// This is a read-write association end
@@ -166,8 +250,7 @@ void QUmlInterface::removeOwnedAttribute(QUmlProperty *ownedAttribute)
/*!
The operations owned by the class.
*/
-const QList<QUmlOperation *>
-QUmlInterface::ownedOperation() const
+const QList<QUmlOperation *> QUmlInterface::ownedOperation() const
{
// This is a read-write association end
@@ -218,8 +301,7 @@ void QUmlInterface::removeOwnedOperation(QUmlOperation *ownedOperation)
/*!
Receptions that objects providing this interface are willing to accept.
*/
-const QSet<QUmlReception *>
-QUmlInterface::ownedReception() const
+const QSet<QUmlReception *> QUmlInterface::ownedReception() const
{
// This is a read-write association end
@@ -260,8 +342,7 @@ void QUmlInterface::removeOwnedReception(QUmlReception *ownedReception)
/*!
References a protocol state machine specifying the legal sequences of the invocation of the behavioral features described in the interface.
*/
-QUmlProtocolStateMachine *
-QUmlInterface::protocol() const
+QUmlProtocolStateMachine *QUmlInterface::protocol() const
{
// This is a read-write association end
@@ -291,8 +372,7 @@ void QUmlInterface::setProtocol(QUmlProtocolStateMachine *protocol)
/*!
References all the Interfaces redefined by this Interface.
*/
-const QSet<QUmlInterface *>
-QUmlInterface::redefinedInterface() const
+const QSet<QUmlInterface *> QUmlInterface::redefinedInterface() const
{
// This is a read-write association end
diff --git a/src/uml/qumlinterface.h b/src/uml/qumlinterface.h
index 82166650..f1059ec0 100644
--- a/src/uml/qumlinterface.h
+++ b/src/uml/qumlinterface.h
@@ -63,6 +63,8 @@ public:
explicit QUmlInterface(bool createQObject = true);
virtual ~QUmlInterface();
+ QModelingObject *clone() const;
+
// Owned attributes
const QList<QUmlClassifier *> nestedClassifier() const;
void addNestedClassifier(QUmlClassifier *nestedClassifier);
diff --git a/src/uml/qumlinterfacerealization.cpp b/src/uml/qumlinterfacerealization.cpp
index d852817d..dba2479f 100644
--- a/src/uml/qumlinterfacerealization.cpp
+++ b/src/uml/qumlinterfacerealization.cpp
@@ -43,8 +43,17 @@
#include "private/qumlinterfacerealizationobject_p.h"
#include <QtUml/QUmlBehavioredClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlInterface>
-
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOpaqueExpression>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlInterfaceRealization
@@ -69,13 +78,40 @@ QUmlInterfaceRealization::~QUmlInterfaceRealization()
}
}
+QModelingObject *QUmlInterfaceRealization::clone() const
+{
+ QUmlInterfaceRealization *c = new QUmlInterfaceRealization;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlNamedElement *element, client())
+ c->addClient(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ foreach (QUmlNamedElement *element, supplier())
+ c->addSupplier(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ if (mapping())
+ c->setMapping(dynamic_cast<QUmlOpaqueExpression *>(mapping()->clone()));
+ if (contract())
+ c->setContract(dynamic_cast<QUmlInterface *>(contract()->clone()));
+ if (implementingClassifier())
+ c->setImplementingClassifier(dynamic_cast<QUmlBehavioredClassifier *>(implementingClassifier()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the Interface specifying the conformance contract.
*/
-QUmlInterface *
-QUmlInterfaceRealization::contract() const
+QUmlInterface *QUmlInterfaceRealization::contract() const
{
// This is a read-write association end
@@ -104,8 +140,7 @@ void QUmlInterfaceRealization::setContract(QUmlInterface *contract)
/*!
References the BehavioredClassifier that owns this Interfacerealization (i.e., the classifier that realizes the Interface to which it points).
*/
-QUmlBehavioredClassifier *
-QUmlInterfaceRealization::implementingClassifier() const
+QUmlBehavioredClassifier *QUmlInterfaceRealization::implementingClassifier() const
{
// This is a read-write association end
diff --git a/src/uml/qumlinterfacerealization.h b/src/uml/qumlinterfacerealization.h
index 44301350..07520af4 100644
--- a/src/uml/qumlinterfacerealization.h
+++ b/src/uml/qumlinterfacerealization.h
@@ -61,6 +61,8 @@ public:
explicit QUmlInterfaceRealization(bool createQObject = true);
virtual ~QUmlInterfaceRealization();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlInterface *contract() const;
void setContract(QUmlInterface *contract);
diff --git a/src/uml/qumlinterruptibleactivityregion.cpp b/src/uml/qumlinterruptibleactivityregion.cpp
index 2f588f66..cb20b97f 100644
--- a/src/uml/qumlinterruptibleactivityregion.cpp
+++ b/src/uml/qumlinterruptibleactivityregion.cpp
@@ -42,9 +42,17 @@
#include "private/qumlinterruptibleactivityregionobject_p.h"
+#include <QtUml/QUmlActivity>
#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
#include <QtUml/QUmlActivityNode>
-
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlInterruptibleActivityRegion
@@ -66,13 +74,32 @@ QUmlInterruptibleActivityRegion::~QUmlInterruptibleActivityRegion()
}
}
+QModelingObject *QUmlInterruptibleActivityRegion::clone() const
+{
+ QUmlInterruptibleActivityRegion *c = new QUmlInterruptibleActivityRegion;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (inActivity())
+ c->setInActivity(dynamic_cast<QUmlActivity *>(inActivity()->clone()));
+ foreach (QUmlActivityEdge *element, interruptingEdge())
+ c->addInterruptingEdge(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, node())
+ c->addNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The edges leaving the region that will abort other tokens flowing in the region.
*/
-const QSet<QUmlActivityEdge *>
-QUmlInterruptibleActivityRegion::interruptingEdge() const
+const QSet<QUmlActivityEdge *> QUmlInterruptibleActivityRegion::interruptingEdge() const
{
// This is a read-write association end
@@ -112,8 +139,7 @@ void QUmlInterruptibleActivityRegion::removeInterruptingEdge(QUmlActivityEdge *i
/*!
Nodes immediately contained in the group.
*/
-const QSet<QUmlActivityNode *>
-QUmlInterruptibleActivityRegion::node() const
+const QSet<QUmlActivityNode *> QUmlInterruptibleActivityRegion::node() const
{
// This is a read-write association end
diff --git a/src/uml/qumlinterruptibleactivityregion.h b/src/uml/qumlinterruptibleactivityregion.h
index a6a7a8af..358a4b23 100644
--- a/src/uml/qumlinterruptibleactivityregion.h
+++ b/src/uml/qumlinterruptibleactivityregion.h
@@ -61,6 +61,8 @@ public:
explicit QUmlInterruptibleActivityRegion(bool createQObject = true);
virtual ~QUmlInterruptibleActivityRegion();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlActivityEdge *> interruptingEdge() const;
void addInterruptingEdge(QUmlActivityEdge *interruptingEdge);
diff --git a/src/uml/qumlinterval.cpp b/src/uml/qumlinterval.cpp
index 69a25b93..a5f76983 100644
--- a/src/uml/qumlinterval.cpp
+++ b/src/uml/qumlinterval.cpp
@@ -42,6 +42,17 @@
#include "private/qumlintervalobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlInterval
@@ -65,13 +76,36 @@ QUmlInterval::~QUmlInterval()
}
}
+QModelingObject *QUmlInterval::clone() const
+{
+ QUmlInterval *c = new QUmlInterval;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (max())
+ c->setMax(dynamic_cast<QUmlValueSpecification *>(max()->clone()));
+ if (min())
+ c->setMin(dynamic_cast<QUmlValueSpecification *>(min()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Refers to the ValueSpecification denoting the maximum value of the range.
*/
-QUmlValueSpecification *
-QUmlInterval::max() const
+QUmlValueSpecification *QUmlInterval::max() const
{
// This is a read-write association end
@@ -92,8 +126,7 @@ void QUmlInterval::setMax(QUmlValueSpecification *max)
/*!
Refers to the ValueSpecification denoting the minimum value of the range.
*/
-QUmlValueSpecification *
-QUmlInterval::min() const
+QUmlValueSpecification *QUmlInterval::min() const
{
// This is a read-write association end
diff --git a/src/uml/qumlinterval.h b/src/uml/qumlinterval.h
index 4159fa42..f2241d7c 100644
--- a/src/uml/qumlinterval.h
+++ b/src/uml/qumlinterval.h
@@ -58,6 +58,8 @@ public:
explicit QUmlInterval(bool createQObject = true);
virtual ~QUmlInterval();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlValueSpecification *max() const;
void setMax(QUmlValueSpecification *max);
diff --git a/src/uml/qumlintervalconstraint.cpp b/src/uml/qumlintervalconstraint.cpp
index c7535974..b95e72d4 100644
--- a/src/uml/qumlintervalconstraint.cpp
+++ b/src/uml/qumlintervalconstraint.cpp
@@ -42,8 +42,17 @@
#include "private/qumlintervalconstraintobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlInterval>
-
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlIntervalConstraint
@@ -67,13 +76,36 @@ QUmlIntervalConstraint::~QUmlIntervalConstraint()
}
}
+QModelingObject *QUmlIntervalConstraint::clone() const
+{
+ QUmlIntervalConstraint *c = new QUmlIntervalConstraint;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlElement *element, constrainedElement())
+ c->addConstrainedElement(dynamic_cast<QUmlElement *>(element->clone()));
+ if (context())
+ c->setContext(dynamic_cast<QUmlNamespace *>(context()->clone()));
+ if (specification())
+ c->setSpecification(dynamic_cast<QUmlInterval *>(specification()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
A condition that must be true when evaluated in order for the constraint to be satisfied.
*/
-QUmlInterval *
-QUmlIntervalConstraint::specification() const
+QUmlInterval *QUmlIntervalConstraint::specification() const
{
// This is a read-write association end
diff --git a/src/uml/qumlintervalconstraint.h b/src/uml/qumlintervalconstraint.h
index 7130f13c..1325bd8d 100644
--- a/src/uml/qumlintervalconstraint.h
+++ b/src/uml/qumlintervalconstraint.h
@@ -60,6 +60,8 @@ public:
explicit QUmlIntervalConstraint(bool createQObject = true);
virtual ~QUmlIntervalConstraint();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlInterval *specification() const;
void setSpecification(QUmlInterval *specification);
diff --git a/src/uml/qumlinvocationaction.cpp b/src/uml/qumlinvocationaction.cpp
index 6531ec34..e2384005 100644
--- a/src/uml/qumlinvocationaction.cpp
+++ b/src/uml/qumlinvocationaction.cpp
@@ -40,9 +40,27 @@
****************************************************************************/
#include "qumlinvocationaction.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
#include <QtUml/QUmlPort>
-
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlInvocationAction
@@ -59,13 +77,52 @@ QUmlInvocationAction::~QUmlInvocationAction()
{
}
+QModelingObject *QUmlInvocationAction::clone() const
+{
+ QUmlInvocationAction *c = new QUmlInvocationAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlInputPin *element, argument())
+ c->addArgument(dynamic_cast<QUmlInputPin *>(element->clone()));
+ if (onPort())
+ c->setOnPort(dynamic_cast<QUmlPort *>(onPort()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specification of the ordered set of argument values that appears during execution.
*/
-const QList<QUmlInputPin *>
-QUmlInvocationAction::argument() const
+const QList<QUmlInputPin *> QUmlInvocationAction::argument() const
{
// This is a read-write association end
@@ -104,8 +161,7 @@ void QUmlInvocationAction::removeArgument(QUmlInputPin *argument)
/*!
A optional port of the receiver object on which the behavioral feature is invoked.
*/
-QUmlPort *
-QUmlInvocationAction::onPort() const
+QUmlPort *QUmlInvocationAction::onPort() const
{
// This is a read-write association end
diff --git a/src/uml/qumlinvocationaction.h b/src/uml/qumlinvocationaction.h
index c7c977fa..384a4f31 100644
--- a/src/uml/qumlinvocationaction.h
+++ b/src/uml/qumlinvocationaction.h
@@ -60,6 +60,8 @@ class Q_UML_EXPORT QUmlInvocationAction : public QUmlAction
public:
virtual ~QUmlInvocationAction();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
const QList<QUmlInputPin *> argument() const;
void addArgument(QUmlInputPin *argument);
diff --git a/src/uml/qumljoinnode.cpp b/src/uml/qumljoinnode.cpp
index 80af7f5e..dc038d52 100644
--- a/src/uml/qumljoinnode.cpp
+++ b/src/uml/qumljoinnode.cpp
@@ -42,8 +42,23 @@
#include "private/qumljoinnodeobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
#include <QtUml/QUmlValueSpecification>
-
/*!
\class QUmlJoinNode
@@ -67,13 +82,44 @@ QUmlJoinNode::~QUmlJoinNode()
}
}
+QModelingObject *QUmlJoinNode::clone() const
+{
+ QUmlJoinNode *c = new QUmlJoinNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ c->setCombineDuplicate(isCombineDuplicate());
+ if (joinSpec())
+ c->setJoinSpec(dynamic_cast<QUmlValueSpecification *>(joinSpec()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Tells whether tokens having objects with the same identity are combined into one by the join.
*/
-bool
-QUmlJoinNode::isCombineDuplicate() const
+bool QUmlJoinNode::isCombineDuplicate() const
{
// This is a read-write property
@@ -92,8 +138,7 @@ void QUmlJoinNode::setCombineDuplicate(bool isCombineDuplicate)
/*!
A specification giving the conditions under which the join with emit a token. Default is "and".
*/
-QUmlValueSpecification *
-QUmlJoinNode::joinSpec() const
+QUmlValueSpecification *QUmlJoinNode::joinSpec() const
{
// This is a read-write association end
diff --git a/src/uml/qumljoinnode.h b/src/uml/qumljoinnode.h
index c6c444cc..900522d4 100644
--- a/src/uml/qumljoinnode.h
+++ b/src/uml/qumljoinnode.h
@@ -60,6 +60,8 @@ public:
explicit QUmlJoinNode(bool createQObject = true);
virtual ~QUmlJoinNode();
+ QModelingObject *clone() const;
+
// Owned attributes
bool isCombineDuplicate() const;
void setCombineDuplicate(bool isCombineDuplicate);
diff --git a/src/uml/qumllifeline.cpp b/src/uml/qumllifeline.cpp
index 09d2a6a2..7088fc18 100644
--- a/src/uml/qumllifeline.cpp
+++ b/src/uml/qumllifeline.cpp
@@ -42,12 +42,18 @@
#include "private/qumllifelineobject_p.h"
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConnectableElement>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlInteraction>
#include <QtUml/QUmlInteractionFragment>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
#include <QtUml/QUmlPartDecomposition>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlValueSpecification>
-
/*!
\class QUmlLifeline
@@ -73,13 +79,36 @@ QUmlLifeline::~QUmlLifeline()
}
}
+QModelingObject *QUmlLifeline::clone() const
+{
+ QUmlLifeline *c = new QUmlLifeline;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlInteractionFragment *element, coveredBy())
+ c->addCoveredBy(dynamic_cast<QUmlInteractionFragment *>(element->clone()));
+ if (decomposedAs())
+ c->setDecomposedAs(dynamic_cast<QUmlPartDecomposition *>(decomposedAs()->clone()));
+ if (interaction())
+ c->setInteraction(dynamic_cast<QUmlInteraction *>(interaction()->clone()));
+ if (represents())
+ c->setRepresents(dynamic_cast<QUmlConnectableElement *>(represents()->clone()));
+ if (selector())
+ c->setSelector(dynamic_cast<QUmlValueSpecification *>(selector()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the InteractionFragments in which this Lifeline takes part.
*/
-const QSet<QUmlInteractionFragment *>
-QUmlLifeline::coveredBy() const
+const QSet<QUmlInteractionFragment *> QUmlLifeline::coveredBy() const
{
// This is a read-write association end
@@ -119,8 +148,7 @@ void QUmlLifeline::removeCoveredBy(QUmlInteractionFragment *coveredBy)
/*!
References the Interaction that represents the decomposition.
*/
-QUmlPartDecomposition *
-QUmlLifeline::decomposedAs() const
+QUmlPartDecomposition *QUmlLifeline::decomposedAs() const
{
// This is a read-write association end
@@ -141,8 +169,7 @@ void QUmlLifeline::setDecomposedAs(QUmlPartDecomposition *decomposedAs)
/*!
References the Interaction enclosing this Lifeline.
*/
-QUmlInteraction *
-QUmlLifeline::interaction() const
+QUmlInteraction *QUmlLifeline::interaction() const
{
// This is a read-write association end
@@ -168,8 +195,7 @@ void QUmlLifeline::setInteraction(QUmlInteraction *interaction)
/*!
References the ConnectableElement within the classifier that contains the enclosing interaction.
*/
-QUmlConnectableElement *
-QUmlLifeline::represents() const
+QUmlConnectableElement *QUmlLifeline::represents() const
{
// This is a read-write association end
@@ -190,8 +216,7 @@ void QUmlLifeline::setRepresents(QUmlConnectableElement *represents)
/*!
If the referenced ConnectableElement is multivalued, then this specifies the specific individual part within that set.
*/
-QUmlValueSpecification *
-QUmlLifeline::selector() const
+QUmlValueSpecification *QUmlLifeline::selector() const
{
// This is a read-write association end
diff --git a/src/uml/qumllifeline.h b/src/uml/qumllifeline.h
index 36ba3b7f..a5e67041 100644
--- a/src/uml/qumllifeline.h
+++ b/src/uml/qumllifeline.h
@@ -64,6 +64,8 @@ public:
explicit QUmlLifeline(bool createQObject = true);
virtual ~QUmlLifeline();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlInteractionFragment *> coveredBy() const;
void addCoveredBy(QUmlInteractionFragment *coveredBy);
diff --git a/src/uml/qumllinkaction.cpp b/src/uml/qumllinkaction.cpp
index 85dd3210..b668a03c 100644
--- a/src/uml/qumllinkaction.cpp
+++ b/src/uml/qumllinkaction.cpp
@@ -40,10 +40,28 @@
****************************************************************************/
#include "qumllinkaction.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
#include <QtUml/QUmlAssociation>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
#include <QtUml/QUmlLinkEndData>
-
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlLinkAction
@@ -59,13 +77,52 @@ QUmlLinkAction::~QUmlLinkAction()
{
}
+QModelingObject *QUmlLinkAction::clone() const
+{
+ QUmlLinkAction *c = new QUmlLinkAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlLinkEndData *element, endData())
+ c->addEndData(dynamic_cast<QUmlLinkEndData *>(element->clone()));
+ foreach (QUmlInputPin *element, inputValue())
+ c->addInputValue(dynamic_cast<QUmlInputPin *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Data identifying one end of a link by the objects on its ends and qualifiers.
*/
-const QSet<QUmlLinkEndData *>
-QUmlLinkAction::endData() const
+const QSet<QUmlLinkEndData *> QUmlLinkAction::endData() const
{
// This is a read-write association end
@@ -104,8 +161,7 @@ void QUmlLinkAction::removeEndData(QUmlLinkEndData *endData)
/*!
Pins taking end objects and qualifier values as input.
*/
-const QSet<QUmlInputPin *>
-QUmlLinkAction::inputValue() const
+const QSet<QUmlInputPin *> QUmlLinkAction::inputValue() const
{
// This is a read-write association end
diff --git a/src/uml/qumllinkaction.h b/src/uml/qumllinkaction.h
index a66790e6..87eaf5ad 100644
--- a/src/uml/qumllinkaction.h
+++ b/src/uml/qumllinkaction.h
@@ -61,6 +61,8 @@ class Q_UML_EXPORT QUmlLinkAction : public QUmlAction
public:
virtual ~QUmlLinkAction();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlLinkEndData *> endData() const;
void addEndData(QUmlLinkEndData *endData);
diff --git a/src/uml/qumllinkendcreationdata.cpp b/src/uml/qumllinkendcreationdata.cpp
index 93c73fdc..d0d0929e 100644
--- a/src/uml/qumllinkendcreationdata.cpp
+++ b/src/uml/qumllinkendcreationdata.cpp
@@ -42,8 +42,11 @@
#include "private/qumllinkendcreationdataobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlInputPin>
-
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlQualifierValue>
/*!
\class QUmlLinkEndCreationData
@@ -68,13 +71,29 @@ QUmlLinkEndCreationData::~QUmlLinkEndCreationData()
}
}
+QModelingObject *QUmlLinkEndCreationData::clone() const
+{
+ QUmlLinkEndCreationData *c = new QUmlLinkEndCreationData;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (end())
+ c->setEnd(dynamic_cast<QUmlProperty *>(end()->clone()));
+ foreach (QUmlQualifierValue *element, qualifier())
+ c->addQualifier(dynamic_cast<QUmlQualifierValue *>(element->clone()));
+ if (value())
+ c->setValue(dynamic_cast<QUmlInputPin *>(value()->clone()));
+ if (insertAt())
+ c->setInsertAt(dynamic_cast<QUmlInputPin *>(insertAt()->clone()));
+ c->setReplaceAll(isReplaceAll());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies where the new link should be inserted for ordered association ends, or where an existing link should be moved to. The type of the input is UnlimitedNatural, but the input cannot be zero. This pin is omitted for association ends that are not ordered.
*/
-QUmlInputPin *
-QUmlLinkEndCreationData::insertAt() const
+QUmlInputPin *QUmlLinkEndCreationData::insertAt() const
{
// This is a read-write association end
@@ -95,8 +114,7 @@ void QUmlLinkEndCreationData::setInsertAt(QUmlInputPin *insertAt)
/*!
Specifies whether the existing links emanating from the object on this end should be destroyed before creating a new link.
*/
-bool
-QUmlLinkEndCreationData::isReplaceAll() const
+bool QUmlLinkEndCreationData::isReplaceAll() const
{
// This is a read-write property
diff --git a/src/uml/qumllinkendcreationdata.h b/src/uml/qumllinkendcreationdata.h
index bce91ba1..cdd2ff95 100644
--- a/src/uml/qumllinkendcreationdata.h
+++ b/src/uml/qumllinkendcreationdata.h
@@ -60,6 +60,8 @@ public:
explicit QUmlLinkEndCreationData(bool createQObject = true);
virtual ~QUmlLinkEndCreationData();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlInputPin *insertAt() const;
void setInsertAt(QUmlInputPin *insertAt);
diff --git a/src/uml/qumllinkenddata.cpp b/src/uml/qumllinkenddata.cpp
index b0bd6cde..fde05056 100644
--- a/src/uml/qumllinkenddata.cpp
+++ b/src/uml/qumllinkenddata.cpp
@@ -42,10 +42,11 @@
#include "private/qumllinkenddataobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlInputPin>
#include <QtUml/QUmlProperty>
#include <QtUml/QUmlQualifierValue>
-
/*!
\class QUmlLinkEndData
@@ -69,13 +70,26 @@ QUmlLinkEndData::~QUmlLinkEndData()
}
}
+QModelingObject *QUmlLinkEndData::clone() const
+{
+ QUmlLinkEndData *c = new QUmlLinkEndData;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (end())
+ c->setEnd(dynamic_cast<QUmlProperty *>(end()->clone()));
+ foreach (QUmlQualifierValue *element, qualifier())
+ c->addQualifier(dynamic_cast<QUmlQualifierValue *>(element->clone()));
+ if (value())
+ c->setValue(dynamic_cast<QUmlInputPin *>(value()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Association end for which this link-end data specifies values.
*/
-QUmlProperty *
-QUmlLinkEndData::end() const
+QUmlProperty *QUmlLinkEndData::end() const
{
// This is a read-write association end
@@ -96,8 +110,7 @@ void QUmlLinkEndData::setEnd(QUmlProperty *end)
/*!
List of qualifier values
*/
-const QSet<QUmlQualifierValue *>
-QUmlLinkEndData::qualifier() const
+const QSet<QUmlQualifierValue *> QUmlLinkEndData::qualifier() const
{
// This is a read-write association end
@@ -136,8 +149,7 @@ void QUmlLinkEndData::removeQualifier(QUmlQualifierValue *qualifier)
/*!
Input pin that provides the specified object for the given end. This pin is omitted if the link-end data specifies an 'open' end for reading.
*/
-QUmlInputPin *
-QUmlLinkEndData::value() const
+QUmlInputPin *QUmlLinkEndData::value() const
{
// This is a read-write association end
diff --git a/src/uml/qumllinkenddata.h b/src/uml/qumllinkenddata.h
index 03a10f4c..6aa4a49e 100644
--- a/src/uml/qumllinkenddata.h
+++ b/src/uml/qumllinkenddata.h
@@ -62,6 +62,8 @@ public:
explicit QUmlLinkEndData(bool createQObject = true);
virtual ~QUmlLinkEndData();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlProperty *end() const;
void setEnd(QUmlProperty *end);
diff --git a/src/uml/qumllinkenddestructiondata.cpp b/src/uml/qumllinkenddestructiondata.cpp
index 7fc92fce..e449dd88 100644
--- a/src/uml/qumllinkenddestructiondata.cpp
+++ b/src/uml/qumllinkenddestructiondata.cpp
@@ -42,8 +42,11 @@
#include "private/qumllinkenddestructiondataobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlInputPin>
-
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlQualifierValue>
/*!
\class QUmlLinkEndDestructionData
@@ -68,13 +71,29 @@ QUmlLinkEndDestructionData::~QUmlLinkEndDestructionData()
}
}
+QModelingObject *QUmlLinkEndDestructionData::clone() const
+{
+ QUmlLinkEndDestructionData *c = new QUmlLinkEndDestructionData;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (end())
+ c->setEnd(dynamic_cast<QUmlProperty *>(end()->clone()));
+ foreach (QUmlQualifierValue *element, qualifier())
+ c->addQualifier(dynamic_cast<QUmlQualifierValue *>(element->clone()));
+ if (value())
+ c->setValue(dynamic_cast<QUmlInputPin *>(value()->clone()));
+ if (destroyAt())
+ c->setDestroyAt(dynamic_cast<QUmlInputPin *>(destroyAt()->clone()));
+ c->setDestroyDuplicates(isDestroyDuplicates());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies the position of an existing link to be destroyed in ordered nonunique association ends. The type of the pin is UnlimitedNatural, but the value cannot be zero or unlimited.
*/
-QUmlInputPin *
-QUmlLinkEndDestructionData::destroyAt() const
+QUmlInputPin *QUmlLinkEndDestructionData::destroyAt() const
{
// This is a read-write association end
@@ -95,8 +114,7 @@ void QUmlLinkEndDestructionData::setDestroyAt(QUmlInputPin *destroyAt)
/*!
Specifies whether to destroy duplicates of the value in nonunique association ends.
*/
-bool
-QUmlLinkEndDestructionData::isDestroyDuplicates() const
+bool QUmlLinkEndDestructionData::isDestroyDuplicates() const
{
// This is a read-write property
diff --git a/src/uml/qumllinkenddestructiondata.h b/src/uml/qumllinkenddestructiondata.h
index 30cead9b..e0e51aa0 100644
--- a/src/uml/qumllinkenddestructiondata.h
+++ b/src/uml/qumllinkenddestructiondata.h
@@ -60,6 +60,8 @@ public:
explicit QUmlLinkEndDestructionData(bool createQObject = true);
virtual ~QUmlLinkEndDestructionData();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlInputPin *destroyAt() const;
void setDestroyAt(QUmlInputPin *destroyAt);
diff --git a/src/uml/qumlliteralboolean.cpp b/src/uml/qumlliteralboolean.cpp
index d91b49cf..18c50656 100644
--- a/src/uml/qumlliteralboolean.cpp
+++ b/src/uml/qumlliteralboolean.cpp
@@ -42,6 +42,16 @@
#include "private/qumlliteralbooleanobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
/*!
\class QUmlLiteralBoolean
@@ -64,13 +74,33 @@ QUmlLiteralBoolean::~QUmlLiteralBoolean()
}
}
+QModelingObject *QUmlLiteralBoolean::clone() const
+{
+ QUmlLiteralBoolean *c = new QUmlLiteralBoolean;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ c->setValue(value());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The specified Boolean value.
*/
-bool
-QUmlLiteralBoolean::value() const
+bool QUmlLiteralBoolean::value() const
{
// This is a read-write property
diff --git a/src/uml/qumlliteralboolean.h b/src/uml/qumlliteralboolean.h
index 7c7bee89..6ad4ba80 100644
--- a/src/uml/qumlliteralboolean.h
+++ b/src/uml/qumlliteralboolean.h
@@ -58,6 +58,8 @@ public:
explicit QUmlLiteralBoolean(bool createQObject = true);
virtual ~QUmlLiteralBoolean();
+ QModelingObject *clone() const;
+
// Owned attributes
bool value() const;
void setValue(bool value);
diff --git a/src/uml/qumlliteralinteger.cpp b/src/uml/qumlliteralinteger.cpp
index ab66283e..dd5cec7a 100644
--- a/src/uml/qumlliteralinteger.cpp
+++ b/src/uml/qumlliteralinteger.cpp
@@ -42,6 +42,16 @@
#include "private/qumlliteralintegerobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
/*!
\class QUmlLiteralInteger
@@ -64,13 +74,33 @@ QUmlLiteralInteger::~QUmlLiteralInteger()
}
}
+QModelingObject *QUmlLiteralInteger::clone() const
+{
+ QUmlLiteralInteger *c = new QUmlLiteralInteger;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ c->setValue(value());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The specified Integer value.
*/
-int
-QUmlLiteralInteger::value() const
+int QUmlLiteralInteger::value() const
{
// This is a read-write property
diff --git a/src/uml/qumlliteralinteger.h b/src/uml/qumlliteralinteger.h
index 40c415cf..99fe88f0 100644
--- a/src/uml/qumlliteralinteger.h
+++ b/src/uml/qumlliteralinteger.h
@@ -58,6 +58,8 @@ public:
explicit QUmlLiteralInteger(bool createQObject = true);
virtual ~QUmlLiteralInteger();
+ QModelingObject *clone() const;
+
// Owned attributes
int value() const;
void setValue(int value);
diff --git a/src/uml/qumlliteralnull.cpp b/src/uml/qumlliteralnull.cpp
index d8b7edc2..080c73ff 100644
--- a/src/uml/qumlliteralnull.cpp
+++ b/src/uml/qumlliteralnull.cpp
@@ -42,6 +42,16 @@
#include "private/qumlliteralnullobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
/*!
\class QUmlLiteralNull
@@ -63,6 +73,26 @@ QUmlLiteralNull::~QUmlLiteralNull()
}
}
+QModelingObject *QUmlLiteralNull::clone() const
+{
+ QUmlLiteralNull *c = new QUmlLiteralNull;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ return c;
+}
+
// OPERATIONS
/*!
diff --git a/src/uml/qumlliteralnull.h b/src/uml/qumlliteralnull.h
index 1f57d718..1d9d7951 100644
--- a/src/uml/qumlliteralnull.h
+++ b/src/uml/qumlliteralnull.h
@@ -58,6 +58,8 @@ public:
explicit QUmlLiteralNull(bool createQObject = true);
virtual ~QUmlLiteralNull();
+ QModelingObject *clone() const;
+
// Operations
bool isComputable() const;
diff --git a/src/uml/qumlliteralreal.cpp b/src/uml/qumlliteralreal.cpp
index c9fbc69f..62dd71de 100644
--- a/src/uml/qumlliteralreal.cpp
+++ b/src/uml/qumlliteralreal.cpp
@@ -42,6 +42,16 @@
#include "private/qumlliteralrealobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
/*!
\class QUmlLiteralReal
@@ -63,10 +73,30 @@ QUmlLiteralReal::~QUmlLiteralReal()
}
}
+QModelingObject *QUmlLiteralReal::clone() const
+{
+ QUmlLiteralReal *c = new QUmlLiteralReal;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ c->setValue(value());
+ return c;
+}
+
// OWNED ATTRIBUTES
-double
-QUmlLiteralReal::value() const
+double QUmlLiteralReal::value() const
{
// This is a read-write property
diff --git a/src/uml/qumlliteralreal.h b/src/uml/qumlliteralreal.h
index a8286d33..2e78985d 100644
--- a/src/uml/qumlliteralreal.h
+++ b/src/uml/qumlliteralreal.h
@@ -58,6 +58,8 @@ public:
explicit QUmlLiteralReal(bool createQObject = true);
virtual ~QUmlLiteralReal();
+ QModelingObject *clone() const;
+
// Owned attributes
double value() const;
void setValue(double value);
diff --git a/src/uml/qumlliteralspecification.cpp b/src/uml/qumlliteralspecification.cpp
index 7d4dd2f1..3e4c44dc 100644
--- a/src/uml/qumlliteralspecification.cpp
+++ b/src/uml/qumlliteralspecification.cpp
@@ -40,6 +40,16 @@
****************************************************************************/
#include "qumlliteralspecification.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
/*!
\class QUmlLiteralSpecification
@@ -55,3 +65,23 @@ QUmlLiteralSpecification::~QUmlLiteralSpecification()
{
}
+QModelingObject *QUmlLiteralSpecification::clone() const
+{
+ QUmlLiteralSpecification *c = new QUmlLiteralSpecification;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ return c;
+}
+
diff --git a/src/uml/qumlliteralspecification.h b/src/uml/qumlliteralspecification.h
index c05c6c78..ebb98cb2 100644
--- a/src/uml/qumlliteralspecification.h
+++ b/src/uml/qumlliteralspecification.h
@@ -57,6 +57,8 @@ class Q_UML_EXPORT QUmlLiteralSpecification : public QUmlValueSpecification
public:
virtual ~QUmlLiteralSpecification();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
protected:
explicit QUmlLiteralSpecification();
diff --git a/src/uml/qumlliteralstring.cpp b/src/uml/qumlliteralstring.cpp
index 5eeb4d5a..72e971ed 100644
--- a/src/uml/qumlliteralstring.cpp
+++ b/src/uml/qumlliteralstring.cpp
@@ -42,6 +42,16 @@
#include "private/qumlliteralstringobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
/*!
\class QUmlLiteralString
@@ -63,13 +73,33 @@ QUmlLiteralString::~QUmlLiteralString()
}
}
+QModelingObject *QUmlLiteralString::clone() const
+{
+ QUmlLiteralString *c = new QUmlLiteralString;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ c->setValue(value());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The specified String value.
*/
-QString
-QUmlLiteralString::value() const
+QString QUmlLiteralString::value() const
{
// This is a read-write property
diff --git a/src/uml/qumlliteralstring.h b/src/uml/qumlliteralstring.h
index 1d2774df..9a86b6b8 100644
--- a/src/uml/qumlliteralstring.h
+++ b/src/uml/qumlliteralstring.h
@@ -58,6 +58,8 @@ public:
explicit QUmlLiteralString(bool createQObject = true);
virtual ~QUmlLiteralString();
+ QModelingObject *clone() const;
+
// Owned attributes
QString value() const;
void setValue(QString value);
diff --git a/src/uml/qumlliteralunlimitednatural.cpp b/src/uml/qumlliteralunlimitednatural.cpp
index 43d1bdcc..7a38c9b0 100644
--- a/src/uml/qumlliteralunlimitednatural.cpp
+++ b/src/uml/qumlliteralunlimitednatural.cpp
@@ -42,6 +42,16 @@
#include "private/qumlliteralunlimitednaturalobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
/*!
\class QUmlLiteralUnlimitedNatural
@@ -64,13 +74,33 @@ QUmlLiteralUnlimitedNatural::~QUmlLiteralUnlimitedNatural()
}
}
+QModelingObject *QUmlLiteralUnlimitedNatural::clone() const
+{
+ QUmlLiteralUnlimitedNatural *c = new QUmlLiteralUnlimitedNatural;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ c->setValue(value());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The specified UnlimitedNatural value.
*/
-int
-QUmlLiteralUnlimitedNatural::value() const
+int QUmlLiteralUnlimitedNatural::value() const
{
// This is a read-write property
diff --git a/src/uml/qumlliteralunlimitednatural.h b/src/uml/qumlliteralunlimitednatural.h
index 661904b8..34863d99 100644
--- a/src/uml/qumlliteralunlimitednatural.h
+++ b/src/uml/qumlliteralunlimitednatural.h
@@ -58,6 +58,8 @@ public:
explicit QUmlLiteralUnlimitedNatural(bool createQObject = true);
virtual ~QUmlLiteralUnlimitedNatural();
+ QModelingObject *clone() const;
+
// Owned attributes
int value() const;
void setValue(int value);
diff --git a/src/uml/qumlloopnode.cpp b/src/uml/qumlloopnode.cpp
index d545ce96..ff2f1dea 100644
--- a/src/uml/qumlloopnode.cpp
+++ b/src/uml/qumlloopnode.cpp
@@ -42,10 +42,31 @@
#include "private/qumlloopnodeobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlExecutableNode>
#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlVariable>
/*!
\class QUmlLoopNode
@@ -70,13 +91,78 @@ QUmlLoopNode::~QUmlLoopNode()
}
}
+QModelingObject *QUmlLoopNode::clone() const
+{
+ QUmlLoopNode *c = new QUmlLoopNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlActivityEdge *element, edge())
+ c->addEdge(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ c->setMustIsolate(mustIsolate());
+ foreach (QUmlActivityNode *element, node())
+ c->addNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlVariable *element, variable())
+ c->addVariable(dynamic_cast<QUmlVariable *>(element->clone()));
+ foreach (QUmlOutputPin *element, bodyOutput())
+ c->addBodyOutput(dynamic_cast<QUmlOutputPin *>(element->clone()));
+ foreach (QUmlExecutableNode *element, bodyPart())
+ c->addBodyPart(dynamic_cast<QUmlExecutableNode *>(element->clone()));
+ if (decider())
+ c->setDecider(dynamic_cast<QUmlOutputPin *>(decider()->clone()));
+ c->setTestedFirst(isTestedFirst());
+ foreach (QUmlOutputPin *element, loopVariable())
+ c->addLoopVariable(dynamic_cast<QUmlOutputPin *>(element->clone()));
+ foreach (QUmlInputPin *element, loopVariableInput())
+ c->addLoopVariableInput(dynamic_cast<QUmlInputPin *>(element->clone()));
+ foreach (QUmlOutputPin *element, result())
+ c->addResult(dynamic_cast<QUmlOutputPin *>(element->clone()));
+ foreach (QUmlExecutableNode *element, setupPart())
+ c->addSetupPart(dynamic_cast<QUmlExecutableNode *>(element->clone()));
+ foreach (QUmlExecutableNode *element, test())
+ c->addTest(dynamic_cast<QUmlExecutableNode *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
A list of output pins within the body fragment the values of which are moved to the loop variable pins after completion of execution of the body, before the next iteration of the loop begins or before the loop exits.
*/
-const QList<QUmlOutputPin *>
-QUmlLoopNode::bodyOutput() const
+const QList<QUmlOutputPin *> QUmlLoopNode::bodyOutput() const
{
// This is a read-write association end
@@ -106,8 +192,7 @@ void QUmlLoopNode::removeBodyOutput(QUmlOutputPin *bodyOutput)
/*!
The set of nodes and edges that perform the repetitive computations of the loop. The body section is executed as long as the test section produces a true value.
*/
-const QSet<QUmlExecutableNode *>
-QUmlLoopNode::bodyPart() const
+const QSet<QUmlExecutableNode *> QUmlLoopNode::bodyPart() const
{
// This is a read-write association end
@@ -137,8 +222,7 @@ void QUmlLoopNode::removeBodyPart(QUmlExecutableNode *bodyPart)
/*!
An output pin within the test fragment the value of which is examined after execution of the test to determine whether to execute the loop body.
*/
-QUmlOutputPin *
-QUmlLoopNode::decider() const
+QUmlOutputPin *QUmlLoopNode::decider() const
{
// This is a read-write association end
@@ -159,8 +243,7 @@ void QUmlLoopNode::setDecider(QUmlOutputPin *decider)
/*!
If true, the test is performed before the first execution of the body. If false, the body is executed once before the test is performed.
*/
-bool
-QUmlLoopNode::isTestedFirst() const
+bool QUmlLoopNode::isTestedFirst() const
{
// This is a read-write property
@@ -179,8 +262,7 @@ void QUmlLoopNode::setTestedFirst(bool isTestedFirst)
/*!
A list of output pins that hold the values of the loop variables during an execution of the loop. When the test fails, the values are movied to the result pins of the loop.
*/
-const QList<QUmlOutputPin *>
-QUmlLoopNode::loopVariable() const
+const QList<QUmlOutputPin *> QUmlLoopNode::loopVariable() const
{
// This is a read-write association end
@@ -210,8 +292,7 @@ void QUmlLoopNode::removeLoopVariable(QUmlOutputPin *loopVariable)
/*!
A list of values that are moved into the loop variable pins before the first iteration of the loop.
*/
-const QList<QUmlInputPin *>
-QUmlLoopNode::loopVariableInput() const
+const QList<QUmlInputPin *> QUmlLoopNode::loopVariableInput() const
{
// This is a read-write association end
@@ -244,8 +325,7 @@ void QUmlLoopNode::removeLoopVariableInput(QUmlInputPin *loopVariableInput)
/*!
A list of output pins that constitute the data flow output of the entire loop.
*/
-const QList<QUmlOutputPin *>
-QUmlLoopNode::result() const
+const QList<QUmlOutputPin *> QUmlLoopNode::result() const
{
// This is a read-write association end
@@ -278,8 +358,7 @@ void QUmlLoopNode::removeResult(QUmlOutputPin *result)
/*!
The set of nodes and edges that initialize values or perform other setup computations for the loop.
*/
-const QSet<QUmlExecutableNode *>
-QUmlLoopNode::setupPart() const
+const QSet<QUmlExecutableNode *> QUmlLoopNode::setupPart() const
{
// This is a read-write association end
@@ -309,8 +388,7 @@ void QUmlLoopNode::removeSetupPart(QUmlExecutableNode *setupPart)
/*!
The set of nodes, edges, and designated value that compute a Boolean value to determine if another execution of the body will be performed.
*/
-const QSet<QUmlExecutableNode *>
-QUmlLoopNode::test() const
+const QSet<QUmlExecutableNode *> QUmlLoopNode::test() const
{
// This is a read-write association end
diff --git a/src/uml/qumlloopnode.h b/src/uml/qumlloopnode.h
index 9a74fd79..bf3fb0a7 100644
--- a/src/uml/qumlloopnode.h
+++ b/src/uml/qumlloopnode.h
@@ -62,6 +62,8 @@ public:
explicit QUmlLoopNode(bool createQObject = true);
virtual ~QUmlLoopNode();
+ QModelingObject *clone() const;
+
// Owned attributes
const QList<QUmlOutputPin *> bodyOutput() const;
void addBodyOutput(QUmlOutputPin *bodyOutput);
diff --git a/src/uml/qumlmanifestation.cpp b/src/uml/qumlmanifestation.cpp
index de1aace6..a92575d7 100644
--- a/src/uml/qumlmanifestation.cpp
+++ b/src/uml/qumlmanifestation.cpp
@@ -42,8 +42,17 @@
#include "private/qumlmanifestationobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOpaqueExpression>
+#include <QtUml/QUmlPackage>
#include <QtUml/QUmlPackageableElement>
-
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlManifestation
@@ -67,13 +76,38 @@ QUmlManifestation::~QUmlManifestation()
}
}
+QModelingObject *QUmlManifestation::clone() const
+{
+ QUmlManifestation *c = new QUmlManifestation;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlNamedElement *element, client())
+ c->addClient(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ foreach (QUmlNamedElement *element, supplier())
+ c->addSupplier(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ if (mapping())
+ c->setMapping(dynamic_cast<QUmlOpaqueExpression *>(mapping()->clone()));
+ if (utilizedElement())
+ c->setUtilizedElement(dynamic_cast<QUmlPackageableElement *>(utilizedElement()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The model element that is utilized in the manifestation in an Artifact.
*/
-QUmlPackageableElement *
-QUmlManifestation::utilizedElement() const
+QUmlPackageableElement *QUmlManifestation::utilizedElement() const
{
// This is a read-write association end
diff --git a/src/uml/qumlmanifestation.h b/src/uml/qumlmanifestation.h
index 94c1d4b8..5c8692c2 100644
--- a/src/uml/qumlmanifestation.h
+++ b/src/uml/qumlmanifestation.h
@@ -60,6 +60,8 @@ public:
explicit QUmlManifestation(bool createQObject = true);
virtual ~QUmlManifestation();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlPackageableElement *utilizedElement() const;
void setUtilizedElement(QUmlPackageableElement *utilizedElement);
diff --git a/src/uml/qumlmergenode.cpp b/src/uml/qumlmergenode.cpp
index 709a3d5d..51d0aebf 100644
--- a/src/uml/qumlmergenode.cpp
+++ b/src/uml/qumlmergenode.cpp
@@ -42,6 +42,22 @@
#include "private/qumlmergenodeobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlMergeNode
@@ -63,3 +79,32 @@ QUmlMergeNode::~QUmlMergeNode()
}
}
+QModelingObject *QUmlMergeNode::clone() const
+{
+ QUmlMergeNode *c = new QUmlMergeNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlmergenode.h b/src/uml/qumlmergenode.h
index 3cafd69c..17648c7a 100644
--- a/src/uml/qumlmergenode.h
+++ b/src/uml/qumlmergenode.h
@@ -58,6 +58,8 @@ public:
explicit QUmlMergeNode(bool createQObject = true);
virtual ~QUmlMergeNode();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlmessage.cpp b/src/uml/qumlmessage.cpp
index 1b1e9c14..035e850e 100644
--- a/src/uml/qumlmessage.cpp
+++ b/src/uml/qumlmessage.cpp
@@ -42,11 +42,17 @@
#include "private/qumlmessageobject_p.h"
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlInteraction>
#include <QtUml/QUmlMessageEnd>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlValueSpecification>
-
/*!
\class QUmlMessage
@@ -74,13 +80,39 @@ QUmlMessage::~QUmlMessage()
}
}
+QModelingObject *QUmlMessage::clone() const
+{
+ QUmlMessage *c = new QUmlMessage;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlValueSpecification *element, argument())
+ c->addArgument(dynamic_cast<QUmlValueSpecification *>(element->clone()));
+ if (connector())
+ c->setConnector(dynamic_cast<QUmlConnector *>(connector()->clone()));
+ if (interaction())
+ c->setInteraction(dynamic_cast<QUmlInteraction *>(interaction()->clone()));
+ c->setMessageSort(messageSort());
+ if (receiveEvent())
+ c->setReceiveEvent(dynamic_cast<QUmlMessageEnd *>(receiveEvent()->clone()));
+ if (sendEvent())
+ c->setSendEvent(dynamic_cast<QUmlMessageEnd *>(sendEvent()->clone()));
+ if (signature())
+ c->setSignature(dynamic_cast<QUmlNamedElement *>(signature()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The arguments of the Message
*/
-const QList<QUmlValueSpecification *>
-QUmlMessage::argument() const
+const QList<QUmlValueSpecification *> QUmlMessage::argument() const
{
// This is a read-write association end
@@ -119,8 +151,7 @@ void QUmlMessage::removeArgument(QUmlValueSpecification *argument)
/*!
The Connector on which this Message is sent.
*/
-QUmlConnector *
-QUmlMessage::connector() const
+QUmlConnector *QUmlMessage::connector() const
{
// This is a read-write association end
@@ -141,8 +172,7 @@ void QUmlMessage::setConnector(QUmlConnector *connector)
/*!
The enclosing Interaction owning the Message
*/
-QUmlInteraction *
-QUmlMessage::interaction() const
+QUmlInteraction *QUmlMessage::interaction() const
{
// This is a read-write association end
@@ -168,8 +198,7 @@ void QUmlMessage::setInteraction(QUmlInteraction *interaction)
/*!
The derived kind of the Message (complete, lost, found or unknown)
*/
-QtUml::MessageKind
-QUmlMessage::messageKind() const
+QtUml::MessageKind QUmlMessage::messageKind() const
{
// This is a read-only derived property
@@ -193,8 +222,7 @@ void QUmlMessage::setMessageKind(QtUml::MessageKind messageKind)
/*!
The sort of communication reflected by the Message
*/
-QtUml::MessageSort
-QUmlMessage::messageSort() const
+QtUml::MessageSort QUmlMessage::messageSort() const
{
// This is a read-write property
@@ -213,8 +241,7 @@ void QUmlMessage::setMessageSort(QtUml::MessageSort messageSort)
/*!
References the Receiving of the Message
*/
-QUmlMessageEnd *
-QUmlMessage::receiveEvent() const
+QUmlMessageEnd *QUmlMessage::receiveEvent() const
{
// This is a read-write association end
@@ -235,8 +262,7 @@ void QUmlMessage::setReceiveEvent(QUmlMessageEnd *receiveEvent)
/*!
References the Sending of the Message.
*/
-QUmlMessageEnd *
-QUmlMessage::sendEvent() const
+QUmlMessageEnd *QUmlMessage::sendEvent() const
{
// This is a read-write association end
@@ -257,8 +283,7 @@ void QUmlMessage::setSendEvent(QUmlMessageEnd *sendEvent)
/*!
The signature of the Message is the specification of its content. It refers either an Operation or a Signal.
*/
-QUmlNamedElement *
-QUmlMessage::signature() const
+QUmlNamedElement *QUmlMessage::signature() const
{
// This is a read-write association end
diff --git a/src/uml/qumlmessage.h b/src/uml/qumlmessage.h
index 47ea39bb..26420b4c 100644
--- a/src/uml/qumlmessage.h
+++ b/src/uml/qumlmessage.h
@@ -65,6 +65,8 @@ public:
explicit QUmlMessage(bool createQObject = true);
virtual ~QUmlMessage();
+ QModelingObject *clone() const;
+
// Owned attributes
const QList<QUmlValueSpecification *> argument() const;
void addArgument(QUmlValueSpecification *argument);
diff --git a/src/uml/qumlmessageend.cpp b/src/uml/qumlmessageend.cpp
index 26cc9863..df863f15 100644
--- a/src/uml/qumlmessageend.cpp
+++ b/src/uml/qumlmessageend.cpp
@@ -40,8 +40,14 @@
****************************************************************************/
#include "qumlmessageend.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlMessage>
-
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlMessageEnd
@@ -58,13 +64,28 @@ QUmlMessageEnd::~QUmlMessageEnd()
{
}
+QModelingObject *QUmlMessageEnd::clone() const
+{
+ QUmlMessageEnd *c = new QUmlMessageEnd;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (message())
+ c->setMessage(dynamic_cast<QUmlMessage *>(message()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References a Message.
*/
-QUmlMessage *
-QUmlMessageEnd::message() const
+QUmlMessage *QUmlMessageEnd::message() const
{
// This is a read-write association end
diff --git a/src/uml/qumlmessageend.h b/src/uml/qumlmessageend.h
index d43272e0..f223c5a0 100644
--- a/src/uml/qumlmessageend.h
+++ b/src/uml/qumlmessageend.h
@@ -59,6 +59,8 @@ class Q_UML_EXPORT QUmlMessageEnd : public virtual QUmlNamedElement
public:
virtual ~QUmlMessageEnd();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QUmlMessage *message() const;
void setMessage(QUmlMessage *message);
diff --git a/src/uml/qumlmessageevent.cpp b/src/uml/qumlmessageevent.cpp
index 772b9ad8..6e6362b2 100644
--- a/src/uml/qumlmessageevent.cpp
+++ b/src/uml/qumlmessageevent.cpp
@@ -40,6 +40,15 @@
****************************************************************************/
#include "qumlmessageevent.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlMessageEvent
@@ -55,3 +64,21 @@ QUmlMessageEvent::~QUmlMessageEvent()
{
}
+QModelingObject *QUmlMessageEvent::clone() const
+{
+ QUmlMessageEvent *c = new QUmlMessageEvent;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ return c;
+}
+
diff --git a/src/uml/qumlmessageevent.h b/src/uml/qumlmessageevent.h
index 5f37f0b8..d1f13633 100644
--- a/src/uml/qumlmessageevent.h
+++ b/src/uml/qumlmessageevent.h
@@ -57,6 +57,8 @@ class Q_UML_EXPORT QUmlMessageEvent : public QUmlEvent
public:
virtual ~QUmlMessageEvent();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
protected:
explicit QUmlMessageEvent();
diff --git a/src/uml/qumlmessageoccurrencespecification.cpp b/src/uml/qumlmessageoccurrencespecification.cpp
index 731fe376..3c18613c 100644
--- a/src/uml/qumlmessageoccurrencespecification.cpp
+++ b/src/uml/qumlmessageoccurrencespecification.cpp
@@ -42,6 +42,18 @@
#include "private/qumlmessageoccurrencespecificationobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlGeneralOrdering>
+#include <QtUml/QUmlInteraction>
+#include <QtUml/QUmlInteractionOperand>
+#include <QtUml/QUmlLifeline>
+#include <QtUml/QUmlMessage>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlMessageOccurrenceSpecification
@@ -64,3 +76,31 @@ QUmlMessageOccurrenceSpecification::~QUmlMessageOccurrenceSpecification()
}
}
+QModelingObject *QUmlMessageOccurrenceSpecification::clone() const
+{
+ QUmlMessageOccurrenceSpecification *c = new QUmlMessageOccurrenceSpecification;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (enclosingInteraction())
+ c->setEnclosingInteraction(dynamic_cast<QUmlInteraction *>(enclosingInteraction()->clone()));
+ if (enclosingOperand())
+ c->setEnclosingOperand(dynamic_cast<QUmlInteractionOperand *>(enclosingOperand()->clone()));
+ foreach (QUmlGeneralOrdering *element, generalOrdering())
+ c->addGeneralOrdering(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ if (covered())
+ c->setCovered(dynamic_cast<QUmlLifeline *>(covered()->clone()));
+ foreach (QUmlGeneralOrdering *element, toAfter())
+ c->addToAfter(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ foreach (QUmlGeneralOrdering *element, toBefore())
+ c->addToBefore(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ if (message())
+ c->setMessage(dynamic_cast<QUmlMessage *>(message()->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlmessageoccurrencespecification.h b/src/uml/qumlmessageoccurrencespecification.h
index c83f2fe6..43163a9f 100644
--- a/src/uml/qumlmessageoccurrencespecification.h
+++ b/src/uml/qumlmessageoccurrencespecification.h
@@ -59,6 +59,8 @@ public:
explicit QUmlMessageOccurrenceSpecification(bool createQObject = true);
virtual ~QUmlMessageOccurrenceSpecification();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlmodel.cpp b/src/uml/qumlmodel.cpp
index 9c2914b2..01f8a28c 100644
--- a/src/uml/qumlmodel.cpp
+++ b/src/uml/qumlmodel.cpp
@@ -42,6 +42,26 @@
#include "private/qumlmodelobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlPackageMerge>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlProfile>
+#include <QtUml/QUmlProfileApplication>
+#include <QtUml/QUmlStereotype>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
/*!
\class QUmlModel
@@ -64,13 +84,50 @@ QUmlModel::~QUmlModel()
}
}
+QModelingObject *QUmlModel::clone() const
+{
+ QUmlModel *c = new QUmlModel;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ c->setURI(URI());
+ if (nestingPackage())
+ c->setNestingPackage(dynamic_cast<QUmlPackage *>(nestingPackage()->clone()));
+ foreach (QUmlPackageMerge *element, packageMerge())
+ c->addPackageMerge(dynamic_cast<QUmlPackageMerge *>(element->clone()));
+ foreach (QUmlPackageableElement *element, packagedElement())
+ c->addPackagedElement(dynamic_cast<QUmlPackageableElement *>(element->clone()));
+ foreach (QUmlProfileApplication *element, profileApplication())
+ c->addProfileApplication(dynamic_cast<QUmlProfileApplication *>(element->clone()));
+ c->setViewpoint(viewpoint());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The name of the viewpoint that is expressed by a model (This name may refer to a profile definition).
*/
-QString
-QUmlModel::viewpoint() const
+QString QUmlModel::viewpoint() const
{
// This is a read-write property
diff --git a/src/uml/qumlmodel.h b/src/uml/qumlmodel.h
index 1103551e..a694cf76 100644
--- a/src/uml/qumlmodel.h
+++ b/src/uml/qumlmodel.h
@@ -58,6 +58,8 @@ public:
explicit QUmlModel(bool createQObject = true);
virtual ~QUmlModel();
+ QModelingObject *clone() const;
+
// Owned attributes
QString viewpoint() const;
void setViewpoint(QString viewpoint);
diff --git a/src/uml/qumlmultiplicityelement.cpp b/src/uml/qumlmultiplicityelement.cpp
index d6cc59ad..ed754391 100644
--- a/src/uml/qumlmultiplicityelement.cpp
+++ b/src/uml/qumlmultiplicityelement.cpp
@@ -40,8 +40,9 @@
****************************************************************************/
#include "qumlmultiplicityelement.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlValueSpecification>
-
/*!
\class QUmlMultiplicityElement
@@ -61,13 +62,26 @@ QUmlMultiplicityElement::~QUmlMultiplicityElement()
{
}
+QModelingObject *QUmlMultiplicityElement::clone() const
+{
+ QUmlMultiplicityElement *c = new QUmlMultiplicityElement;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ c->setOrdered(isOrdered());
+ c->setUnique(isUnique());
+ if (lowerValue())
+ c->setLowerValue(dynamic_cast<QUmlValueSpecification *>(lowerValue()->clone()));
+ if (upperValue())
+ c->setUpperValue(dynamic_cast<QUmlValueSpecification *>(upperValue()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
For a multivalued multiplicity, this attribute specifies whether the values in an instantiation of this element are sequentially ordered.
*/
-bool
-QUmlMultiplicityElement::isOrdered() const
+bool QUmlMultiplicityElement::isOrdered() const
{
// This is a read-write property
@@ -86,8 +100,7 @@ void QUmlMultiplicityElement::setOrdered(bool isOrdered)
/*!
For a multivalued multiplicity, this attributes specifies whether the values in an instantiation of this element are unique.
*/
-bool
-QUmlMultiplicityElement::isUnique() const
+bool QUmlMultiplicityElement::isUnique() const
{
// This is a read-write property
@@ -106,8 +119,7 @@ void QUmlMultiplicityElement::setUnique(bool isUnique)
/*!
Specifies the lower bound of the multiplicity interval.
*/
-int
-QUmlMultiplicityElement::lower() const
+int QUmlMultiplicityElement::lower() const
{
// This is a read-write derived property
@@ -131,8 +143,7 @@ void QUmlMultiplicityElement::setLower(int lower)
/*!
The specification of the lower bound for this multiplicity.
*/
-QUmlValueSpecification *
-QUmlMultiplicityElement::lowerValue() const
+QUmlValueSpecification *QUmlMultiplicityElement::lowerValue() const
{
// This is a read-write association end
@@ -162,8 +173,7 @@ void QUmlMultiplicityElement::setLowerValue(QUmlValueSpecification *lowerValue)
/*!
Specifies the upper bound of the multiplicity interval.
*/
-int
-QUmlMultiplicityElement::upper() const
+int QUmlMultiplicityElement::upper() const
{
// This is a read-write derived property
@@ -187,8 +197,7 @@ void QUmlMultiplicityElement::setUpper(int upper)
/*!
The specification of the upper bound for this multiplicity.
*/
-QUmlValueSpecification *
-QUmlMultiplicityElement::upperValue() const
+QUmlValueSpecification *QUmlMultiplicityElement::upperValue() const
{
// This is a read-write association end
diff --git a/src/uml/qumlmultiplicityelement.h b/src/uml/qumlmultiplicityelement.h
index aad7a453..84249d51 100644
--- a/src/uml/qumlmultiplicityelement.h
+++ b/src/uml/qumlmultiplicityelement.h
@@ -59,6 +59,8 @@ class Q_UML_EXPORT QUmlMultiplicityElement : public virtual QUmlElement
public:
virtual ~QUmlMultiplicityElement();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
bool isOrdered() const;
void setOrdered(bool isOrdered);
diff --git a/src/uml/qumlnamedelement.cpp b/src/uml/qumlnamedelement.cpp
index 6dc49e13..08c2fa69 100644
--- a/src/uml/qumlnamedelement.cpp
+++ b/src/uml/qumlnamedelement.cpp
@@ -40,11 +40,12 @@
****************************************************************************/
#include "qumlnamedelement.h"
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlPackage>
#include <QtUml/QUmlStringExpression>
-
/*!
\class QUmlNamedElement
@@ -62,13 +63,26 @@ QUmlNamedElement::~QUmlNamedElement()
{
}
+QModelingObject *QUmlNamedElement::clone() const
+{
+ QUmlNamedElement *c = new QUmlNamedElement;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Indicates the dependencies that reference the client.
*/
-const QSet<QUmlDependency *>
-QUmlNamedElement::clientDependency() const
+const QSet<QUmlDependency *> QUmlNamedElement::clientDependency() const
{
// This is a read-write association end
@@ -108,8 +122,7 @@ void QUmlNamedElement::removeClientDependency(QUmlDependency *clientDependency)
/*!
The name of the NamedElement.
*/
-QString
-QUmlNamedElement::name() const
+QString QUmlNamedElement::name() const
{
// This is a read-write property
@@ -128,8 +141,7 @@ void QUmlNamedElement::setName(QString name)
/*!
The string expression used to define the name of this named element.
*/
-QUmlStringExpression *
-QUmlNamedElement::nameExpression() const
+QUmlStringExpression *QUmlNamedElement::nameExpression() const
{
// This is a read-write association end
@@ -159,8 +171,7 @@ void QUmlNamedElement::setNameExpression(QUmlStringExpression *nameExpression)
/*!
Specifies the namespace that owns the NamedElement.
*/
-QUmlNamespace *
-QUmlNamedElement::namespace_() const
+QUmlNamespace *QUmlNamedElement::namespace_() const
{
// This is a read-only derived union association end
@@ -186,8 +197,7 @@ void QUmlNamedElement::setNamespace(QUmlNamespace *namespace_)
/*!
A name which allows the NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from the names of the containing namespaces starting at the root of the hierarchy and ending with the name of the NamedElement itself.
*/
-QString
-QUmlNamedElement::qualifiedName() const
+QString QUmlNamedElement::qualifiedName() const
{
// This is a read-only derived property
@@ -211,8 +221,7 @@ void QUmlNamedElement::setQualifiedName(QString qualifiedName)
/*!
Determines where the NamedElement appears within different Namespaces within the overall model, and its accessibility.
*/
-QtUml::VisibilityKind
-QUmlNamedElement::visibility() const
+QtUml::VisibilityKind QUmlNamedElement::visibility() const
{
// This is a read-write property
diff --git a/src/uml/qumlnamedelement.h b/src/uml/qumlnamedelement.h
index a7043aad..70df4bdc 100644
--- a/src/uml/qumlnamedelement.h
+++ b/src/uml/qumlnamedelement.h
@@ -64,6 +64,8 @@ class Q_UML_EXPORT QUmlNamedElement : public virtual QUmlElement
public:
virtual ~QUmlNamedElement();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlDependency *> clientDependency() const;
void addClientDependency(QUmlDependency *clientDependency);
diff --git a/src/uml/qumlnamespace.cpp b/src/uml/qumlnamespace.cpp
index 0c08c445..afce7878 100644
--- a/src/uml/qumlnamespace.cpp
+++ b/src/uml/qumlnamespace.cpp
@@ -40,11 +40,16 @@
****************************************************************************/
#include "qumlnamespace.h"
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlPackage>
#include <QtUml/QUmlPackageableElement>
#include <QtUml/QUmlPackageImport>
-
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlNamespace
@@ -60,13 +65,32 @@ QUmlNamespace::~QUmlNamespace()
{
}
+QModelingObject *QUmlNamespace::clone() const
+{
+ QUmlNamespace *c = new QUmlNamespace;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the ElementImports owned by the Namespace.
*/
-const QSet<QUmlElementImport *>
-QUmlNamespace::elementImport() const
+const QSet<QUmlElementImport *> QUmlNamespace::elementImport() const
{
// This is a read-write association end
@@ -115,8 +139,7 @@ void QUmlNamespace::removeElementImport(QUmlElementImport *elementImport)
/*!
References the PackageableElements that are members of this Namespace as a result of either PackageImports or ElementImports.
*/
-const QSet<QUmlPackageableElement *>
-QUmlNamespace::importedMember() const
+const QSet<QUmlPackageableElement *> QUmlNamespace::importedMember() const
{
// This is a read-only derived association end
@@ -158,8 +181,7 @@ void QUmlNamespace::removeImportedMember(QUmlPackageableElement *importedMember)
/*!
A collection of NamedElements identifiable within the Namespace, either by being owned or by being introduced by importing or inheritance.
*/
-const QSet<QUmlNamedElement *>
-QUmlNamespace::member() const
+const QSet<QUmlNamedElement *> QUmlNamespace::member() const
{
// This is a read-only derived union association end
@@ -189,8 +211,7 @@ void QUmlNamespace::removeMember(QUmlNamedElement *member)
/*!
A collection of NamedElements owned by the Namespace.
*/
-const QSet<QUmlNamedElement *>
-QUmlNamespace::ownedMember() const
+const QSet<QUmlNamedElement *> QUmlNamespace::ownedMember() const
{
// This is a read-only derived union association end
@@ -241,8 +262,7 @@ void QUmlNamespace::removeOwnedMember(QUmlNamedElement *ownedMember)
/*!
Specifies a set of Constraints owned by this Namespace.
*/
-const QSet<QUmlConstraint *>
-QUmlNamespace::ownedRule() const
+const QSet<QUmlConstraint *> QUmlNamespace::ownedRule() const
{
// This is a read-write association end
@@ -291,8 +311,7 @@ void QUmlNamespace::removeOwnedRule(QUmlConstraint *ownedRule)
/*!
References the PackageImports owned by the Namespace.
*/
-const QSet<QUmlPackageImport *>
-QUmlNamespace::packageImport() const
+const QSet<QUmlPackageImport *> QUmlNamespace::packageImport() const
{
// This is a read-write association end
diff --git a/src/uml/qumlnamespace.h b/src/uml/qumlnamespace.h
index bea7c537..69fa24ec 100644
--- a/src/uml/qumlnamespace.h
+++ b/src/uml/qumlnamespace.h
@@ -62,6 +62,8 @@ class Q_UML_EXPORT QUmlNamespace : public virtual QUmlNamedElement
public:
virtual ~QUmlNamespace();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlElementImport *> elementImport() const;
void addElementImport(QUmlElementImport *elementImport);
diff --git a/src/uml/qumlnode.cpp b/src/uml/qumlnode.cpp
index 9c202a58..9cff723b 100644
--- a/src/uml/qumlnode.cpp
+++ b/src/uml/qumlnode.cpp
@@ -42,6 +42,43 @@
#include "private/qumlnodeobject_p.h"
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClass>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElement>
+#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlDeployment>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExtension>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlInterfaceRealization>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlReception>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlNode
@@ -64,13 +101,82 @@ QUmlNode::~QUmlNode()
}
}
+QModelingObject *QUmlNode::clone() const
+{
+ QUmlNode *c = new QUmlNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlConnector *element, ownedConnector())
+ c->addOwnedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setActive(isActive());
+ foreach (QUmlClassifier *element, nestedClassifier())
+ c->addNestedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ foreach (QUmlReception *element, ownedReception())
+ c->addOwnedReception(dynamic_cast<QUmlReception *>(element->clone()));
+ foreach (QUmlDeployment *element, deployment())
+ c->addDeployment(dynamic_cast<QUmlDeployment *>(element->clone()));
+ foreach (QUmlNode *element, nestedNode())
+ c->addNestedNode(dynamic_cast<QUmlNode *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The Nodes that are defined (nested) within the Node.
*/
-const QSet<QUmlNode *>
-QUmlNode::nestedNode() const
+const QSet<QUmlNode *> QUmlNode::nestedNode() const
{
// This is a read-write association end
diff --git a/src/uml/qumlnode.h b/src/uml/qumlnode.h
index 1e188716..758422e9 100644
--- a/src/uml/qumlnode.h
+++ b/src/uml/qumlnode.h
@@ -59,6 +59,8 @@ public:
explicit QUmlNode(bool createQObject = true);
virtual ~QUmlNode();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlNode *> nestedNode() const;
void addNestedNode(QUmlNode *nestedNode);
diff --git a/src/uml/qumlobjectflow.cpp b/src/uml/qumlobjectflow.cpp
index 518d5230..76714138 100644
--- a/src/uml/qumlobjectflow.cpp
+++ b/src/uml/qumlobjectflow.cpp
@@ -42,8 +42,24 @@
#include "private/qumlobjectflowobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
#include <QtUml/QUmlBehavior>
-
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlObjectFlow
@@ -69,13 +85,51 @@ QUmlObjectFlow::~QUmlObjectFlow()
}
}
+QModelingObject *QUmlObjectFlow::clone() const
+{
+ QUmlObjectFlow *c = new QUmlObjectFlow;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ if (guard())
+ c->setGuard(dynamic_cast<QUmlValueSpecification *>(guard()->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ if (interrupts())
+ c->setInterrupts(dynamic_cast<QUmlInterruptibleActivityRegion *>(interrupts()->clone()));
+ foreach (QUmlActivityEdge *element, redefinedEdge())
+ c->addRedefinedEdge(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ if (source())
+ c->setSource(dynamic_cast<QUmlActivityNode *>(source()->clone()));
+ if (target())
+ c->setTarget(dynamic_cast<QUmlActivityNode *>(target()->clone()));
+ if (weight())
+ c->setWeight(dynamic_cast<QUmlValueSpecification *>(weight()->clone()));
+ c->setMulticast(isMulticast());
+ c->setMultireceive(isMultireceive());
+ if (selection())
+ c->setSelection(dynamic_cast<QUmlBehavior *>(selection()->clone()));
+ if (transformation())
+ c->setTransformation(dynamic_cast<QUmlBehavior *>(transformation()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Tells whether the objects in the flow are passed by multicasting.
*/
-bool
-QUmlObjectFlow::isMulticast() const
+bool QUmlObjectFlow::isMulticast() const
{
// This is a read-write property
@@ -94,8 +148,7 @@ void QUmlObjectFlow::setMulticast(bool isMulticast)
/*!
Tells whether the objects in the flow are gathered from respondents to multicasting.
*/
-bool
-QUmlObjectFlow::isMultireceive() const
+bool QUmlObjectFlow::isMultireceive() const
{
// This is a read-write property
@@ -114,8 +167,7 @@ void QUmlObjectFlow::setMultireceive(bool isMultireceive)
/*!
Selects tokens from a source object node.
*/
-QUmlBehavior *
-QUmlObjectFlow::selection() const
+QUmlBehavior *QUmlObjectFlow::selection() const
{
// This is a read-write association end
@@ -136,8 +188,7 @@ void QUmlObjectFlow::setSelection(QUmlBehavior *selection)
/*!
Changes or replaces data tokens flowing along edge.
*/
-QUmlBehavior *
-QUmlObjectFlow::transformation() const
+QUmlBehavior *QUmlObjectFlow::transformation() const
{
// This is a read-write association end
diff --git a/src/uml/qumlobjectflow.h b/src/uml/qumlobjectflow.h
index ff037d5e..84c00df2 100644
--- a/src/uml/qumlobjectflow.h
+++ b/src/uml/qumlobjectflow.h
@@ -60,6 +60,8 @@ public:
explicit QUmlObjectFlow(bool createQObject = true);
virtual ~QUmlObjectFlow();
+ QModelingObject *clone() const;
+
// Owned attributes
bool isMulticast() const;
void setMulticast(bool isMulticast);
diff --git a/src/uml/qumlobjectnode.cpp b/src/uml/qumlobjectnode.cpp
index 3a22f389..15ee579f 100644
--- a/src/uml/qumlobjectnode.cpp
+++ b/src/uml/qumlobjectnode.cpp
@@ -40,10 +40,26 @@
****************************************************************************/
#include "qumlobjectnode.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
#include <QtUml/QUmlState>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlType>
#include <QtUml/QUmlValueSpecification>
-
/*!
\class QUmlObjectNode
@@ -63,13 +79,51 @@ QUmlObjectNode::~QUmlObjectNode()
{
}
+QModelingObject *QUmlObjectNode::clone() const
+{
+ QUmlObjectNode *c = new QUmlObjectNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ foreach (QUmlState *element, inState())
+ c->addInState(dynamic_cast<QUmlState *>(element->clone()));
+ c->setControlType(isControlType());
+ c->setOrdering(ordering());
+ if (selection())
+ c->setSelection(dynamic_cast<QUmlBehavior *>(selection()->clone()));
+ if (upperBound())
+ c->setUpperBound(dynamic_cast<QUmlValueSpecification *>(upperBound()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The required states of the object available at this point in the activity.
*/
-const QSet<QUmlState *>
-QUmlObjectNode::inState() const
+const QSet<QUmlState *> QUmlObjectNode::inState() const
{
// This is a read-write association end
@@ -99,8 +153,7 @@ void QUmlObjectNode::removeInState(QUmlState *inState)
/*!
Tells whether the type of the object node is to be treated as control.
*/
-bool
-QUmlObjectNode::isControlType() const
+bool QUmlObjectNode::isControlType() const
{
// This is a read-write property
@@ -119,8 +172,7 @@ void QUmlObjectNode::setControlType(bool isControlType)
/*!
Tells whether and how the tokens in the object node are ordered for selection to traverse edges outgoing from the object node.
*/
-QtUml::ObjectNodeOrderingKind
-QUmlObjectNode::ordering() const
+QtUml::ObjectNodeOrderingKind QUmlObjectNode::ordering() const
{
// This is a read-write property
@@ -139,8 +191,7 @@ void QUmlObjectNode::setOrdering(QtUml::ObjectNodeOrderingKind ordering)
/*!
Selects tokens for outgoing edges.
*/
-QUmlBehavior *
-QUmlObjectNode::selection() const
+QUmlBehavior *QUmlObjectNode::selection() const
{
// This is a read-write association end
@@ -161,8 +212,7 @@ void QUmlObjectNode::setSelection(QUmlBehavior *selection)
/*!
The maximum number of tokens allowed in the node. Objects cannot flow into the node if the upper bound is reached.
*/
-QUmlValueSpecification *
-QUmlObjectNode::upperBound() const
+QUmlValueSpecification *QUmlObjectNode::upperBound() const
{
// This is a read-write association end
diff --git a/src/uml/qumlobjectnode.h b/src/uml/qumlobjectnode.h
index 61b926fe..17acef70 100644
--- a/src/uml/qumlobjectnode.h
+++ b/src/uml/qumlobjectnode.h
@@ -64,6 +64,8 @@ class Q_UML_EXPORT QUmlObjectNode : public QUmlActivityNode, public QUmlTypedEle
public:
virtual ~QUmlObjectNode();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlState *> inState() const;
void addInState(QUmlState *inState);
diff --git a/src/uml/qumlobservation.cpp b/src/uml/qumlobservation.cpp
index 0f7cac8a..0983ff40 100644
--- a/src/uml/qumlobservation.cpp
+++ b/src/uml/qumlobservation.cpp
@@ -40,6 +40,15 @@
****************************************************************************/
#include "qumlobservation.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlObservation
@@ -55,3 +64,21 @@ QUmlObservation::~QUmlObservation()
{
}
+QModelingObject *QUmlObservation::clone() const
+{
+ QUmlObservation *c = new QUmlObservation;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ return c;
+}
+
diff --git a/src/uml/qumlobservation.h b/src/uml/qumlobservation.h
index 01d9baa1..0fddad5a 100644
--- a/src/uml/qumlobservation.h
+++ b/src/uml/qumlobservation.h
@@ -57,6 +57,8 @@ class Q_UML_EXPORT QUmlObservation : public QUmlPackageableElement
public:
virtual ~QUmlObservation();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
protected:
explicit QUmlObservation();
diff --git a/src/uml/qumloccurrencespecification.cpp b/src/uml/qumloccurrencespecification.cpp
index 350004d1..f01aa6d7 100644
--- a/src/uml/qumloccurrencespecification.cpp
+++ b/src/uml/qumloccurrencespecification.cpp
@@ -42,9 +42,17 @@
#include "private/qumloccurrencespecificationobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlGeneralOrdering>
+#include <QtUml/QUmlInteraction>
+#include <QtUml/QUmlInteractionOperand>
#include <QtUml/QUmlLifeline>
-
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlOccurrenceSpecification
@@ -67,13 +75,38 @@ QUmlOccurrenceSpecification::~QUmlOccurrenceSpecification()
}
}
+QModelingObject *QUmlOccurrenceSpecification::clone() const
+{
+ QUmlOccurrenceSpecification *c = new QUmlOccurrenceSpecification;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (enclosingInteraction())
+ c->setEnclosingInteraction(dynamic_cast<QUmlInteraction *>(enclosingInteraction()->clone()));
+ if (enclosingOperand())
+ c->setEnclosingOperand(dynamic_cast<QUmlInteractionOperand *>(enclosingOperand()->clone()));
+ foreach (QUmlGeneralOrdering *element, generalOrdering())
+ c->addGeneralOrdering(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ if (covered())
+ c->setCovered(dynamic_cast<QUmlLifeline *>(covered()->clone()));
+ foreach (QUmlGeneralOrdering *element, toAfter())
+ c->addToAfter(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ foreach (QUmlGeneralOrdering *element, toBefore())
+ c->addToBefore(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the Lifeline on which the OccurrenceSpecification appears.
*/
-QUmlLifeline *
-QUmlOccurrenceSpecification::covered() const
+QUmlLifeline *QUmlOccurrenceSpecification::covered() const
{
// This is a read-write association end
@@ -94,8 +127,7 @@ void QUmlOccurrenceSpecification::setCovered(QUmlLifeline *covered)
/*!
References the GeneralOrderings that specify EventOcurrences that must occur after this OccurrenceSpecification
*/
-const QSet<QUmlGeneralOrdering *>
-QUmlOccurrenceSpecification::toAfter() const
+const QSet<QUmlGeneralOrdering *> QUmlOccurrenceSpecification::toAfter() const
{
// This is a read-write association end
@@ -135,8 +167,7 @@ void QUmlOccurrenceSpecification::removeToAfter(QUmlGeneralOrdering *toAfter)
/*!
References the GeneralOrderings that specify EventOcurrences that must occur before this OccurrenceSpecification
*/
-const QSet<QUmlGeneralOrdering *>
-QUmlOccurrenceSpecification::toBefore() const
+const QSet<QUmlGeneralOrdering *> QUmlOccurrenceSpecification::toBefore() const
{
// This is a read-write association end
diff --git a/src/uml/qumloccurrencespecification.h b/src/uml/qumloccurrencespecification.h
index 04805f50..b18e7309 100644
--- a/src/uml/qumloccurrencespecification.h
+++ b/src/uml/qumloccurrencespecification.h
@@ -61,6 +61,8 @@ public:
explicit QUmlOccurrenceSpecification(bool createQObject = true);
virtual ~QUmlOccurrenceSpecification();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlLifeline *covered() const;
void setCovered(QUmlLifeline *covered);
diff --git a/src/uml/qumlopaqueaction.cpp b/src/uml/qumlopaqueaction.cpp
index 97042e9d..3f4480ad 100644
--- a/src/uml/qumlopaqueaction.cpp
+++ b/src/uml/qumlopaqueaction.cpp
@@ -42,9 +42,26 @@
#include "private/qumlopaqueactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlOpaqueAction
@@ -66,13 +83,54 @@ QUmlOpaqueAction::~QUmlOpaqueAction()
}
}
+QModelingObject *QUmlOpaqueAction::clone() const
+{
+ QUmlOpaqueAction *c = new QUmlOpaqueAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+// c->setBody(body());
+ foreach (QUmlInputPin *element, inputValue())
+ c->addInputValue(dynamic_cast<QUmlInputPin *>(element->clone()));
+// c->setLanguage(language());
+ foreach (QUmlOutputPin *element, outputValue())
+ c->addOutputValue(dynamic_cast<QUmlOutputPin *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies the action in one or more languages.
*/
-const QList<QString>
-QUmlOpaqueAction::body() const
+const QList<QString> QUmlOpaqueAction::body() const
{
// This is a read-write property
@@ -100,8 +158,7 @@ void QUmlOpaqueAction::removeBody(QString body)
/*!
Provides input to the action.
*/
-const QSet<QUmlInputPin *>
-QUmlOpaqueAction::inputValue() const
+const QSet<QUmlInputPin *> QUmlOpaqueAction::inputValue() const
{
// This is a read-write association end
@@ -140,8 +197,7 @@ void QUmlOpaqueAction::removeInputValue(QUmlInputPin *inputValue)
/*!
Languages the body strings use, in the same order as the body strings
*/
-const QList<QString>
-QUmlOpaqueAction::language() const
+const QList<QString> QUmlOpaqueAction::language() const
{
// This is a read-write property
@@ -169,8 +225,7 @@ void QUmlOpaqueAction::removeLanguage(QString language)
/*!
Takes output from the action.
*/
-const QSet<QUmlOutputPin *>
-QUmlOpaqueAction::outputValue() const
+const QSet<QUmlOutputPin *> QUmlOpaqueAction::outputValue() const
{
// This is a read-write association end
diff --git a/src/uml/qumlopaqueaction.h b/src/uml/qumlopaqueaction.h
index 056ac20f..610511f4 100644
--- a/src/uml/qumlopaqueaction.h
+++ b/src/uml/qumlopaqueaction.h
@@ -61,6 +61,8 @@ public:
explicit QUmlOpaqueAction(bool createQObject = true);
virtual ~QUmlOpaqueAction();
+ QModelingObject *clone() const;
+
// Owned attributes
const QList<QString> body() const;
void addBody(QString body);
diff --git a/src/uml/qumlopaquebehavior.cpp b/src/uml/qumlopaquebehavior.cpp
index f6c3e8c6..f4452943 100644
--- a/src/uml/qumlopaquebehavior.cpp
+++ b/src/uml/qumlopaquebehavior.cpp
@@ -42,6 +42,46 @@
#include "private/qumlopaquebehaviorobject_p.h"
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlBehavioralFeature>
+#include <QtUml/QUmlBehavioredClassifier>
+#include <QtUml/QUmlClass>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElement>
+#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExtension>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlInterfaceRealization>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameter>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlParameterSet>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlReception>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlOpaqueBehavior
@@ -63,13 +103,93 @@ QUmlOpaqueBehavior::~QUmlOpaqueBehavior()
}
}
+QModelingObject *QUmlOpaqueBehavior::clone() const
+{
+ QUmlOpaqueBehavior *c = new QUmlOpaqueBehavior;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlConnector *element, ownedConnector())
+ c->addOwnedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setActive(isActive());
+ foreach (QUmlClassifier *element, nestedClassifier())
+ c->addNestedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ foreach (QUmlReception *element, ownedReception())
+ c->addOwnedReception(dynamic_cast<QUmlReception *>(element->clone()));
+ c->setReentrant(isReentrant());
+ foreach (QUmlParameter *element, ownedParameter())
+ c->addOwnedParameter(dynamic_cast<QUmlParameter *>(element->clone()));
+ foreach (QUmlParameterSet *element, ownedParameterSet())
+ c->addOwnedParameterSet(dynamic_cast<QUmlParameterSet *>(element->clone()));
+ foreach (QUmlConstraint *element, postcondition())
+ c->addPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, precondition())
+ c->addPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlBehavior *element, redefinedBehavior())
+ c->addRedefinedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ if (specification())
+ c->setSpecification(dynamic_cast<QUmlBehavioralFeature *>(specification()->clone()));
+// c->setBody(body());
+// c->setLanguage(language());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies the behavior in one or more languages.
*/
-const QList<QString>
-QUmlOpaqueBehavior::body() const
+const QList<QString> QUmlOpaqueBehavior::body() const
{
// This is a read-write property
@@ -97,8 +217,7 @@ void QUmlOpaqueBehavior::removeBody(QString body)
/*!
Languages the body strings use in the same order as the body strings.
*/
-const QList<QString>
-QUmlOpaqueBehavior::language() const
+const QList<QString> QUmlOpaqueBehavior::language() const
{
// This is a read-write property
diff --git a/src/uml/qumlopaquebehavior.h b/src/uml/qumlopaquebehavior.h
index 58e051df..11e7c20e 100644
--- a/src/uml/qumlopaquebehavior.h
+++ b/src/uml/qumlopaquebehavior.h
@@ -58,6 +58,8 @@ public:
explicit QUmlOpaqueBehavior(bool createQObject = true);
virtual ~QUmlOpaqueBehavior();
+ QModelingObject *clone() const;
+
// Owned attributes
const QList<QString> body() const;
void addBody(QString body);
diff --git a/src/uml/qumlopaqueexpression.cpp b/src/uml/qumlopaqueexpression.cpp
index a164ec55..cdd31c84 100644
--- a/src/uml/qumlopaqueexpression.cpp
+++ b/src/uml/qumlopaqueexpression.cpp
@@ -43,8 +43,17 @@
#include "private/qumlopaqueexpressionobject_p.h"
#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
#include <QtUml/QUmlParameter>
-
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
/*!
\class QUmlOpaqueExpression
@@ -67,13 +76,36 @@ QUmlOpaqueExpression::~QUmlOpaqueExpression()
}
}
+QModelingObject *QUmlOpaqueExpression::clone() const
+{
+ QUmlOpaqueExpression *c = new QUmlOpaqueExpression;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (behavior())
+ c->setBehavior(dynamic_cast<QUmlBehavior *>(behavior()->clone()));
+// c->setBody(body());
+// c->setLanguage(language());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies the behavior of the opaque expression.
*/
-QUmlBehavior *
-QUmlOpaqueExpression::behavior() const
+QUmlBehavior *QUmlOpaqueExpression::behavior() const
{
// This is a read-write association end
@@ -94,8 +126,7 @@ void QUmlOpaqueExpression::setBehavior(QUmlBehavior *behavior)
/*!
The text of the expression, possibly in multiple languages.
*/
-const QList<QString>
-QUmlOpaqueExpression::body() const
+const QList<QString> QUmlOpaqueExpression::body() const
{
// This is a read-write property
@@ -123,8 +154,7 @@ void QUmlOpaqueExpression::removeBody(QString body)
/*!
Specifies the languages in which the expression is stated. The interpretation of the expression body depends on the languages. If the languages are unspecified, they might be implicit from the expression body or the context. Languages are matched to body strings by order.
*/
-const QList<QString>
-QUmlOpaqueExpression::language() const
+const QList<QString> QUmlOpaqueExpression::language() const
{
// This is a read-write property
@@ -152,8 +182,7 @@ void QUmlOpaqueExpression::removeLanguage(QString language)
/*!
Restricts an opaque expression to return exactly one return result. When the invocation of the opaque expression completes, a single set of values is returned to its owner. This association is derived from the single return result parameter of the associated behavior.
*/
-QUmlParameter *
-QUmlOpaqueExpression::result() const
+QUmlParameter *QUmlOpaqueExpression::result() const
{
// This is a read-only derived association end
diff --git a/src/uml/qumlopaqueexpression.h b/src/uml/qumlopaqueexpression.h
index 59a9103a..7c6df710 100644
--- a/src/uml/qumlopaqueexpression.h
+++ b/src/uml/qumlopaqueexpression.h
@@ -61,6 +61,8 @@ public:
explicit QUmlOpaqueExpression(bool createQObject = true);
virtual ~QUmlOpaqueExpression();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlBehavior *behavior() const;
void setBehavior(QUmlBehavior *behavior);
diff --git a/src/uml/qumloperation.cpp b/src/uml/qumloperation.cpp
index 1950a0c0..02179765 100644
--- a/src/uml/qumloperation.cpp
+++ b/src/uml/qumloperation.cpp
@@ -42,15 +42,31 @@
#include "private/qumloperationobject_p.h"
+#include <QtUml/QUmlBehavior>
#include <QtUml/QUmlClass>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConstraint>
#include <QtUml/QUmlDataType>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
#include <QtUml/QUmlInterface>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOperationTemplateParameter>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
#include <QtUml/QUmlParameter>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlParameterSet>
#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
#include <QtUml/QUmlType>
-
/*!
\class QUmlOperation
@@ -78,13 +94,67 @@ QUmlOperation::~QUmlOperation()
}
}
+QModelingObject *QUmlOperation::clone() const
+{
+ QUmlOperation *c = new QUmlOperation;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ c->setLeaf(isLeaf());
+ c->setStatic(isStatic());
+ c->setConcurrency(concurrency());
+ c->setAbstract(isAbstract());
+ foreach (QUmlBehavior *element, method())
+ c->addMethod(dynamic_cast<QUmlBehavior *>(element->clone()));
+ foreach (QUmlParameterSet *element, ownedParameterSet())
+ c->addOwnedParameterSet(dynamic_cast<QUmlParameterSet *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (bodyCondition())
+ c->setBodyCondition(dynamic_cast<QUmlConstraint *>(bodyCondition()->clone()));
+ if (class_())
+ c->setClass(dynamic_cast<QUmlClass *>(class_()->clone()));
+ if (datatype())
+ c->setDatatype(dynamic_cast<QUmlDataType *>(datatype()->clone()));
+ if (interface_())
+ c->setInterface(dynamic_cast<QUmlInterface *>(interface_()->clone()));
+ c->setQuery(isQuery());
+ foreach (QUmlParameter *element, ownedParameter())
+ c->addOwnedParameter(dynamic_cast<QUmlParameter *>(element->clone()));
+ foreach (QUmlConstraint *element, postcondition())
+ c->addPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, precondition())
+ c->addPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlType *element, raisedException())
+ c->addRaisedException(dynamic_cast<QUmlType *>(element->clone()));
+ foreach (QUmlOperation *element, redefinedOperation())
+ c->addRedefinedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlOperationTemplateParameter *>(templateParameter()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
An optional Constraint on the result values of an invocation of this Operation.
*/
-QUmlConstraint *
-QUmlOperation::bodyCondition() const
+QUmlConstraint *QUmlOperation::bodyCondition() const
{
// This is a read-write association end
@@ -114,8 +184,7 @@ void QUmlOperation::setBodyCondition(QUmlConstraint *bodyCondition)
/*!
The class that owns the operation.
*/
-QUmlClass *
-QUmlOperation::class_() const
+QUmlClass *QUmlOperation::class_() const
{
// This is a read-write association end
@@ -149,8 +218,7 @@ void QUmlOperation::setClass(QUmlClass *class_)
/*!
The DataType that owns this Operation.
*/
-QUmlDataType *
-QUmlOperation::datatype() const
+QUmlDataType *QUmlOperation::datatype() const
{
// This is a read-write association end
@@ -184,8 +252,7 @@ void QUmlOperation::setDatatype(QUmlDataType *datatype)
/*!
The Interface that owns this Operation.
*/
-QUmlInterface *
-QUmlOperation::interface_() const
+QUmlInterface *QUmlOperation::interface_() const
{
// This is a read-write association end
@@ -219,8 +286,7 @@ void QUmlOperation::setInterface(QUmlInterface *interface_)
/*!
This information is derived from the return result for this Operation.Specifies whether the return parameter is ordered or not, if present.
*/
-bool
-QUmlOperation::isOrdered() const
+bool QUmlOperation::isOrdered() const
{
// This is a read-only derived property
@@ -244,8 +310,7 @@ void QUmlOperation::setOrdered(bool isOrdered)
/*!
Specifies whether an execution of the BehavioralFeature leaves the state of the system unchanged (isQuery=true) or whether side effects may occur (isQuery=false).
*/
-bool
-QUmlOperation::isQuery() const
+bool QUmlOperation::isQuery() const
{
// This is a read-write property
@@ -264,8 +329,7 @@ void QUmlOperation::setQuery(bool isQuery)
/*!
Specifies whether the return parameter is unique or not, if present.This information is derived from the return result for this Operation.
*/
-bool
-QUmlOperation::isUnique() const
+bool QUmlOperation::isUnique() const
{
// This is a read-only derived property
@@ -289,8 +353,7 @@ void QUmlOperation::setUnique(bool isUnique)
/*!
This information is derived from the return result for this Operation.Specifies the lower multiplicity of the return parameter, if present.
*/
-int
-QUmlOperation::lower() const
+int QUmlOperation::lower() const
{
// This is a read-only derived property
@@ -314,8 +377,7 @@ void QUmlOperation::setLower(int lower)
/*!
Specifies the ordered set of formal parameters of this BehavioralFeature.Specifies the parameters owned by this Operation.
*/
-const QList<QUmlParameter *>
-QUmlOperation::ownedParameter() const
+const QList<QUmlParameter *> QUmlOperation::ownedParameter() const
{
// This is a read-write association end
@@ -358,8 +420,7 @@ void QUmlOperation::removeOwnedParameter(QUmlParameter *ownedParameter)
/*!
An optional set of Constraints specifying the state of the system when the Operation is completed.
*/
-const QSet<QUmlConstraint *>
-QUmlOperation::postcondition() const
+const QSet<QUmlConstraint *> QUmlOperation::postcondition() const
{
// This is a read-write association end
@@ -398,8 +459,7 @@ void QUmlOperation::removePostcondition(QUmlConstraint *postcondition)
/*!
An optional set of Constraints on the state of the system when the Operation is invoked.
*/
-const QSet<QUmlConstraint *>
-QUmlOperation::precondition() const
+const QSet<QUmlConstraint *> QUmlOperation::precondition() const
{
// This is a read-write association end
@@ -438,8 +498,7 @@ void QUmlOperation::removePrecondition(QUmlConstraint *precondition)
/*!
References the Types representing exceptions that may be raised during an invocation of this operation.
*/
-const QSet<QUmlType *>
-QUmlOperation::raisedException() const
+const QSet<QUmlType *> QUmlOperation::raisedException() const
{
// This is a read-write association end
@@ -469,8 +528,7 @@ void QUmlOperation::removeRaisedException(QUmlType *raisedException)
/*!
References the Operations that are redefined by this Operation.
*/
-const QSet<QUmlOperation *>
-QUmlOperation::redefinedOperation() const
+const QSet<QUmlOperation *> QUmlOperation::redefinedOperation() const
{
// This is a read-write association end
@@ -506,8 +564,7 @@ void QUmlOperation::removeRedefinedOperation(QUmlOperation *redefinedOperation)
/*!
The template parameter that exposes this element as a formal parameter.
*/
-QUmlOperationTemplateParameter *
-QUmlOperation::templateParameter() const
+QUmlOperationTemplateParameter *QUmlOperation::templateParameter() const
{
// This is a read-write association end
@@ -528,8 +585,7 @@ void QUmlOperation::setTemplateParameter(QUmlOperationTemplateParameter *templat
/*!
This information is derived from the return result for this Operation.Specifies the return result of the operation, if present.
*/
-QUmlType *
-QUmlOperation::type() const
+QUmlType *QUmlOperation::type() const
{
// This is a read-only derived association end
@@ -553,8 +609,7 @@ void QUmlOperation::setType(QUmlType *type)
/*!
This information is derived from the return result for this Operation.Specifies the upper multiplicity of the return parameter, if present.
*/
-int
-QUmlOperation::upper() const
+int QUmlOperation::upper() const
{
// This is a read-only derived property
diff --git a/src/uml/qumloperation.h b/src/uml/qumloperation.h
index 02e759c5..f3301ae6 100644
--- a/src/uml/qumloperation.h
+++ b/src/uml/qumloperation.h
@@ -69,6 +69,8 @@ public:
explicit QUmlOperation(bool createQObject = true);
virtual ~QUmlOperation();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlConstraint *bodyCondition() const;
void setBodyCondition(QUmlConstraint *bodyCondition);
diff --git a/src/uml/qumloperationtemplateparameter.cpp b/src/uml/qumloperationtemplateparameter.cpp
index 6697d581..da5a0a12 100644
--- a/src/uml/qumloperationtemplateparameter.cpp
+++ b/src/uml/qumloperationtemplateparameter.cpp
@@ -42,8 +42,11 @@
#include "private/qumloperationtemplateparameterobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlOperation>
-
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlTemplateSignature>
/*!
\class QUmlOperationTemplateParameter
@@ -67,13 +70,30 @@ QUmlOperationTemplateParameter::~QUmlOperationTemplateParameter()
}
}
+QModelingObject *QUmlOperationTemplateParameter::clone() const
+{
+ QUmlOperationTemplateParameter *c = new QUmlOperationTemplateParameter;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (default_())
+ c->setDefault(dynamic_cast<QUmlParameterableElement *>(default_()->clone()));
+ if (ownedDefault())
+ c->setOwnedDefault(dynamic_cast<QUmlParameterableElement *>(ownedDefault()->clone()));
+ if (ownedParameteredElement())
+ c->setOwnedParameteredElement(dynamic_cast<QUmlParameterableElement *>(ownedParameteredElement()->clone()));
+ if (signature())
+ c->setSignature(dynamic_cast<QUmlTemplateSignature *>(signature()->clone()));
+ if (parameteredElement())
+ c->setParameteredElement(dynamic_cast<QUmlOperation *>(parameteredElement()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The operation for this template parameter.
*/
-QUmlOperation *
-QUmlOperationTemplateParameter::parameteredElement() const
+QUmlOperation *QUmlOperationTemplateParameter::parameteredElement() const
{
// This is a read-write association end
diff --git a/src/uml/qumloperationtemplateparameter.h b/src/uml/qumloperationtemplateparameter.h
index 6bad8e81..dc1f31e9 100644
--- a/src/uml/qumloperationtemplateparameter.h
+++ b/src/uml/qumloperationtemplateparameter.h
@@ -60,6 +60,8 @@ public:
explicit QUmlOperationTemplateParameter(bool createQObject = true);
virtual ~QUmlOperationTemplateParameter();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlOperation *parameteredElement() const;
void setParameteredElement(QUmlOperation *parameteredElement);
diff --git a/src/uml/qumloutputpin.cpp b/src/uml/qumloutputpin.cpp
index 78f2a24a..3f082608 100644
--- a/src/uml/qumloutputpin.cpp
+++ b/src/uml/qumloutputpin.cpp
@@ -42,6 +42,27 @@
#include "private/qumloutputpinobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlMultiplicityElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlState>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlOutputPin
@@ -63,3 +84,49 @@ QUmlOutputPin::~QUmlOutputPin()
}
}
+QModelingObject *QUmlOutputPin::clone() const
+{
+ QUmlOutputPin *c = new QUmlOutputPin;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ c->setOrdered(isOrdered());
+ c->setUnique(isUnique());
+ if (lowerValue())
+ c->setLowerValue(dynamic_cast<QUmlValueSpecification *>(lowerValue()->clone()));
+ if (upperValue())
+ c->setUpperValue(dynamic_cast<QUmlValueSpecification *>(upperValue()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ foreach (QUmlState *element, inState())
+ c->addInState(dynamic_cast<QUmlState *>(element->clone()));
+ c->setControlType(isControlType());
+ c->setOrdering(ordering());
+ if (selection())
+ c->setSelection(dynamic_cast<QUmlBehavior *>(selection()->clone()));
+ if (upperBound())
+ c->setUpperBound(dynamic_cast<QUmlValueSpecification *>(upperBound()->clone()));
+ c->setControl(isControl());
+ return c;
+}
+
diff --git a/src/uml/qumloutputpin.h b/src/uml/qumloutputpin.h
index 12216a07..db5abcac 100644
--- a/src/uml/qumloutputpin.h
+++ b/src/uml/qumloutputpin.h
@@ -58,6 +58,8 @@ public:
explicit QUmlOutputPin(bool createQObject = true);
virtual ~QUmlOutputPin();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlpackage.cpp b/src/uml/qumlpackage.cpp
index aeda6032..4be2c321 100644
--- a/src/uml/qumlpackage.cpp
+++ b/src/uml/qumlpackage.cpp
@@ -42,13 +42,25 @@
#include "private/qumlpackageobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
#include <QtUml/QUmlPackageMerge>
+#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlProfile>
#include <QtUml/QUmlProfileApplication>
#include <QtUml/QUmlStereotype>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
#include <QtUml/QUmlType>
-
/*!
\class QUmlPackage
@@ -71,13 +83,49 @@ QUmlPackage::~QUmlPackage()
}
}
+QModelingObject *QUmlPackage::clone() const
+{
+ QUmlPackage *c = new QUmlPackage;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ c->setURI(URI());
+ if (nestingPackage())
+ c->setNestingPackage(dynamic_cast<QUmlPackage *>(nestingPackage()->clone()));
+ foreach (QUmlPackageMerge *element, packageMerge())
+ c->addPackageMerge(dynamic_cast<QUmlPackageMerge *>(element->clone()));
+ foreach (QUmlPackageableElement *element, packagedElement())
+ c->addPackagedElement(dynamic_cast<QUmlPackageableElement *>(element->clone()));
+ foreach (QUmlProfileApplication *element, profileApplication())
+ c->addProfileApplication(dynamic_cast<QUmlProfileApplication *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Provides an identifier for the package that can be used for many purposes. A URI is the universally unique identification of the package following the IETF URI specification, RFC 2396 http://www.ietf.org/rfc/rfc2396.txt and it must comply with those syntax rules.
*/
-QString
-QUmlPackage::URI() const
+QString QUmlPackage::URI() const
{
// This is a read-write property
@@ -96,8 +144,7 @@ void QUmlPackage::setURI(QString URI)
/*!
References the packaged elements that are Packages.
*/
-const QSet<QUmlPackage *>
-QUmlPackage::nestedPackage() const
+const QSet<QUmlPackage *> QUmlPackage::nestedPackage() const
{
// This is a read-write derived association end
@@ -139,8 +186,7 @@ void QUmlPackage::removeNestedPackage(QUmlPackage *nestedPackage)
/*!
References the Package that owns this Package.
*/
-QUmlPackage *
-QUmlPackage::nestingPackage() const
+QUmlPackage *QUmlPackage::nestingPackage() const
{
// This is a read-write association end
@@ -161,8 +207,7 @@ void QUmlPackage::setNestingPackage(QUmlPackage *nestingPackage)
/*!
References the Stereotypes that are owned by the Package
*/
-const QSet<QUmlStereotype *>
-QUmlPackage::ownedStereotype() const
+const QSet<QUmlStereotype *> QUmlPackage::ownedStereotype() const
{
// This is a read-only derived association end
@@ -204,8 +249,7 @@ void QUmlPackage::removeOwnedStereotype(QUmlStereotype *ownedStereotype)
/*!
References the packaged elements that are Types.
*/
-const QSet<QUmlType *>
-QUmlPackage::ownedType() const
+const QSet<QUmlType *> QUmlPackage::ownedType() const
{
// This is a read-write derived association end
@@ -257,8 +301,7 @@ void QUmlPackage::removeOwnedType(QUmlType *ownedType)
/*!
References the PackageMerges that are owned by this Package.
*/
-const QSet<QUmlPackageMerge *>
-QUmlPackage::packageMerge() const
+const QSet<QUmlPackageMerge *> QUmlPackage::packageMerge() const
{
// This is a read-write association end
@@ -307,8 +350,7 @@ void QUmlPackage::removePackageMerge(QUmlPackageMerge *packageMerge)
/*!
Specifies the packageable elements that are owned by this Package.
*/
-const QSet<QUmlPackageableElement *>
-QUmlPackage::packagedElement() const
+const QSet<QUmlPackageableElement *> QUmlPackage::packagedElement() const
{
// This is a read-write association end
@@ -347,8 +389,7 @@ void QUmlPackage::removePackagedElement(QUmlPackageableElement *packagedElement)
/*!
References the ProfileApplications that indicate which profiles have been applied to the Package.
*/
-const QSet<QUmlProfileApplication *>
-QUmlPackage::profileApplication() const
+const QSet<QUmlProfileApplication *> QUmlPackage::profileApplication() const
{
// This is a read-write association end
diff --git a/src/uml/qumlpackage.h b/src/uml/qumlpackage.h
index 73a0f0b7..1c69bca6 100644
--- a/src/uml/qumlpackage.h
+++ b/src/uml/qumlpackage.h
@@ -67,6 +67,8 @@ public:
explicit QUmlPackage(bool createQObject = true);
virtual ~QUmlPackage();
+ QModelingObject *clone() const;
+
// Owned attributes
QString URI() const;
void setURI(QString URI);
diff --git a/src/uml/qumlpackageableelement.cpp b/src/uml/qumlpackageableelement.cpp
index 2a3ec0f4..cece02df 100644
--- a/src/uml/qumlpackageableelement.cpp
+++ b/src/uml/qumlpackageableelement.cpp
@@ -40,6 +40,15 @@
****************************************************************************/
#include "qumlpackageableelement.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlPackageableElement
@@ -56,13 +65,30 @@ QUmlPackageableElement::~QUmlPackageableElement()
{
}
+QModelingObject *QUmlPackageableElement::clone() const
+{
+ QUmlPackageableElement *c = new QUmlPackageableElement;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Indicates that packageable elements must always have a visibility, i.e., visibility is not optional.
*/
-QtUml::VisibilityKind
-QUmlPackageableElement::visibility() const
+QtUml::VisibilityKind QUmlPackageableElement::visibility() const
{
// This is a read-write property
diff --git a/src/uml/qumlpackageableelement.h b/src/uml/qumlpackageableelement.h
index 0c3e6fe8..b9c2f9e6 100644
--- a/src/uml/qumlpackageableelement.h
+++ b/src/uml/qumlpackageableelement.h
@@ -60,6 +60,8 @@ class Q_UML_EXPORT QUmlPackageableElement : public QUmlParameterableElement, pub
public:
virtual ~QUmlPackageableElement();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QtUml::VisibilityKind visibility() const;
void setVisibility(QtUml::VisibilityKind visibility);
diff --git a/src/uml/qumlpackageimport.cpp b/src/uml/qumlpackageimport.cpp
index 5eebba82..d2252a6a 100644
--- a/src/uml/qumlpackageimport.cpp
+++ b/src/uml/qumlpackageimport.cpp
@@ -42,9 +42,10 @@
#include "private/qumlpackageimportobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlPackage>
-
/*!
\class QUmlPackageImport
@@ -69,13 +70,25 @@ QUmlPackageImport::~QUmlPackageImport()
}
}
+QModelingObject *QUmlPackageImport::clone() const
+{
+ QUmlPackageImport *c = new QUmlPackageImport;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (importedPackage())
+ c->setImportedPackage(dynamic_cast<QUmlPackage *>(importedPackage()->clone()));
+ if (importingNamespace())
+ c->setImportingNamespace(dynamic_cast<QUmlNamespace *>(importingNamespace()->clone()));
+ c->setVisibility(visibility());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies the Package whose members are imported into a Namespace.
*/
-QUmlPackage *
-QUmlPackageImport::importedPackage() const
+QUmlPackage *QUmlPackageImport::importedPackage() const
{
// This is a read-write association end
@@ -104,8 +117,7 @@ void QUmlPackageImport::setImportedPackage(QUmlPackage *importedPackage)
/*!
Specifies the Namespace that imports the members from a Package.
*/
-QUmlNamespace *
-QUmlPackageImport::importingNamespace() const
+QUmlNamespace *QUmlPackageImport::importingNamespace() const
{
// This is a read-write association end
@@ -135,8 +147,7 @@ void QUmlPackageImport::setImportingNamespace(QUmlNamespace *importingNamespace)
/*!
Specifies the visibility of the imported PackageableElements within the importing Namespace, i.e., whether imported elements will in turn be visible to other packages that use that importingPackage as an importedPackage. If the PackageImport is public, the imported elements will be visible outside the package, while if it is private they will not.
*/
-QtUml::VisibilityKind
-QUmlPackageImport::visibility() const
+QtUml::VisibilityKind QUmlPackageImport::visibility() const
{
// This is a read-write property
diff --git a/src/uml/qumlpackageimport.h b/src/uml/qumlpackageimport.h
index 655e2604..117c5ca9 100644
--- a/src/uml/qumlpackageimport.h
+++ b/src/uml/qumlpackageimport.h
@@ -63,6 +63,8 @@ public:
explicit QUmlPackageImport(bool createQObject = true);
virtual ~QUmlPackageImport();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlPackage *importedPackage() const;
void setImportedPackage(QUmlPackage *importedPackage);
diff --git a/src/uml/qumlpackagemerge.cpp b/src/uml/qumlpackagemerge.cpp
index ef7bfbe1..11fc47cb 100644
--- a/src/uml/qumlpackagemerge.cpp
+++ b/src/uml/qumlpackagemerge.cpp
@@ -42,8 +42,9 @@
#include "private/qumlpackagemergeobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlPackage>
-
/*!
\class QUmlPackageMerge
@@ -67,13 +68,24 @@ QUmlPackageMerge::~QUmlPackageMerge()
}
}
+QModelingObject *QUmlPackageMerge::clone() const
+{
+ QUmlPackageMerge *c = new QUmlPackageMerge;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (mergedPackage())
+ c->setMergedPackage(dynamic_cast<QUmlPackage *>(mergedPackage()->clone()));
+ if (receivingPackage())
+ c->setReceivingPackage(dynamic_cast<QUmlPackage *>(receivingPackage()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the Package that is to be merged with the receiving package of the PackageMerge.
*/
-QUmlPackage *
-QUmlPackageMerge::mergedPackage() const
+QUmlPackage *QUmlPackageMerge::mergedPackage() const
{
// This is a read-write association end
@@ -102,8 +114,7 @@ void QUmlPackageMerge::setMergedPackage(QUmlPackage *mergedPackage)
/*!
References the Package that is being extended with the contents of the merged package of the PackageMerge.
*/
-QUmlPackage *
-QUmlPackageMerge::receivingPackage() const
+QUmlPackage *QUmlPackageMerge::receivingPackage() const
{
// This is a read-write association end
diff --git a/src/uml/qumlpackagemerge.h b/src/uml/qumlpackagemerge.h
index 0de41029..aad3a9c8 100644
--- a/src/uml/qumlpackagemerge.h
+++ b/src/uml/qumlpackagemerge.h
@@ -60,6 +60,8 @@ public:
explicit QUmlPackageMerge(bool createQObject = true);
virtual ~QUmlPackageMerge();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlPackage *mergedPackage() const;
void setMergedPackage(QUmlPackage *mergedPackage);
diff --git a/src/uml/qumlparameter.cpp b/src/uml/qumlparameter.cpp
index c0a0513d..604e2636 100644
--- a/src/uml/qumlparameter.cpp
+++ b/src/uml/qumlparameter.cpp
@@ -42,10 +42,22 @@
#include "private/qumlparameterobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElementTemplateParameter>
+#include <QtUml/QUmlConnectorEnd>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlMultiplicityElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlParameterSet>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
#include <QtUml/QUmlValueSpecification>
-
/*!
\class QUmlParameter
@@ -72,13 +84,48 @@ QUmlParameter::~QUmlParameter()
}
}
+QModelingObject *QUmlParameter::clone() const
+{
+ QUmlParameter *c = new QUmlParameter;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ c->setOrdered(isOrdered());
+ c->setUnique(isUnique());
+ if (lowerValue())
+ c->setLowerValue(dynamic_cast<QUmlValueSpecification *>(lowerValue()->clone()));
+ if (upperValue())
+ c->setUpperValue(dynamic_cast<QUmlValueSpecification *>(upperValue()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlConnectableElementTemplateParameter *>(templateParameter()->clone()));
+ if (defaultValue())
+ c->setDefaultValue(dynamic_cast<QUmlValueSpecification *>(defaultValue()->clone()));
+ c->setDirection(direction());
+ c->setEffect(effect());
+ c->setException(isException());
+ c->setStream(isStream());
+ if (operation())
+ c->setOperation(dynamic_cast<QUmlOperation *>(operation()->clone()));
+ foreach (QUmlParameterSet *element, parameterSet())
+ c->addParameterSet(dynamic_cast<QUmlParameterSet *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies a String that represents a value to be used when no argument is supplied for the Parameter.
*/
-QString
-QUmlParameter::default_() const
+QString QUmlParameter::default_() const
{
// This is a read-write derived property
@@ -102,8 +149,7 @@ void QUmlParameter::setDefault(QString default_)
/*!
Specifies a ValueSpecification that represents a value to be used when no argument is supplied for the Parameter.
*/
-QUmlValueSpecification *
-QUmlParameter::defaultValue() const
+QUmlValueSpecification *QUmlParameter::defaultValue() const
{
// This is a read-write association end
@@ -133,8 +179,7 @@ void QUmlParameter::setDefaultValue(QUmlValueSpecification *defaultValue)
/*!
Indicates whether a parameter is being sent into or out of a behavioral element.
*/
-QtUml::ParameterDirectionKind
-QUmlParameter::direction() const
+QtUml::ParameterDirectionKind QUmlParameter::direction() const
{
// This is a read-write property
@@ -153,8 +198,7 @@ void QUmlParameter::setDirection(QtUml::ParameterDirectionKind direction)
/*!
Specifies the effect that the owner of the parameter has on values passed in or out of the parameter.
*/
-QtUml::ParameterEffectKind
-QUmlParameter::effect() const
+QtUml::ParameterEffectKind QUmlParameter::effect() const
{
// This is a read-write property
@@ -173,8 +217,7 @@ void QUmlParameter::setEffect(QtUml::ParameterEffectKind effect)
/*!
Tells whether an output parameter may emit a value to the exclusion of the other outputs.
*/
-bool
-QUmlParameter::isException() const
+bool QUmlParameter::isException() const
{
// This is a read-write property
@@ -193,8 +236,7 @@ void QUmlParameter::setException(bool isException)
/*!
Tells whether an input parameter may accept values while its behavior is executing, or whether an output parameter post values while the behavior is executing.
*/
-bool
-QUmlParameter::isStream() const
+bool QUmlParameter::isStream() const
{
// This is a read-write property
@@ -213,8 +255,7 @@ void QUmlParameter::setStream(bool isStream)
/*!
References the Operation owning this parameter.
*/
-QUmlOperation *
-QUmlParameter::operation() const
+QUmlOperation *QUmlParameter::operation() const
{
// This is a read-write association end
@@ -235,8 +276,7 @@ void QUmlParameter::setOperation(QUmlOperation *operation)
/*!
The parameter sets containing the parameter. See ParameterSet.
*/
-const QSet<QUmlParameterSet *>
-QUmlParameter::parameterSet() const
+const QSet<QUmlParameterSet *> QUmlParameter::parameterSet() const
{
// This is a read-write association end
diff --git a/src/uml/qumlparameter.h b/src/uml/qumlparameter.h
index 9f8dd46d..ef6e4768 100644
--- a/src/uml/qumlparameter.h
+++ b/src/uml/qumlparameter.h
@@ -65,6 +65,8 @@ public:
explicit QUmlParameter(bool createQObject = true);
virtual ~QUmlParameter();
+ QModelingObject *clone() const;
+
// Owned attributes
QString default_() const;
void setDefault(QString default_);
diff --git a/src/uml/qumlparameterableelement.cpp b/src/uml/qumlparameterableelement.cpp
index eed8a093..e2cac0a9 100644
--- a/src/uml/qumlparameterableelement.cpp
+++ b/src/uml/qumlparameterableelement.cpp
@@ -40,8 +40,9 @@
****************************************************************************/
#include "qumlparameterableelement.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlTemplateParameter>
-
/*!
\class QUmlParameterableElement
@@ -59,13 +60,24 @@ QUmlParameterableElement::~QUmlParameterableElement()
{
}
+QModelingObject *QUmlParameterableElement::clone() const
+{
+ QUmlParameterableElement *c = new QUmlParameterableElement;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The formal template parameter that owns this element.
*/
-QUmlTemplateParameter *
-QUmlParameterableElement::owningTemplateParameter() const
+QUmlTemplateParameter *QUmlParameterableElement::owningTemplateParameter() const
{
// This is a read-write association end
@@ -92,8 +104,7 @@ void QUmlParameterableElement::setOwningTemplateParameter(QUmlTemplateParameter
/*!
The template parameter that exposes this element as a formal parameter.
*/
-QUmlTemplateParameter *
-QUmlParameterableElement::templateParameter() const
+QUmlTemplateParameter *QUmlParameterableElement::templateParameter() const
{
// This is a read-write association end
diff --git a/src/uml/qumlparameterableelement.h b/src/uml/qumlparameterableelement.h
index 5d12a5cf..95f5a66d 100644
--- a/src/uml/qumlparameterableelement.h
+++ b/src/uml/qumlparameterableelement.h
@@ -59,6 +59,8 @@ class Q_UML_EXPORT QUmlParameterableElement : public virtual QUmlElement
public:
virtual ~QUmlParameterableElement();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QUmlTemplateParameter *owningTemplateParameter() const;
void setOwningTemplateParameter(QUmlTemplateParameter *owningTemplateParameter);
diff --git a/src/uml/qumlparameterset.cpp b/src/uml/qumlparameterset.cpp
index 7847b1d6..936d64a3 100644
--- a/src/uml/qumlparameterset.cpp
+++ b/src/uml/qumlparameterset.cpp
@@ -42,9 +42,15 @@
#include "private/qumlparametersetobject_p.h"
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
#include <QtUml/QUmlParameter>
-
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlParameterSet
@@ -66,13 +72,30 @@ QUmlParameterSet::~QUmlParameterSet()
}
}
+QModelingObject *QUmlParameterSet::clone() const
+{
+ QUmlParameterSet *c = new QUmlParameterSet;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlConstraint *element, condition())
+ c->addCondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlParameter *element, parameter())
+ c->addParameter(dynamic_cast<QUmlParameter *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Constraint that should be satisfied for the owner of the parameters in an input parameter set to start execution using the values provided for those parameters, or the owner of the parameters in an output parameter set to end execution providing the values for those parameters, if all preconditions and conditions on input parameter sets were satisfied.
*/
-const QSet<QUmlConstraint *>
-QUmlParameterSet::condition() const
+const QSet<QUmlConstraint *> QUmlParameterSet::condition() const
{
// This is a read-write association end
@@ -111,8 +134,7 @@ void QUmlParameterSet::removeCondition(QUmlConstraint *condition)
/*!
Parameters in the parameter set.
*/
-const QSet<QUmlParameter *>
-QUmlParameterSet::parameter() const
+const QSet<QUmlParameter *> QUmlParameterSet::parameter() const
{
// This is a read-write association end
diff --git a/src/uml/qumlparameterset.h b/src/uml/qumlparameterset.h
index 3c9a5be4..d2a6a396 100644
--- a/src/uml/qumlparameterset.h
+++ b/src/uml/qumlparameterset.h
@@ -61,6 +61,8 @@ public:
explicit QUmlParameterSet(bool createQObject = true);
virtual ~QUmlParameterSet();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlConstraint *> condition() const;
void addCondition(QUmlConstraint *condition);
diff --git a/src/uml/qumlpartdecomposition.cpp b/src/uml/qumlpartdecomposition.cpp
index d1dfe893..3166a314 100644
--- a/src/uml/qumlpartdecomposition.cpp
+++ b/src/uml/qumlpartdecomposition.cpp
@@ -42,6 +42,20 @@
#include "private/qumlpartdecompositionobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlGate>
+#include <QtUml/QUmlGeneralOrdering>
+#include <QtUml/QUmlInteraction>
+#include <QtUml/QUmlInteractionOperand>
+#include <QtUml/QUmlLifeline>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlPartDecomposition
@@ -64,3 +78,35 @@ QUmlPartDecomposition::~QUmlPartDecomposition()
}
}
+QModelingObject *QUmlPartDecomposition::clone() const
+{
+ QUmlPartDecomposition *c = new QUmlPartDecomposition;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlLifeline *element, covered())
+ c->addCovered(dynamic_cast<QUmlLifeline *>(element->clone()));
+ if (enclosingInteraction())
+ c->setEnclosingInteraction(dynamic_cast<QUmlInteraction *>(enclosingInteraction()->clone()));
+ if (enclosingOperand())
+ c->setEnclosingOperand(dynamic_cast<QUmlInteractionOperand *>(enclosingOperand()->clone()));
+ foreach (QUmlGeneralOrdering *element, generalOrdering())
+ c->addGeneralOrdering(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ foreach (QUmlGate *element, actualGate())
+ c->addActualGate(dynamic_cast<QUmlGate *>(element->clone()));
+ foreach (QUmlValueSpecification *element, argument())
+ c->addArgument(dynamic_cast<QUmlValueSpecification *>(element->clone()));
+ if (refersTo())
+ c->setRefersTo(dynamic_cast<QUmlInteraction *>(refersTo()->clone()));
+ if (returnValue())
+ c->setReturnValue(dynamic_cast<QUmlValueSpecification *>(returnValue()->clone()));
+ if (returnValueRecipient())
+ c->setReturnValueRecipient(dynamic_cast<QUmlProperty *>(returnValueRecipient()->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlpartdecomposition.h b/src/uml/qumlpartdecomposition.h
index 6688f682..711e9d55 100644
--- a/src/uml/qumlpartdecomposition.h
+++ b/src/uml/qumlpartdecomposition.h
@@ -58,6 +58,8 @@ public:
explicit QUmlPartDecomposition(bool createQObject = true);
virtual ~QUmlPartDecomposition();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlpin.cpp b/src/uml/qumlpin.cpp
index 82699dad..2624b258 100644
--- a/src/uml/qumlpin.cpp
+++ b/src/uml/qumlpin.cpp
@@ -40,6 +40,27 @@
****************************************************************************/
#include "qumlpin.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlMultiplicityElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlState>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlPin
@@ -56,13 +77,58 @@ QUmlPin::~QUmlPin()
{
}
+QModelingObject *QUmlPin::clone() const
+{
+ QUmlPin *c = new QUmlPin;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ c->setOrdered(isOrdered());
+ c->setUnique(isUnique());
+ if (lowerValue())
+ c->setLowerValue(dynamic_cast<QUmlValueSpecification *>(lowerValue()->clone()));
+ if (upperValue())
+ c->setUpperValue(dynamic_cast<QUmlValueSpecification *>(upperValue()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ foreach (QUmlState *element, inState())
+ c->addInState(dynamic_cast<QUmlState *>(element->clone()));
+ c->setControlType(isControlType());
+ c->setOrdering(ordering());
+ if (selection())
+ c->setSelection(dynamic_cast<QUmlBehavior *>(selection()->clone()));
+ if (upperBound())
+ c->setUpperBound(dynamic_cast<QUmlValueSpecification *>(upperBound()->clone()));
+ c->setControl(isControl());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Tells whether the pins provide data to the actions, or just controls when it executes it.
*/
-bool
-QUmlPin::isControl() const
+bool QUmlPin::isControl() const
{
// This is a read-write property
diff --git a/src/uml/qumlpin.h b/src/uml/qumlpin.h
index 8963265d..433c068a 100644
--- a/src/uml/qumlpin.h
+++ b/src/uml/qumlpin.h
@@ -58,6 +58,8 @@ class Q_UML_EXPORT QUmlPin : public QUmlMultiplicityElement, public QUmlObjectNo
public:
virtual ~QUmlPin();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
bool isControl() const;
void setControl(bool isControl);
diff --git a/src/uml/qumlport.cpp b/src/uml/qumlport.cpp
index e35adfba..2662e8d3 100644
--- a/src/uml/qumlport.cpp
+++ b/src/uml/qumlport.cpp
@@ -42,9 +42,30 @@
#include "private/qumlportobject_p.h"
+#include <QtUml/QUmlAssociation>
+#include <QtUml/QUmlClass>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElementTemplateParameter>
+#include <QtUml/QUmlConnectorEnd>
+#include <QtUml/QUmlDataType>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlDeployment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlInterface>
+#include <QtUml/QUmlMultiplicityElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlProperty>
#include <QtUml/QUmlProtocolStateMachine>
-
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlPort
@@ -71,13 +92,74 @@ QUmlPort::~QUmlPort()
}
}
+QModelingObject *QUmlPort::clone() const
+{
+ QUmlPort *c = new QUmlPort;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ c->setOrdered(isOrdered());
+ c->setUnique(isUnique());
+ if (lowerValue())
+ c->setLowerValue(dynamic_cast<QUmlValueSpecification *>(lowerValue()->clone()));
+ if (upperValue())
+ c->setUpperValue(dynamic_cast<QUmlValueSpecification *>(upperValue()->clone()));
+ c->setLeaf(isLeaf());
+ c->setStatic(isStatic());
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlConnectableElementTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDeployment *element, deployment())
+ c->addDeployment(dynamic_cast<QUmlDeployment *>(element->clone()));
+ c->setAggregation(aggregation());
+ if (association())
+ c->setAssociation(dynamic_cast<QUmlAssociation *>(association()->clone()));
+ if (associationEnd())
+ c->setAssociationEnd(dynamic_cast<QUmlProperty *>(associationEnd()->clone()));
+ if (class_())
+ c->setClass(dynamic_cast<QUmlClass *>(class_()->clone()));
+ if (datatype())
+ c->setDatatype(dynamic_cast<QUmlDataType *>(datatype()->clone()));
+ if (defaultValue())
+ c->setDefaultValue(dynamic_cast<QUmlValueSpecification *>(defaultValue()->clone()));
+ if (interface_())
+ c->setInterface(dynamic_cast<QUmlInterface *>(interface_()->clone()));
+ c->setDerived(isDerived());
+ c->setDerivedUnion(isDerivedUnion());
+ c->setID(isID());
+ c->setReadOnly(isReadOnly());
+ if (owningAssociation())
+ c->setOwningAssociation(dynamic_cast<QUmlAssociation *>(owningAssociation()->clone()));
+ foreach (QUmlProperty *element, qualifier())
+ c->addQualifier(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlProperty *element, redefinedProperty())
+ c->addRedefinedProperty(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlProperty *element, subsettedProperty())
+ c->addSubsettedProperty(dynamic_cast<QUmlProperty *>(element->clone()));
+ c->setBehavior(isBehavior());
+ c->setConjugated(isConjugated());
+ c->setService(isService());
+ if (protocol())
+ c->setProtocol(dynamic_cast<QUmlProtocolStateMachine *>(protocol()->clone()));
+ foreach (QUmlPort *element, redefinedPort())
+ c->addRedefinedPort(dynamic_cast<QUmlPort *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies whether requests arriving at this port are sent to the classifier behavior of this classifier. Such ports are referred to as behavior port. Any invocation of a behavioral feature targeted at a behavior port will be handled by the instance of the owning classifier itself, rather than by any instances that this classifier may contain.
*/
-bool
-QUmlPort::isBehavior() const
+bool QUmlPort::isBehavior() const
{
// This is a read-write property
@@ -96,8 +178,7 @@ void QUmlPort::setBehavior(bool isBehavior)
/*!
Specifies the way that the provided and required interfaces are derived from the Port’s Type. The default value is false.
*/
-bool
-QUmlPort::isConjugated() const
+bool QUmlPort::isConjugated() const
{
// This is a read-write property
@@ -116,8 +197,7 @@ void QUmlPort::setConjugated(bool isConjugated)
/*!
If true indicates that this port is used to provide the published functionality of a classifier; if false, this port is used to implement the classifier but is not part of the essential externally-visible functionality of the classifier and can, therefore, be altered or deleted along with the internal implementation of the classifier and other properties that are considered part of its implementation.
*/
-bool
-QUmlPort::isService() const
+bool QUmlPort::isService() const
{
// This is a read-write property
@@ -136,8 +216,7 @@ void QUmlPort::setService(bool isService)
/*!
References an optional protocol state machine which describes valid interactions at this interaction point.
*/
-QUmlProtocolStateMachine *
-QUmlPort::protocol() const
+QUmlProtocolStateMachine *QUmlPort::protocol() const
{
// This is a read-write association end
@@ -158,8 +237,7 @@ void QUmlPort::setProtocol(QUmlProtocolStateMachine *protocol)
/*!
References the interfaces specifying the set of operations and receptions that the classifier offers to its environment via this port, and which it will handle either directly or by forwarding it to a part of its internal structure. This association is derived according to the value of isConjugated. If isConjugated is false, provided is derived as the union of the sets of interfaces realized by the type of the port and its supertypes, or directly from the type of the port if the port is typed by an interface. If isConjugated is true, it is derived as the union of the sets of interfaces used by the type of the port and its supertypes.
*/
-const QSet<QUmlInterface *>
-QUmlPort::provided() const
+const QSet<QUmlInterface *> QUmlPort::provided() const
{
// This is a read-only derived association end
@@ -195,8 +273,7 @@ void QUmlPort::removeProvided(QUmlInterface *provided)
/*!
A port may be redefined when its containing classifier is specialized. The redefining port may have additional interfaces to those that are associated with the redefined port or it may replace an interface by one of its subtypes.
*/
-const QSet<QUmlPort *>
-QUmlPort::redefinedPort() const
+const QSet<QUmlPort *> QUmlPort::redefinedPort() const
{
// This is a read-write association end
@@ -232,8 +309,7 @@ void QUmlPort::removeRedefinedPort(QUmlPort *redefinedPort)
/*!
References the interfaces specifying the set of operations and receptions that the classifier expects its environment to handle via this port. This association is derived according to the value of isConjugated. If isConjugated is false, required is derived as the union of the sets of interfaces used by the type of the port and its supertypes. If isConjugated is true, it is derived as the union of the sets of interfaces realized by the type of the port and its supertypes, or directly from the type of the port if the port is typed by an interface.
*/
-const QSet<QUmlInterface *>
-QUmlPort::required() const
+const QSet<QUmlInterface *> QUmlPort::required() const
{
// This is a read-only derived association end
diff --git a/src/uml/qumlport.h b/src/uml/qumlport.h
index efecfc9a..cc1ee0a1 100644
--- a/src/uml/qumlport.h
+++ b/src/uml/qumlport.h
@@ -61,6 +61,8 @@ public:
explicit QUmlPort(bool createQObject = true);
virtual ~QUmlPort();
+ QModelingObject *clone() const;
+
// Owned attributes
bool isBehavior() const;
void setBehavior(bool isBehavior);
diff --git a/src/uml/qumlprimitivetype.cpp b/src/uml/qumlprimitivetype.cpp
index 49774f8a..22be83b6 100644
--- a/src/uml/qumlprimitivetype.cpp
+++ b/src/uml/qumlprimitivetype.cpp
@@ -42,6 +42,34 @@
#include "private/qumlprimitivetypeobject_p.h"
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlPrimitiveType
@@ -64,3 +92,56 @@ QUmlPrimitiveType::~QUmlPrimitiveType()
}
}
+QModelingObject *QUmlPrimitiveType::clone() const
+{
+ QUmlPrimitiveType *c = new QUmlPrimitiveType;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlprimitivetype.h b/src/uml/qumlprimitivetype.h
index 26516baa..5e448903 100644
--- a/src/uml/qumlprimitivetype.h
+++ b/src/uml/qumlprimitivetype.h
@@ -58,6 +58,8 @@ public:
explicit QUmlPrimitiveType(bool createQObject = true);
virtual ~QUmlPrimitiveType();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlprofile.cpp b/src/uml/qumlprofile.cpp
index c8f2b056..fa1950be 100644
--- a/src/uml/qumlprofile.cpp
+++ b/src/uml/qumlprofile.cpp
@@ -42,9 +42,25 @@
#include "private/qumlprofileobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
#include <QtUml/QUmlPackageImport>
-
+#include <QtUml/QUmlPackageMerge>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlProfileApplication>
+#include <QtUml/QUmlStereotype>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
/*!
\class QUmlProfile
@@ -67,13 +83,53 @@ QUmlProfile::~QUmlProfile()
}
}
+QModelingObject *QUmlProfile::clone() const
+{
+ QUmlProfile *c = new QUmlProfile;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ c->setURI(URI());
+ if (nestingPackage())
+ c->setNestingPackage(dynamic_cast<QUmlPackage *>(nestingPackage()->clone()));
+ foreach (QUmlPackageMerge *element, packageMerge())
+ c->addPackageMerge(dynamic_cast<QUmlPackageMerge *>(element->clone()));
+ foreach (QUmlPackageableElement *element, packagedElement())
+ c->addPackagedElement(dynamic_cast<QUmlPackageableElement *>(element->clone()));
+ foreach (QUmlProfileApplication *element, profileApplication())
+ c->addProfileApplication(dynamic_cast<QUmlProfileApplication *>(element->clone()));
+ foreach (QUmlElementImport *element, metaclassReference())
+ c->addMetaclassReference(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlPackageImport *element, metamodelReference())
+ c->addMetamodelReference(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References a metaclass that may be extended.
*/
-const QSet<QUmlElementImport *>
-QUmlProfile::metaclassReference() const
+const QSet<QUmlElementImport *> QUmlProfile::metaclassReference() const
{
// This is a read-write association end
@@ -112,8 +168,7 @@ void QUmlProfile::removeMetaclassReference(QUmlElementImport *metaclassReference
/*!
References a package containing (directly or indirectly) metaclasses that may be extended.
*/
-const QSet<QUmlPackageImport *>
-QUmlProfile::metamodelReference() const
+const QSet<QUmlPackageImport *> QUmlProfile::metamodelReference() const
{
// This is a read-write association end
diff --git a/src/uml/qumlprofile.h b/src/uml/qumlprofile.h
index da39554b..75b8da08 100644
--- a/src/uml/qumlprofile.h
+++ b/src/uml/qumlprofile.h
@@ -61,6 +61,8 @@ public:
explicit QUmlProfile(bool createQObject = true);
virtual ~QUmlProfile();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlElementImport *> metaclassReference() const;
void addMetaclassReference(QUmlElementImport *metaclassReference);
diff --git a/src/uml/qumlprofileapplication.cpp b/src/uml/qumlprofileapplication.cpp
index a9e3d9b4..55e18421 100644
--- a/src/uml/qumlprofileapplication.cpp
+++ b/src/uml/qumlprofileapplication.cpp
@@ -42,9 +42,10 @@
#include "private/qumlprofileapplicationobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlPackage>
#include <QtUml/QUmlProfile>
-
/*!
\class QUmlProfileApplication
@@ -69,13 +70,25 @@ QUmlProfileApplication::~QUmlProfileApplication()
}
}
+QModelingObject *QUmlProfileApplication::clone() const
+{
+ QUmlProfileApplication *c = new QUmlProfileApplication;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (appliedProfile())
+ c->setAppliedProfile(dynamic_cast<QUmlProfile *>(appliedProfile()->clone()));
+ if (applyingPackage())
+ c->setApplyingPackage(dynamic_cast<QUmlPackage *>(applyingPackage()->clone()));
+ c->setStrict(isStrict());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the Profiles that are applied to a Package through this ProfileApplication.
*/
-QUmlProfile *
-QUmlProfileApplication::appliedProfile() const
+QUmlProfile *QUmlProfileApplication::appliedProfile() const
{
// This is a read-write association end
@@ -104,8 +117,7 @@ void QUmlProfileApplication::setAppliedProfile(QUmlProfile *appliedProfile)
/*!
The package that owns the profile application.
*/
-QUmlPackage *
-QUmlProfileApplication::applyingPackage() const
+QUmlPackage *QUmlProfileApplication::applyingPackage() const
{
// This is a read-write association end
@@ -135,8 +147,7 @@ void QUmlProfileApplication::setApplyingPackage(QUmlPackage *applyingPackage)
/*!
Specifies that the Profile filtering rules for the metaclasses of the referenced metamodel shall be strictly applied.
*/
-bool
-QUmlProfileApplication::isStrict() const
+bool QUmlProfileApplication::isStrict() const
{
// This is a read-write property
diff --git a/src/uml/qumlprofileapplication.h b/src/uml/qumlprofileapplication.h
index a9830308..399ef4c5 100644
--- a/src/uml/qumlprofileapplication.h
+++ b/src/uml/qumlprofileapplication.h
@@ -61,6 +61,8 @@ public:
explicit QUmlProfileApplication(bool createQObject = true);
virtual ~QUmlProfileApplication();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlProfile *appliedProfile() const;
void setAppliedProfile(QUmlProfile *appliedProfile);
diff --git a/src/uml/qumlproperty.cpp b/src/uml/qumlproperty.cpp
index e071acaa..f05ebf3d 100644
--- a/src/uml/qumlproperty.cpp
+++ b/src/uml/qumlproperty.cpp
@@ -44,13 +44,26 @@
#include <QtUml/QUmlAssociation>
#include <QtUml/QUmlClass>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElementTemplateParameter>
+#include <QtUml/QUmlConnectorEnd>
#include <QtUml/QUmlDataType>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlDeployment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlInterface>
+#include <QtUml/QUmlMultiplicityElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
#include <QtUml/QUmlType>
#include <QtUml/QUmlValueSpecification>
-
/*!
\class QUmlProperty
@@ -84,13 +97,67 @@ QUmlProperty::~QUmlProperty()
}
}
+QModelingObject *QUmlProperty::clone() const
+{
+ QUmlProperty *c = new QUmlProperty;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ c->setOrdered(isOrdered());
+ c->setUnique(isUnique());
+ if (lowerValue())
+ c->setLowerValue(dynamic_cast<QUmlValueSpecification *>(lowerValue()->clone()));
+ if (upperValue())
+ c->setUpperValue(dynamic_cast<QUmlValueSpecification *>(upperValue()->clone()));
+ c->setLeaf(isLeaf());
+ c->setStatic(isStatic());
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlConnectableElementTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDeployment *element, deployment())
+ c->addDeployment(dynamic_cast<QUmlDeployment *>(element->clone()));
+ c->setAggregation(aggregation());
+ if (association())
+ c->setAssociation(dynamic_cast<QUmlAssociation *>(association()->clone()));
+ if (associationEnd())
+ c->setAssociationEnd(dynamic_cast<QUmlProperty *>(associationEnd()->clone()));
+ if (class_())
+ c->setClass(dynamic_cast<QUmlClass *>(class_()->clone()));
+ if (datatype())
+ c->setDatatype(dynamic_cast<QUmlDataType *>(datatype()->clone()));
+ if (defaultValue())
+ c->setDefaultValue(dynamic_cast<QUmlValueSpecification *>(defaultValue()->clone()));
+ if (interface_())
+ c->setInterface(dynamic_cast<QUmlInterface *>(interface_()->clone()));
+ c->setDerived(isDerived());
+ c->setDerivedUnion(isDerivedUnion());
+ c->setID(isID());
+ c->setReadOnly(isReadOnly());
+ if (owningAssociation())
+ c->setOwningAssociation(dynamic_cast<QUmlAssociation *>(owningAssociation()->clone()));
+ foreach (QUmlProperty *element, qualifier())
+ c->addQualifier(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlProperty *element, redefinedProperty())
+ c->addRedefinedProperty(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlProperty *element, subsettedProperty())
+ c->addSubsettedProperty(dynamic_cast<QUmlProperty *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies the kind of aggregation that applies to the Property.
*/
-QtUml::AggregationKind
-QUmlProperty::aggregation() const
+QtUml::AggregationKind QUmlProperty::aggregation() const
{
// This is a read-write property
@@ -109,8 +176,7 @@ void QUmlProperty::setAggregation(QtUml::AggregationKind aggregation)
/*!
References the association of which this property is a member, if any.
*/
-QUmlAssociation *
-QUmlProperty::association() const
+QUmlAssociation *QUmlProperty::association() const
{
// This is a read-write association end
@@ -131,8 +197,7 @@ void QUmlProperty::setAssociation(QUmlAssociation *association)
/*!
Designates the optional association end that owns a qualifier attribute.
*/
-QUmlProperty *
-QUmlProperty::associationEnd() const
+QUmlProperty *QUmlProperty::associationEnd() const
{
// This is a read-write association end
@@ -158,8 +223,7 @@ void QUmlProperty::setAssociationEnd(QUmlProperty *associationEnd)
/*!
References the Class that owns the Property.References the Class that owns the Property.
*/
-QUmlClass *
-QUmlProperty::class_() const
+QUmlClass *QUmlProperty::class_() const
{
// This is a read-write association end
@@ -185,8 +249,7 @@ void QUmlProperty::setClass(QUmlClass *class_)
/*!
The DataType that owns this Property.
*/
-QUmlDataType *
-QUmlProperty::datatype() const
+QUmlDataType *QUmlProperty::datatype() const
{
// This is a read-write association end
@@ -212,8 +275,7 @@ void QUmlProperty::setDatatype(QUmlDataType *datatype)
/*!
Specifies a String that represents a value to be used when no argument is supplied for the Property.A String that is evaluated to give a default value for the Property when an object of the owning Classifier is instantiated.
*/
-QString
-QUmlProperty::default_() const
+QString QUmlProperty::default_() const
{
// This is a read-write derived property
@@ -237,8 +299,7 @@ void QUmlProperty::setDefault(QString default_)
/*!
A ValueSpecification that is evaluated to give a default value for the Property when an object of the owning Classifier is instantiated.
*/
-QUmlValueSpecification *
-QUmlProperty::defaultValue() const
+QUmlValueSpecification *QUmlProperty::defaultValue() const
{
// This is a read-write association end
@@ -268,8 +329,7 @@ void QUmlProperty::setDefaultValue(QUmlValueSpecification *defaultValue)
/*!
References the Interface that owns the Property
*/
-QUmlInterface *
-QUmlProperty::interface_() const
+QUmlInterface *QUmlProperty::interface_() const
{
// This is a read-write association end
@@ -295,8 +355,7 @@ void QUmlProperty::setInterface(QUmlInterface *interface_)
/*!
If isComposite is true, the object containing the attribute is a container for the object or value contained in the attribute.This is a derived value, indicating whether the aggregation of the Property is composite or not.
*/
-bool
-QUmlProperty::isComposite() const
+bool QUmlProperty::isComposite() const
{
// This is a read-write derived property
@@ -320,8 +379,7 @@ void QUmlProperty::setComposite(bool isComposite)
/*!
If isDerived is true, the value of the attribute is derived from information elsewhere.Specifies whether the Property is derived, i.e., whether its value or values can be computed from other information.
*/
-bool
-QUmlProperty::isDerived() const
+bool QUmlProperty::isDerived() const
{
// This is a read-write property
@@ -340,8 +398,7 @@ void QUmlProperty::setDerived(bool isDerived)
/*!
Specifies whether the property is derived as the union of all of the properties that are constrained to subset it.
*/
-bool
-QUmlProperty::isDerivedUnion() const
+bool QUmlProperty::isDerivedUnion() const
{
// This is a read-write property
@@ -360,8 +417,7 @@ void QUmlProperty::setDerivedUnion(bool isDerivedUnion)
/*!
True indicates this property can be used to uniquely identify an instance of the containing Class.
*/
-bool
-QUmlProperty::isID() const
+bool QUmlProperty::isID() const
{
// This is a read-write property
@@ -380,8 +436,7 @@ void QUmlProperty::setID(bool isID)
/*!
If true, the attribute may only be read, and not written.If isReadOnly is true, the attribute may not be written to after initialization.
*/
-bool
-QUmlProperty::isReadOnly() const
+bool QUmlProperty::isReadOnly() const
{
// This is a read-write property
@@ -400,8 +455,7 @@ void QUmlProperty::setReadOnly(bool isReadOnly)
/*!
In the case where the property is one navigable end of a binary association with both ends navigable, this gives the other end.
*/
-QUmlProperty *
-QUmlProperty::opposite() const
+QUmlProperty *QUmlProperty::opposite() const
{
// This is a read-write derived association end
@@ -425,8 +479,7 @@ void QUmlProperty::setOpposite(QUmlProperty *opposite)
/*!
References the owning association of this property, if any.
*/
-QUmlAssociation *
-QUmlProperty::owningAssociation() const
+QUmlAssociation *QUmlProperty::owningAssociation() const
{
// This is a read-write association end
@@ -461,8 +514,7 @@ void QUmlProperty::setOwningAssociation(QUmlAssociation *owningAssociation)
/*!
An optional list of ordered qualifier attributes for the end. If the list is empty, then the Association is not qualified.
*/
-const QList<QUmlProperty *>
-QUmlProperty::qualifier() const
+const QList<QUmlProperty *> QUmlProperty::qualifier() const
{
// This is a read-write association end
@@ -501,8 +553,7 @@ void QUmlProperty::removeQualifier(QUmlProperty *qualifier)
/*!
References the properties that are redefined by this property.
*/
-const QSet<QUmlProperty *>
-QUmlProperty::redefinedProperty() const
+const QSet<QUmlProperty *> QUmlProperty::redefinedProperty() const
{
// This is a read-write association end
@@ -538,8 +589,7 @@ void QUmlProperty::removeRedefinedProperty(QUmlProperty *redefinedProperty)
/*!
References the properties of which this property is constrained to be a subset.
*/
-const QSet<QUmlProperty *>
-QUmlProperty::subsettedProperty() const
+const QSet<QUmlProperty *> QUmlProperty::subsettedProperty() const
{
// This is a read-write association end
diff --git a/src/uml/qumlproperty.h b/src/uml/qumlproperty.h
index 6f9f951e..16d5f979 100644
--- a/src/uml/qumlproperty.h
+++ b/src/uml/qumlproperty.h
@@ -71,6 +71,8 @@ public:
explicit QUmlProperty(bool createQObject = true);
virtual ~QUmlProperty();
+ QModelingObject *clone() const;
+
// Owned attributes
QtUml::AggregationKind aggregation() const;
void setAggregation(QtUml::AggregationKind aggregation);
diff --git a/src/uml/qumlprotocolconformance.cpp b/src/uml/qumlprotocolconformance.cpp
index 3a914c04..69a68290 100644
--- a/src/uml/qumlprotocolconformance.cpp
+++ b/src/uml/qumlprotocolconformance.cpp
@@ -42,8 +42,9 @@
#include "private/qumlprotocolconformanceobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlProtocolStateMachine>
-
/*!
\class QUmlProtocolConformance
@@ -67,13 +68,24 @@ QUmlProtocolConformance::~QUmlProtocolConformance()
}
}
+QModelingObject *QUmlProtocolConformance::clone() const
+{
+ QUmlProtocolConformance *c = new QUmlProtocolConformance;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (generalMachine())
+ c->setGeneralMachine(dynamic_cast<QUmlProtocolStateMachine *>(generalMachine()->clone()));
+ if (specificMachine())
+ c->setSpecificMachine(dynamic_cast<QUmlProtocolStateMachine *>(specificMachine()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies the protocol state machine to which the specific state machine conforms.
*/
-QUmlProtocolStateMachine *
-QUmlProtocolConformance::generalMachine() const
+QUmlProtocolStateMachine *QUmlProtocolConformance::generalMachine() const
{
// This is a read-write association end
@@ -102,8 +114,7 @@ void QUmlProtocolConformance::setGeneralMachine(QUmlProtocolStateMachine *genera
/*!
Specifies the state machine which conforms to the general state machine.
*/
-QUmlProtocolStateMachine *
-QUmlProtocolConformance::specificMachine() const
+QUmlProtocolStateMachine *QUmlProtocolConformance::specificMachine() const
{
// This is a read-write association end
diff --git a/src/uml/qumlprotocolconformance.h b/src/uml/qumlprotocolconformance.h
index 6c05039b..2e368ff0 100644
--- a/src/uml/qumlprotocolconformance.h
+++ b/src/uml/qumlprotocolconformance.h
@@ -60,6 +60,8 @@ public:
explicit QUmlProtocolConformance(bool createQObject = true);
virtual ~QUmlProtocolConformance();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlProtocolStateMachine *generalMachine() const;
void setGeneralMachine(QUmlProtocolStateMachine *generalMachine);
diff --git a/src/uml/qumlprotocolstatemachine.cpp b/src/uml/qumlprotocolstatemachine.cpp
index 28a6f421..4c801d8a 100644
--- a/src/uml/qumlprotocolstatemachine.cpp
+++ b/src/uml/qumlprotocolstatemachine.cpp
@@ -42,8 +42,51 @@
#include "private/qumlprotocolstatemachineobject_p.h"
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlBehavioralFeature>
+#include <QtUml/QUmlBehavioredClassifier>
+#include <QtUml/QUmlClass>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElement>
+#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExtension>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlInterfaceRealization>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameter>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlParameterSet>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlProperty>
#include <QtUml/QUmlProtocolConformance>
-
+#include <QtUml/QUmlPseudostate>
+#include <QtUml/QUmlReception>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlRegion>
+#include <QtUml/QUmlState>
+#include <QtUml/QUmlStateMachine>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlProtocolStateMachine
@@ -66,13 +109,99 @@ QUmlProtocolStateMachine::~QUmlProtocolStateMachine()
}
}
+QModelingObject *QUmlProtocolStateMachine::clone() const
+{
+ QUmlProtocolStateMachine *c = new QUmlProtocolStateMachine;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlConnector *element, ownedConnector())
+ c->addOwnedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setActive(isActive());
+ foreach (QUmlClassifier *element, nestedClassifier())
+ c->addNestedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ foreach (QUmlReception *element, ownedReception())
+ c->addOwnedReception(dynamic_cast<QUmlReception *>(element->clone()));
+ c->setReentrant(isReentrant());
+ foreach (QUmlParameter *element, ownedParameter())
+ c->addOwnedParameter(dynamic_cast<QUmlParameter *>(element->clone()));
+ foreach (QUmlParameterSet *element, ownedParameterSet())
+ c->addOwnedParameterSet(dynamic_cast<QUmlParameterSet *>(element->clone()));
+ foreach (QUmlConstraint *element, postcondition())
+ c->addPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, precondition())
+ c->addPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (specification())
+ c->setSpecification(dynamic_cast<QUmlBehavioralFeature *>(specification()->clone()));
+ foreach (QUmlPseudostate *element, connectionPoint())
+ c->addConnectionPoint(dynamic_cast<QUmlPseudostate *>(element->clone()));
+ foreach (QUmlStateMachine *element, extendedStateMachine())
+ c->addExtendedStateMachine(dynamic_cast<QUmlStateMachine *>(element->clone()));
+ foreach (QUmlRegion *element, region())
+ c->addRegion(dynamic_cast<QUmlRegion *>(element->clone()));
+ foreach (QUmlState *element, submachineState())
+ c->addSubmachineState(dynamic_cast<QUmlState *>(element->clone()));
+ foreach (QUmlProtocolConformance *element, conformance())
+ c->addConformance(dynamic_cast<QUmlProtocolConformance *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Conformance between protocol state machines.
*/
-const QSet<QUmlProtocolConformance *>
-QUmlProtocolStateMachine::conformance() const
+const QSet<QUmlProtocolConformance *> QUmlProtocolStateMachine::conformance() const
{
// This is a read-write association end
diff --git a/src/uml/qumlprotocolstatemachine.h b/src/uml/qumlprotocolstatemachine.h
index 3b089086..66697d76 100644
--- a/src/uml/qumlprotocolstatemachine.h
+++ b/src/uml/qumlprotocolstatemachine.h
@@ -60,6 +60,8 @@ public:
explicit QUmlProtocolStateMachine(bool createQObject = true);
virtual ~QUmlProtocolStateMachine();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlProtocolConformance *> conformance() const;
void addConformance(QUmlProtocolConformance *conformance);
diff --git a/src/uml/qumlprotocoltransition.cpp b/src/uml/qumlprotocoltransition.cpp
index 79e48d2c..5bee0d27 100644
--- a/src/uml/qumlprotocoltransition.cpp
+++ b/src/uml/qumlprotocoltransition.cpp
@@ -42,9 +42,26 @@
#include "private/qumlprotocoltransitionobject_p.h"
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOperation>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRegion>
+#include <QtUml/QUmlStateMachine>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTransition>
+#include <QtUml/QUmlTrigger>
+#include <QtUml/QUmlVertex>
/*!
\class QUmlProtocolTransition
@@ -69,13 +86,52 @@ QUmlProtocolTransition::~QUmlProtocolTransition()
}
}
+QModelingObject *QUmlProtocolTransition::clone() const
+{
+ QUmlProtocolTransition *c = new QUmlProtocolTransition;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (container())
+ c->setContainer(dynamic_cast<QUmlRegion *>(container()->clone()));
+ if (effect())
+ c->setEffect(dynamic_cast<QUmlBehavior *>(effect()->clone()));
+ if (guard())
+ c->setGuard(dynamic_cast<QUmlConstraint *>(guard()->clone()));
+ c->setKind(kind());
+ if (redefinedTransition())
+ c->setRedefinedTransition(dynamic_cast<QUmlTransition *>(redefinedTransition()->clone()));
+ if (source())
+ c->setSource(dynamic_cast<QUmlVertex *>(source()->clone()));
+ if (target())
+ c->setTarget(dynamic_cast<QUmlVertex *>(target()->clone()));
+ foreach (QUmlTrigger *element, trigger())
+ c->addTrigger(dynamic_cast<QUmlTrigger *>(element->clone()));
+ if (postCondition())
+ c->setPostCondition(dynamic_cast<QUmlConstraint *>(postCondition()->clone()));
+ if (preCondition())
+ c->setPreCondition(dynamic_cast<QUmlConstraint *>(preCondition()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies the post condition of the transition which is the condition that should be obtained once the transition is triggered. This post condition is part of the post condition of the operation connected to the transition.
*/
-QUmlConstraint *
-QUmlProtocolTransition::postCondition() const
+QUmlConstraint *QUmlProtocolTransition::postCondition() const
{
// This is a read-write association end
@@ -105,8 +161,7 @@ void QUmlProtocolTransition::setPostCondition(QUmlConstraint *postCondition)
/*!
Specifies the precondition of the transition. It specifies the condition that should be verified before triggering the transition. This guard condition added to the source state will be evaluated as part of the precondition of the operation referred by the transition if any.
*/
-QUmlConstraint *
-QUmlProtocolTransition::preCondition() const
+QUmlConstraint *QUmlProtocolTransition::preCondition() const
{
// This is a read-write association end
@@ -133,8 +188,7 @@ void QUmlProtocolTransition::setPreCondition(QUmlConstraint *preCondition)
/*!
This association refers to the associated operation. It is derived from the operation of the call trigger when applicable.
*/
-const QSet<QUmlOperation *>
-QUmlProtocolTransition::referred() const
+const QSet<QUmlOperation *> QUmlProtocolTransition::referred() const
{
// This is a read-only derived association end
diff --git a/src/uml/qumlprotocoltransition.h b/src/uml/qumlprotocoltransition.h
index 941db63a..29a29b4f 100644
--- a/src/uml/qumlprotocoltransition.h
+++ b/src/uml/qumlprotocoltransition.h
@@ -61,6 +61,8 @@ public:
explicit QUmlProtocolTransition(bool createQObject = true);
virtual ~QUmlProtocolTransition();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlConstraint *postCondition() const;
void setPostCondition(QUmlConstraint *postCondition);
diff --git a/src/uml/qumlpseudostate.cpp b/src/uml/qumlpseudostate.cpp
index 22c18619..0e2528b5 100644
--- a/src/uml/qumlpseudostate.cpp
+++ b/src/uml/qumlpseudostate.cpp
@@ -42,9 +42,17 @@
#include "private/qumlpseudostateobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRegion>
#include <QtUml/QUmlState>
#include <QtUml/QUmlStateMachine>
-
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTransition>
/*!
\class QUmlPseudostate
@@ -69,13 +77,33 @@ QUmlPseudostate::~QUmlPseudostate()
}
}
+QModelingObject *QUmlPseudostate::clone() const
+{
+ QUmlPseudostate *c = new QUmlPseudostate;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (container())
+ c->setContainer(dynamic_cast<QUmlRegion *>(container()->clone()));
+ c->setKind(kind());
+ if (state())
+ c->setState(dynamic_cast<QUmlState *>(state()->clone()));
+ if (stateMachine())
+ c->setStateMachine(dynamic_cast<QUmlStateMachine *>(stateMachine()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Determines the precise type of the Pseudostate and can be one of: entryPoint, exitPoint, initial, deepHistory, shallowHistory, join, fork, junction, terminate or choice.
*/
-QtUml::PseudostateKind
-QUmlPseudostate::kind() const
+QtUml::PseudostateKind QUmlPseudostate::kind() const
{
// This is a read-write property
@@ -94,8 +122,7 @@ void QUmlPseudostate::setKind(QtUml::PseudostateKind kind)
/*!
The State that owns this pseudostate and in which it appears.
*/
-QUmlState *
-QUmlPseudostate::state() const
+QUmlState *QUmlPseudostate::state() const
{
// This is a read-write association end
@@ -121,8 +148,7 @@ void QUmlPseudostate::setState(QUmlState *state)
/*!
The StateMachine in which this Pseudostate is defined. This only applies to Pseudostates of the kind entryPoint or exitPoint.
*/
-QUmlStateMachine *
-QUmlPseudostate::stateMachine() const
+QUmlStateMachine *QUmlPseudostate::stateMachine() const
{
// This is a read-write association end
diff --git a/src/uml/qumlpseudostate.h b/src/uml/qumlpseudostate.h
index 6f6be837..2a3eb8b5 100644
--- a/src/uml/qumlpseudostate.h
+++ b/src/uml/qumlpseudostate.h
@@ -63,6 +63,8 @@ public:
explicit QUmlPseudostate(bool createQObject = true);
virtual ~QUmlPseudostate();
+ QModelingObject *clone() const;
+
// Owned attributes
QtUml::PseudostateKind kind() const;
void setKind(QtUml::PseudostateKind kind);
diff --git a/src/uml/qumlqualifiervalue.cpp b/src/uml/qumlqualifiervalue.cpp
index 5331e121..96b50f48 100644
--- a/src/uml/qumlqualifiervalue.cpp
+++ b/src/uml/qumlqualifiervalue.cpp
@@ -42,9 +42,10 @@
#include "private/qumlqualifiervalueobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlInputPin>
#include <QtUml/QUmlProperty>
-
/*!
\class QUmlQualifierValue
@@ -68,13 +69,24 @@ QUmlQualifierValue::~QUmlQualifierValue()
}
}
+QModelingObject *QUmlQualifierValue::clone() const
+{
+ QUmlQualifierValue *c = new QUmlQualifierValue;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (qualifier())
+ c->setQualifier(dynamic_cast<QUmlProperty *>(qualifier()->clone()));
+ if (value())
+ c->setValue(dynamic_cast<QUmlInputPin *>(value()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Attribute representing the qualifier for which the value is to be specified.
*/
-QUmlProperty *
-QUmlQualifierValue::qualifier() const
+QUmlProperty *QUmlQualifierValue::qualifier() const
{
// This is a read-write association end
@@ -95,8 +107,7 @@ void QUmlQualifierValue::setQualifier(QUmlProperty *qualifier)
/*!
Input pin from which the specified value for the qualifier is taken.
*/
-QUmlInputPin *
-QUmlQualifierValue::value() const
+QUmlInputPin *QUmlQualifierValue::value() const
{
// This is a read-write association end
diff --git a/src/uml/qumlqualifiervalue.h b/src/uml/qumlqualifiervalue.h
index cfcce0d1..58319ab9 100644
--- a/src/uml/qumlqualifiervalue.h
+++ b/src/uml/qumlqualifiervalue.h
@@ -61,6 +61,8 @@ public:
explicit QUmlQualifierValue(bool createQObject = true);
virtual ~QUmlQualifierValue();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlProperty *qualifier() const;
void setQualifier(QUmlProperty *qualifier);
diff --git a/src/uml/qumlraiseexceptionaction.cpp b/src/uml/qumlraiseexceptionaction.cpp
index aecc455a..6a9f994a 100644
--- a/src/uml/qumlraiseexceptionaction.cpp
+++ b/src/uml/qumlraiseexceptionaction.cpp
@@ -42,8 +42,26 @@
#include "private/qumlraiseexceptionactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
-
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlRaiseExceptionAction
@@ -66,13 +84,50 @@ QUmlRaiseExceptionAction::~QUmlRaiseExceptionAction()
}
}
+QModelingObject *QUmlRaiseExceptionAction::clone() const
+{
+ QUmlRaiseExceptionAction *c = new QUmlRaiseExceptionAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (exception())
+ c->setException(dynamic_cast<QUmlInputPin *>(exception()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
An input pin whose value becomes an exception object.
*/
-QUmlInputPin *
-QUmlRaiseExceptionAction::exception() const
+QUmlInputPin *QUmlRaiseExceptionAction::exception() const
{
// This is a read-write association end
diff --git a/src/uml/qumlraiseexceptionaction.h b/src/uml/qumlraiseexceptionaction.h
index c31c39ce..72bb8933 100644
--- a/src/uml/qumlraiseexceptionaction.h
+++ b/src/uml/qumlraiseexceptionaction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlRaiseExceptionAction(bool createQObject = true);
virtual ~QUmlRaiseExceptionAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlInputPin *exception() const;
void setException(QUmlInputPin *exception);
diff --git a/src/uml/qumlreadextentaction.cpp b/src/uml/qumlreadextentaction.cpp
index 38f88084..b4b6f855 100644
--- a/src/uml/qumlreadextentaction.cpp
+++ b/src/uml/qumlreadextentaction.cpp
@@ -42,9 +42,26 @@
#include "private/qumlreadextentactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlReadExtentAction
@@ -68,13 +85,52 @@ QUmlReadExtentAction::~QUmlReadExtentAction()
}
}
+QModelingObject *QUmlReadExtentAction::clone() const
+{
+ QUmlReadExtentAction *c = new QUmlReadExtentAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (classifier())
+ c->setClassifier(dynamic_cast<QUmlClassifier *>(classifier()->clone()));
+ if (result())
+ c->setResult(dynamic_cast<QUmlOutputPin *>(result()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The classifier whose instances are to be retrieved.
*/
-QUmlClassifier *
-QUmlReadExtentAction::classifier() const
+QUmlClassifier *QUmlReadExtentAction::classifier() const
{
// This is a read-write association end
@@ -95,8 +151,7 @@ void QUmlReadExtentAction::setClassifier(QUmlClassifier *classifier)
/*!
The runtime instances of the classifier.
*/
-QUmlOutputPin *
-QUmlReadExtentAction::result() const
+QUmlOutputPin *QUmlReadExtentAction::result() const
{
// This is a read-write association end
diff --git a/src/uml/qumlreadextentaction.h b/src/uml/qumlreadextentaction.h
index 84ab4e0b..aef150ba 100644
--- a/src/uml/qumlreadextentaction.h
+++ b/src/uml/qumlreadextentaction.h
@@ -61,6 +61,8 @@ public:
explicit QUmlReadExtentAction(bool createQObject = true);
virtual ~QUmlReadExtentAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlClassifier *classifier() const;
void setClassifier(QUmlClassifier *classifier);
diff --git a/src/uml/qumlreadisclassifiedobjectaction.cpp b/src/uml/qumlreadisclassifiedobjectaction.cpp
index 47050cd9..7f67fd03 100644
--- a/src/uml/qumlreadisclassifiedobjectaction.cpp
+++ b/src/uml/qumlreadisclassifiedobjectaction.cpp
@@ -42,10 +42,26 @@
#include "private/qumlreadisclassifiedobjectactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlReadIsClassifiedObjectAction
@@ -71,13 +87,55 @@ QUmlReadIsClassifiedObjectAction::~QUmlReadIsClassifiedObjectAction()
}
}
+QModelingObject *QUmlReadIsClassifiedObjectAction::clone() const
+{
+ QUmlReadIsClassifiedObjectAction *c = new QUmlReadIsClassifiedObjectAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (classifier())
+ c->setClassifier(dynamic_cast<QUmlClassifier *>(classifier()->clone()));
+ c->setDirect(isDirect());
+ if (object())
+ c->setObject(dynamic_cast<QUmlInputPin *>(object()->clone()));
+ if (result())
+ c->setResult(dynamic_cast<QUmlOutputPin *>(result()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The classifier against which the classification of the input object is tested.
*/
-QUmlClassifier *
-QUmlReadIsClassifiedObjectAction::classifier() const
+QUmlClassifier *QUmlReadIsClassifiedObjectAction::classifier() const
{
// This is a read-write association end
@@ -98,8 +156,7 @@ void QUmlReadIsClassifiedObjectAction::setClassifier(QUmlClassifier *classifier)
/*!
Indicates whether the classifier must directly classify the input object.
*/
-bool
-QUmlReadIsClassifiedObjectAction::isDirect() const
+bool QUmlReadIsClassifiedObjectAction::isDirect() const
{
// This is a read-write property
@@ -118,8 +175,7 @@ void QUmlReadIsClassifiedObjectAction::setDirect(bool isDirect)
/*!
Holds the object whose classification is to be tested.
*/
-QUmlInputPin *
-QUmlReadIsClassifiedObjectAction::object() const
+QUmlInputPin *QUmlReadIsClassifiedObjectAction::object() const
{
// This is a read-write association end
@@ -149,8 +205,7 @@ void QUmlReadIsClassifiedObjectAction::setObject(QUmlInputPin *object)
/*!
After termination of the action, will hold the result of the test.
*/
-QUmlOutputPin *
-QUmlReadIsClassifiedObjectAction::result() const
+QUmlOutputPin *QUmlReadIsClassifiedObjectAction::result() const
{
// This is a read-write association end
diff --git a/src/uml/qumlreadisclassifiedobjectaction.h b/src/uml/qumlreadisclassifiedobjectaction.h
index 6e35d4fe..4953bf16 100644
--- a/src/uml/qumlreadisclassifiedobjectaction.h
+++ b/src/uml/qumlreadisclassifiedobjectaction.h
@@ -62,6 +62,8 @@ public:
explicit QUmlReadIsClassifiedObjectAction(bool createQObject = true);
virtual ~QUmlReadIsClassifiedObjectAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlClassifier *classifier() const;
void setClassifier(QUmlClassifier *classifier);
diff --git a/src/uml/qumlreadlinkaction.cpp b/src/uml/qumlreadlinkaction.cpp
index 72cda836..c0343c92 100644
--- a/src/uml/qumlreadlinkaction.cpp
+++ b/src/uml/qumlreadlinkaction.cpp
@@ -42,8 +42,28 @@
#include "private/qumlreadlinkactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlAssociation>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlLinkEndData>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlReadLinkAction
@@ -66,13 +86,54 @@ QUmlReadLinkAction::~QUmlReadLinkAction()
}
}
+QModelingObject *QUmlReadLinkAction::clone() const
+{
+ QUmlReadLinkAction *c = new QUmlReadLinkAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlLinkEndData *element, endData())
+ c->addEndData(dynamic_cast<QUmlLinkEndData *>(element->clone()));
+ foreach (QUmlInputPin *element, inputValue())
+ c->addInputValue(dynamic_cast<QUmlInputPin *>(element->clone()));
+ if (result())
+ c->setResult(dynamic_cast<QUmlOutputPin *>(result()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The pin on which are put the objects participating in the association at the end not specified by the inputs.
*/
-QUmlOutputPin *
-QUmlReadLinkAction::result() const
+QUmlOutputPin *QUmlReadLinkAction::result() const
{
// This is a read-write association end
diff --git a/src/uml/qumlreadlinkaction.h b/src/uml/qumlreadlinkaction.h
index 576a949c..cbff5c6b 100644
--- a/src/uml/qumlreadlinkaction.h
+++ b/src/uml/qumlreadlinkaction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlReadLinkAction(bool createQObject = true);
virtual ~QUmlReadLinkAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlOutputPin *result() const;
void setResult(QUmlOutputPin *result);
diff --git a/src/uml/qumlreadlinkobjectendaction.cpp b/src/uml/qumlreadlinkobjectendaction.cpp
index 9981b637..86eaa3b5 100644
--- a/src/uml/qumlreadlinkobjectendaction.cpp
+++ b/src/uml/qumlreadlinkobjectendaction.cpp
@@ -42,10 +42,27 @@
#include "private/qumlreadlinkobjectendactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
#include <QtUml/QUmlProperty>
-
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlReadLinkObjectEndAction
@@ -70,13 +87,54 @@ QUmlReadLinkObjectEndAction::~QUmlReadLinkObjectEndAction()
}
}
+QModelingObject *QUmlReadLinkObjectEndAction::clone() const
+{
+ QUmlReadLinkObjectEndAction *c = new QUmlReadLinkObjectEndAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (end())
+ c->setEnd(dynamic_cast<QUmlProperty *>(end()->clone()));
+ if (object())
+ c->setObject(dynamic_cast<QUmlInputPin *>(object()->clone()));
+ if (result())
+ c->setResult(dynamic_cast<QUmlOutputPin *>(result()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Link end to be read.
*/
-QUmlProperty *
-QUmlReadLinkObjectEndAction::end() const
+QUmlProperty *QUmlReadLinkObjectEndAction::end() const
{
// This is a read-write association end
@@ -97,8 +155,7 @@ void QUmlReadLinkObjectEndAction::setEnd(QUmlProperty *end)
/*!
Gives the input pin from which the link object is obtained.
*/
-QUmlInputPin *
-QUmlReadLinkObjectEndAction::object() const
+QUmlInputPin *QUmlReadLinkObjectEndAction::object() const
{
// This is a read-write association end
@@ -128,8 +185,7 @@ void QUmlReadLinkObjectEndAction::setObject(QUmlInputPin *object)
/*!
Pin where the result value is placed.
*/
-QUmlOutputPin *
-QUmlReadLinkObjectEndAction::result() const
+QUmlOutputPin *QUmlReadLinkObjectEndAction::result() const
{
// This is a read-write association end
diff --git a/src/uml/qumlreadlinkobjectendaction.h b/src/uml/qumlreadlinkobjectendaction.h
index 65f6c07b..b0489f4d 100644
--- a/src/uml/qumlreadlinkobjectendaction.h
+++ b/src/uml/qumlreadlinkobjectendaction.h
@@ -62,6 +62,8 @@ public:
explicit QUmlReadLinkObjectEndAction(bool createQObject = true);
virtual ~QUmlReadLinkObjectEndAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlProperty *end() const;
void setEnd(QUmlProperty *end);
diff --git a/src/uml/qumlreadlinkobjectendqualifieraction.cpp b/src/uml/qumlreadlinkobjectendqualifieraction.cpp
index 8cb5a9ff..005b6266 100644
--- a/src/uml/qumlreadlinkobjectendqualifieraction.cpp
+++ b/src/uml/qumlreadlinkobjectendqualifieraction.cpp
@@ -42,10 +42,27 @@
#include "private/qumlreadlinkobjectendqualifieractionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
#include <QtUml/QUmlProperty>
-
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlReadLinkObjectEndQualifierAction
@@ -70,13 +87,54 @@ QUmlReadLinkObjectEndQualifierAction::~QUmlReadLinkObjectEndQualifierAction()
}
}
+QModelingObject *QUmlReadLinkObjectEndQualifierAction::clone() const
+{
+ QUmlReadLinkObjectEndQualifierAction *c = new QUmlReadLinkObjectEndQualifierAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (object())
+ c->setObject(dynamic_cast<QUmlInputPin *>(object()->clone()));
+ if (qualifier())
+ c->setQualifier(dynamic_cast<QUmlProperty *>(qualifier()->clone()));
+ if (result())
+ c->setResult(dynamic_cast<QUmlOutputPin *>(result()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Gives the input pin from which the link object is obtained.
*/
-QUmlInputPin *
-QUmlReadLinkObjectEndQualifierAction::object() const
+QUmlInputPin *QUmlReadLinkObjectEndQualifierAction::object() const
{
// This is a read-write association end
@@ -106,8 +164,7 @@ void QUmlReadLinkObjectEndQualifierAction::setObject(QUmlInputPin *object)
/*!
The attribute representing the qualifier to be read.
*/
-QUmlProperty *
-QUmlReadLinkObjectEndQualifierAction::qualifier() const
+QUmlProperty *QUmlReadLinkObjectEndQualifierAction::qualifier() const
{
// This is a read-write association end
@@ -128,8 +185,7 @@ void QUmlReadLinkObjectEndQualifierAction::setQualifier(QUmlProperty *qualifier)
/*!
Pin where the result value is placed.
*/
-QUmlOutputPin *
-QUmlReadLinkObjectEndQualifierAction::result() const
+QUmlOutputPin *QUmlReadLinkObjectEndQualifierAction::result() const
{
// This is a read-write association end
diff --git a/src/uml/qumlreadlinkobjectendqualifieraction.h b/src/uml/qumlreadlinkobjectendqualifieraction.h
index 5c45beab..d010cfda 100644
--- a/src/uml/qumlreadlinkobjectendqualifieraction.h
+++ b/src/uml/qumlreadlinkobjectendqualifieraction.h
@@ -62,6 +62,8 @@ public:
explicit QUmlReadLinkObjectEndQualifierAction(bool createQObject = true);
virtual ~QUmlReadLinkObjectEndQualifierAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlInputPin *object() const;
void setObject(QUmlInputPin *object);
diff --git a/src/uml/qumlreadselfaction.cpp b/src/uml/qumlreadselfaction.cpp
index e3705660..c7076df8 100644
--- a/src/uml/qumlreadselfaction.cpp
+++ b/src/uml/qumlreadselfaction.cpp
@@ -42,8 +42,26 @@
#include "private/qumlreadselfactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlReadSelfAction
@@ -66,13 +84,50 @@ QUmlReadSelfAction::~QUmlReadSelfAction()
}
}
+QModelingObject *QUmlReadSelfAction::clone() const
+{
+ QUmlReadSelfAction *c = new QUmlReadSelfAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (result())
+ c->setResult(dynamic_cast<QUmlOutputPin *>(result()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Gives the output pin on which the hosting object is placed.
*/
-QUmlOutputPin *
-QUmlReadSelfAction::result() const
+QUmlOutputPin *QUmlReadSelfAction::result() const
{
// This is a read-write association end
diff --git a/src/uml/qumlreadselfaction.h b/src/uml/qumlreadselfaction.h
index c84875e1..4bf3e33f 100644
--- a/src/uml/qumlreadselfaction.h
+++ b/src/uml/qumlreadselfaction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlReadSelfAction(bool createQObject = true);
virtual ~QUmlReadSelfAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlOutputPin *result() const;
void setResult(QUmlOutputPin *result);
diff --git a/src/uml/qumlreadstructuralfeatureaction.cpp b/src/uml/qumlreadstructuralfeatureaction.cpp
index 7e7913a4..388021b7 100644
--- a/src/uml/qumlreadstructuralfeatureaction.cpp
+++ b/src/uml/qumlreadstructuralfeatureaction.cpp
@@ -42,8 +42,27 @@
#include "private/qumlreadstructuralfeatureactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuralFeature>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlReadStructuralFeatureAction
@@ -66,13 +85,54 @@ QUmlReadStructuralFeatureAction::~QUmlReadStructuralFeatureAction()
}
}
+QModelingObject *QUmlReadStructuralFeatureAction::clone() const
+{
+ QUmlReadStructuralFeatureAction *c = new QUmlReadStructuralFeatureAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (object())
+ c->setObject(dynamic_cast<QUmlInputPin *>(object()->clone()));
+ if (structuralFeature())
+ c->setStructuralFeature(dynamic_cast<QUmlStructuralFeature *>(structuralFeature()->clone()));
+ if (result())
+ c->setResult(dynamic_cast<QUmlOutputPin *>(result()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Gives the output pin on which the result is put.
*/
-QUmlOutputPin *
-QUmlReadStructuralFeatureAction::result() const
+QUmlOutputPin *QUmlReadStructuralFeatureAction::result() const
{
// This is a read-write association end
diff --git a/src/uml/qumlreadstructuralfeatureaction.h b/src/uml/qumlreadstructuralfeatureaction.h
index 12d465e7..aeffbe73 100644
--- a/src/uml/qumlreadstructuralfeatureaction.h
+++ b/src/uml/qumlreadstructuralfeatureaction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlReadStructuralFeatureAction(bool createQObject = true);
virtual ~QUmlReadStructuralFeatureAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlOutputPin *result() const;
void setResult(QUmlOutputPin *result);
diff --git a/src/uml/qumlreadvariableaction.cpp b/src/uml/qumlreadvariableaction.cpp
index 2acd0c26..39324ca3 100644
--- a/src/uml/qumlreadvariableaction.cpp
+++ b/src/uml/qumlreadvariableaction.cpp
@@ -42,8 +42,27 @@
#include "private/qumlreadvariableactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlVariable>
/*!
\class QUmlReadVariableAction
@@ -66,13 +85,52 @@ QUmlReadVariableAction::~QUmlReadVariableAction()
}
}
+QModelingObject *QUmlReadVariableAction::clone() const
+{
+ QUmlReadVariableAction *c = new QUmlReadVariableAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (variable())
+ c->setVariable(dynamic_cast<QUmlVariable *>(variable()->clone()));
+ if (result())
+ c->setResult(dynamic_cast<QUmlOutputPin *>(result()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Gives the output pin on which the result is put.
*/
-QUmlOutputPin *
-QUmlReadVariableAction::result() const
+QUmlOutputPin *QUmlReadVariableAction::result() const
{
// This is a read-write association end
diff --git a/src/uml/qumlreadvariableaction.h b/src/uml/qumlreadvariableaction.h
index eb6f0983..e106a395 100644
--- a/src/uml/qumlreadvariableaction.h
+++ b/src/uml/qumlreadvariableaction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlReadVariableAction(bool createQObject = true);
virtual ~QUmlReadVariableAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlOutputPin *result() const;
void setResult(QUmlOutputPin *result);
diff --git a/src/uml/qumlrealization.cpp b/src/uml/qumlrealization.cpp
index a0d23b3c..ee77e9e0 100644
--- a/src/uml/qumlrealization.cpp
+++ b/src/uml/qumlrealization.cpp
@@ -42,6 +42,16 @@
#include "private/qumlrealizationobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOpaqueExpression>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlRealization
@@ -64,3 +74,27 @@ QUmlRealization::~QUmlRealization()
}
}
+QModelingObject *QUmlRealization::clone() const
+{
+ QUmlRealization *c = new QUmlRealization;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlNamedElement *element, client())
+ c->addClient(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ foreach (QUmlNamedElement *element, supplier())
+ c->addSupplier(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ if (mapping())
+ c->setMapping(dynamic_cast<QUmlOpaqueExpression *>(mapping()->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlrealization.h b/src/uml/qumlrealization.h
index 6d5b3e14..806cb994 100644
--- a/src/uml/qumlrealization.h
+++ b/src/uml/qumlrealization.h
@@ -58,6 +58,8 @@ public:
explicit QUmlRealization(bool createQObject = true);
virtual ~QUmlRealization();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlreception.cpp b/src/uml/qumlreception.cpp
index c5fd77ae..ea70f0ef 100644
--- a/src/uml/qumlreception.cpp
+++ b/src/uml/qumlreception.cpp
@@ -42,8 +42,24 @@
#include "private/qumlreceptionobject_p.h"
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameter>
+#include <QtUml/QUmlParameterSet>
+#include <QtUml/QUmlRedefinableElement>
#include <QtUml/QUmlSignal>
-
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlType>
/*!
\class QUmlReception
@@ -66,13 +82,46 @@ QUmlReception::~QUmlReception()
}
}
+QModelingObject *QUmlReception::clone() const
+{
+ QUmlReception *c = new QUmlReception;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ c->setLeaf(isLeaf());
+ c->setStatic(isStatic());
+ c->setConcurrency(concurrency());
+ c->setAbstract(isAbstract());
+ foreach (QUmlBehavior *element, method())
+ c->addMethod(dynamic_cast<QUmlBehavior *>(element->clone()));
+ foreach (QUmlParameter *element, ownedParameter())
+ c->addOwnedParameter(dynamic_cast<QUmlParameter *>(element->clone()));
+ foreach (QUmlParameterSet *element, ownedParameterSet())
+ c->addOwnedParameterSet(dynamic_cast<QUmlParameterSet *>(element->clone()));
+ foreach (QUmlType *element, raisedException())
+ c->addRaisedException(dynamic_cast<QUmlType *>(element->clone()));
+ if (signal())
+ c->setSignal(dynamic_cast<QUmlSignal *>(signal()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The signal that this reception handles.
*/
-QUmlSignal *
-QUmlReception::signal() const
+QUmlSignal *QUmlReception::signal() const
{
// This is a read-write association end
diff --git a/src/uml/qumlreception.h b/src/uml/qumlreception.h
index 57f0a2f6..e0628297 100644
--- a/src/uml/qumlreception.h
+++ b/src/uml/qumlreception.h
@@ -60,6 +60,8 @@ public:
explicit QUmlReception(bool createQObject = true);
virtual ~QUmlReception();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlSignal *signal() const;
void setSignal(QUmlSignal *signal);
diff --git a/src/uml/qumlreclassifyobjectaction.cpp b/src/uml/qumlreclassifyobjectaction.cpp
index a1902486..95a30697 100644
--- a/src/uml/qumlreclassifyobjectaction.cpp
+++ b/src/uml/qumlreclassifyobjectaction.cpp
@@ -42,9 +42,26 @@
#include "private/qumlreclassifyobjectactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
-
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlReclassifyObjectAction
@@ -68,13 +85,55 @@ QUmlReclassifyObjectAction::~QUmlReclassifyObjectAction()
}
}
+QModelingObject *QUmlReclassifyObjectAction::clone() const
+{
+ QUmlReclassifyObjectAction *c = new QUmlReclassifyObjectAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ c->setReplaceAll(isReplaceAll());
+ foreach (QUmlClassifier *element, newClassifier())
+ c->addNewClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (object())
+ c->setObject(dynamic_cast<QUmlInputPin *>(object()->clone()));
+ foreach (QUmlClassifier *element, oldClassifier())
+ c->addOldClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies whether existing classifiers should be removed before adding the new classifiers.
*/
-bool
-QUmlReclassifyObjectAction::isReplaceAll() const
+bool QUmlReclassifyObjectAction::isReplaceAll() const
{
// This is a read-write property
@@ -93,8 +152,7 @@ void QUmlReclassifyObjectAction::setReplaceAll(bool isReplaceAll)
/*!
A set of classifiers to be added to the classifiers of the object.
*/
-const QSet<QUmlClassifier *>
-QUmlReclassifyObjectAction::newClassifier() const
+const QSet<QUmlClassifier *> QUmlReclassifyObjectAction::newClassifier() const
{
// This is a read-write association end
@@ -124,8 +182,7 @@ void QUmlReclassifyObjectAction::removeNewClassifier(QUmlClassifier *newClassifi
/*!
Holds the object to be reclassified.
*/
-QUmlInputPin *
-QUmlReclassifyObjectAction::object() const
+QUmlInputPin *QUmlReclassifyObjectAction::object() const
{
// This is a read-write association end
@@ -155,8 +212,7 @@ void QUmlReclassifyObjectAction::setObject(QUmlInputPin *object)
/*!
A set of classifiers to be removed from the classifiers of the object.
*/
-const QSet<QUmlClassifier *>
-QUmlReclassifyObjectAction::oldClassifier() const
+const QSet<QUmlClassifier *> QUmlReclassifyObjectAction::oldClassifier() const
{
// This is a read-write association end
diff --git a/src/uml/qumlreclassifyobjectaction.h b/src/uml/qumlreclassifyobjectaction.h
index 67c46516..317f0225 100644
--- a/src/uml/qumlreclassifyobjectaction.h
+++ b/src/uml/qumlreclassifyobjectaction.h
@@ -61,6 +61,8 @@ public:
explicit QUmlReclassifyObjectAction(bool createQObject = true);
virtual ~QUmlReclassifyObjectAction();
+ QModelingObject *clone() const;
+
// Owned attributes
bool isReplaceAll() const;
void setReplaceAll(bool isReplaceAll);
diff --git a/src/uml/qumlredefinableelement.cpp b/src/uml/qumlredefinableelement.cpp
index d1b11c34..c4be296d 100644
--- a/src/uml/qumlredefinableelement.cpp
+++ b/src/uml/qumlredefinableelement.cpp
@@ -41,7 +41,13 @@
#include "qumlredefinableelement.h"
#include <QtUml/QUmlClassifier>
-
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlRedefinableElement
@@ -58,13 +64,27 @@ QUmlRedefinableElement::~QUmlRedefinableElement()
{
}
+QModelingObject *QUmlRedefinableElement::clone() const
+{
+ QUmlRedefinableElement *c = new QUmlRedefinableElement;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Indicates whether it is possible to further redefine a RedefinableElement. If the value is true, then it is not possible to further redefine the RedefinableElement. Note that this property is preserved through package merge operations; that is, the capability to redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in the resulting RedefinableElement of a package merge operation where a RedefinableElement with isLeaf=false is merged with a matching RedefinableElement with isLeaf=true: the resulting RedefinableElement will have isLeaf=false. Default value is false.
*/
-bool
-QUmlRedefinableElement::isLeaf() const
+bool QUmlRedefinableElement::isLeaf() const
{
// This is a read-write property
@@ -83,8 +103,7 @@ void QUmlRedefinableElement::setLeaf(bool isLeaf)
/*!
The redefinable element that is being redefined by this element.
*/
-const QSet<QUmlRedefinableElement *>
-QUmlRedefinableElement::redefinedElement() const
+const QSet<QUmlRedefinableElement *> QUmlRedefinableElement::redefinedElement() const
{
// This is a read-only derived union association end
@@ -114,8 +133,7 @@ void QUmlRedefinableElement::removeRedefinedElement(QUmlRedefinableElement *rede
/*!
References the contexts that this element may be redefined from.
*/
-const QSet<QUmlClassifier *>
-QUmlRedefinableElement::redefinitionContext() const
+const QSet<QUmlClassifier *> QUmlRedefinableElement::redefinitionContext() const
{
// This is a read-only derived union association end
diff --git a/src/uml/qumlredefinableelement.h b/src/uml/qumlredefinableelement.h
index c4594141..dfb0a509 100644
--- a/src/uml/qumlredefinableelement.h
+++ b/src/uml/qumlredefinableelement.h
@@ -59,6 +59,8 @@ class Q_UML_EXPORT QUmlRedefinableElement : public virtual QUmlNamedElement
public:
virtual ~QUmlRedefinableElement();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
bool isLeaf() const;
void setLeaf(bool isLeaf);
diff --git a/src/uml/qumlredefinabletemplatesignature.cpp b/src/uml/qumlredefinabletemplatesignature.cpp
index cad7c0f4..bd11fef6 100644
--- a/src/uml/qumlredefinabletemplatesignature.cpp
+++ b/src/uml/qumlredefinabletemplatesignature.cpp
@@ -43,8 +43,16 @@
#include "private/qumlredefinabletemplatesignatureobject_p.h"
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateableElement>
#include <QtUml/QUmlTemplateParameter>
-
/*!
\class QUmlRedefinableTemplateSignature
@@ -68,13 +76,37 @@ QUmlRedefinableTemplateSignature::~QUmlRedefinableTemplateSignature()
}
}
+QModelingObject *QUmlRedefinableTemplateSignature::clone() const
+{
+ QUmlRedefinableTemplateSignature *c = new QUmlRedefinableTemplateSignature;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlTemplateParameter *element, ownedParameter())
+ c->addOwnedParameter(dynamic_cast<QUmlTemplateParameter *>(element->clone()));
+ foreach (QUmlTemplateParameter *element, parameter())
+ c->addParameter(dynamic_cast<QUmlTemplateParameter *>(element->clone()));
+ if (template_())
+ c->setTemplate(dynamic_cast<QUmlTemplateableElement *>(template_()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (classifier())
+ c->setClassifier(dynamic_cast<QUmlClassifier *>(classifier()->clone()));
+ foreach (QUmlRedefinableTemplateSignature *element, extendedSignature())
+ c->addExtendedSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The classifier that owns this template signature.
*/
-QUmlClassifier *
-QUmlRedefinableTemplateSignature::classifier() const
+QUmlClassifier *QUmlRedefinableTemplateSignature::classifier() const
{
// This is a read-write association end
@@ -103,8 +135,7 @@ void QUmlRedefinableTemplateSignature::setClassifier(QUmlClassifier *classifier)
/*!
The template signature that is extended by this template signature.
*/
-const QSet<QUmlRedefinableTemplateSignature *>
-QUmlRedefinableTemplateSignature::extendedSignature() const
+const QSet<QUmlRedefinableTemplateSignature *> QUmlRedefinableTemplateSignature::extendedSignature() const
{
// This is a read-write association end
@@ -140,8 +171,7 @@ void QUmlRedefinableTemplateSignature::removeExtendedSignature(QUmlRedefinableTe
/*!
The formal template parameters of the extendedSignature.
*/
-const QSet<QUmlTemplateParameter *>
-QUmlRedefinableTemplateSignature::inheritedParameter() const
+const QSet<QUmlTemplateParameter *> QUmlRedefinableTemplateSignature::inheritedParameter() const
{
// This is a read-only derived association end
diff --git a/src/uml/qumlredefinabletemplatesignature.h b/src/uml/qumlredefinabletemplatesignature.h
index e5b9dfa7..6bbe82af 100644
--- a/src/uml/qumlredefinabletemplatesignature.h
+++ b/src/uml/qumlredefinabletemplatesignature.h
@@ -62,6 +62,8 @@ public:
explicit QUmlRedefinableTemplateSignature(bool createQObject = true);
virtual ~QUmlRedefinableTemplateSignature();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlClassifier *classifier() const;
void setClassifier(QUmlClassifier *classifier);
diff --git a/src/uml/qumlreduceaction.cpp b/src/uml/qumlreduceaction.cpp
index dd628f0d..ba350549 100644
--- a/src/uml/qumlreduceaction.cpp
+++ b/src/uml/qumlreduceaction.cpp
@@ -42,10 +42,27 @@
#include "private/qumlreduceactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlReduceAction
@@ -71,13 +88,55 @@ QUmlReduceAction::~QUmlReduceAction()
}
}
+QModelingObject *QUmlReduceAction::clone() const
+{
+ QUmlReduceAction *c = new QUmlReduceAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (collection())
+ c->setCollection(dynamic_cast<QUmlInputPin *>(collection()->clone()));
+ c->setOrdered(isOrdered());
+ if (reducer())
+ c->setReducer(dynamic_cast<QUmlBehavior *>(reducer()->clone()));
+ if (result())
+ c->setResult(dynamic_cast<QUmlOutputPin *>(result()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The collection to be reduced.
*/
-QUmlInputPin *
-QUmlReduceAction::collection() const
+QUmlInputPin *QUmlReduceAction::collection() const
{
// This is a read-write association end
@@ -107,8 +166,7 @@ void QUmlReduceAction::setCollection(QUmlInputPin *collection)
/*!
Tells whether the order of the input collection should determine the order in which the behavior is applied to its elements.
*/
-bool
-QUmlReduceAction::isOrdered() const
+bool QUmlReduceAction::isOrdered() const
{
// This is a read-write property
@@ -127,8 +185,7 @@ void QUmlReduceAction::setOrdered(bool isOrdered)
/*!
Behavior that is applied to two elements of the input collection to produce a value that is the same type as elements of the collection.
*/
-QUmlBehavior *
-QUmlReduceAction::reducer() const
+QUmlBehavior *QUmlReduceAction::reducer() const
{
// This is a read-write association end
@@ -149,8 +206,7 @@ void QUmlReduceAction::setReducer(QUmlBehavior *reducer)
/*!
Gives the output pin on which the result is put.
*/
-QUmlOutputPin *
-QUmlReduceAction::result() const
+QUmlOutputPin *QUmlReduceAction::result() const
{
// This is a read-write association end
diff --git a/src/uml/qumlreduceaction.h b/src/uml/qumlreduceaction.h
index d5eb9eed..5ad4a1fd 100644
--- a/src/uml/qumlreduceaction.h
+++ b/src/uml/qumlreduceaction.h
@@ -62,6 +62,8 @@ public:
explicit QUmlReduceAction(bool createQObject = true);
virtual ~QUmlReduceAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlInputPin *collection() const;
void setCollection(QUmlInputPin *collection);
diff --git a/src/uml/qumlregion.cpp b/src/uml/qumlregion.cpp
index 94abc179..a720469a 100644
--- a/src/uml/qumlregion.cpp
+++ b/src/uml/qumlregion.cpp
@@ -43,11 +43,22 @@
#include "private/qumlregionobject_p.h"
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlRedefinableElement>
#include <QtUml/QUmlState>
#include <QtUml/QUmlStateMachine>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlTransition>
#include <QtUml/QUmlVertex>
-
/*!
\class QUmlRegion
@@ -72,13 +83,43 @@ QUmlRegion::~QUmlRegion()
}
}
+QModelingObject *QUmlRegion::clone() const
+{
+ QUmlRegion *c = new QUmlRegion;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (extendedRegion())
+ c->setExtendedRegion(dynamic_cast<QUmlRegion *>(extendedRegion()->clone()));
+ if (state())
+ c->setState(dynamic_cast<QUmlState *>(state()->clone()));
+ if (stateMachine())
+ c->setStateMachine(dynamic_cast<QUmlStateMachine *>(stateMachine()->clone()));
+ foreach (QUmlVertex *element, subvertex())
+ c->addSubvertex(dynamic_cast<QUmlVertex *>(element->clone()));
+ foreach (QUmlTransition *element, transition())
+ c->addTransition(dynamic_cast<QUmlTransition *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The region of which this region is an extension.
*/
-QUmlRegion *
-QUmlRegion::extendedRegion() const
+QUmlRegion *QUmlRegion::extendedRegion() const
{
// This is a read-write association end
@@ -107,8 +148,7 @@ void QUmlRegion::setExtendedRegion(QUmlRegion *extendedRegion)
/*!
References the classifier in which context this element may be redefined.
*/
-QUmlClassifier *
-QUmlRegion::redefinitionContext() const
+QUmlClassifier *QUmlRegion::redefinitionContext() const
{
// This is a read-only derived association end
@@ -132,8 +172,7 @@ void QUmlRegion::setRedefinitionContext(QUmlClassifier *redefinitionContext)
/*!
The State that owns the Region. If a Region is owned by a State, then it cannot also be owned by a StateMachine.
*/
-QUmlState *
-QUmlRegion::state() const
+QUmlState *QUmlRegion::state() const
{
// This is a read-write association end
@@ -159,8 +198,7 @@ void QUmlRegion::setState(QUmlState *state)
/*!
The StateMachine that owns the Region. If a Region is owned by a StateMachine, then it cannot also be owned by a State.
*/
-QUmlStateMachine *
-QUmlRegion::stateMachine() const
+QUmlStateMachine *QUmlRegion::stateMachine() const
{
// This is a read-write association end
@@ -186,8 +224,7 @@ void QUmlRegion::setStateMachine(QUmlStateMachine *stateMachine)
/*!
The set of vertices that are owned by this region.
*/
-const QSet<QUmlVertex *>
-QUmlRegion::subvertex() const
+const QSet<QUmlVertex *> QUmlRegion::subvertex() const
{
// This is a read-write association end
@@ -236,8 +273,7 @@ void QUmlRegion::removeSubvertex(QUmlVertex *subvertex)
/*!
The set of transitions owned by the region.
*/
-const QSet<QUmlTransition *>
-QUmlRegion::transition() const
+const QSet<QUmlTransition *> QUmlRegion::transition() const
{
// This is a read-write association end
diff --git a/src/uml/qumlregion.h b/src/uml/qumlregion.h
index 324990dc..071cc609 100644
--- a/src/uml/qumlregion.h
+++ b/src/uml/qumlregion.h
@@ -65,6 +65,8 @@ public:
explicit QUmlRegion(bool createQObject = true);
virtual ~QUmlRegion();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlRegion *extendedRegion() const;
void setExtendedRegion(QUmlRegion *extendedRegion);
diff --git a/src/uml/qumlrelationship.cpp b/src/uml/qumlrelationship.cpp
index 55c19119..08833c44 100644
--- a/src/uml/qumlrelationship.cpp
+++ b/src/uml/qumlrelationship.cpp
@@ -40,6 +40,8 @@
****************************************************************************/
#include "qumlrelationship.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
/*!
\class QUmlRelationship
@@ -55,13 +57,20 @@ QUmlRelationship::~QUmlRelationship()
{
}
+QModelingObject *QUmlRelationship::clone() const
+{
+ QUmlRelationship *c = new QUmlRelationship;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies the elements related by the Relationship.
*/
-const QSet<QUmlElement *>
-QUmlRelationship::relatedElement() const
+const QSet<QUmlElement *> QUmlRelationship::relatedElement() const
{
// This is a read-only derived union association end
diff --git a/src/uml/qumlrelationship.h b/src/uml/qumlrelationship.h
index ec2f62f4..17a4ecb3 100644
--- a/src/uml/qumlrelationship.h
+++ b/src/uml/qumlrelationship.h
@@ -57,6 +57,8 @@ class Q_UML_EXPORT QUmlRelationship : public virtual QUmlElement
public:
virtual ~QUmlRelationship();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlElement *> relatedElement() const;
Q_DECL_HIDDEN void addRelatedElement(QUmlElement *relatedElement);
diff --git a/src/uml/qumlremovestructuralfeaturevalueaction.cpp b/src/uml/qumlremovestructuralfeaturevalueaction.cpp
index 8ac0b949..631c786e 100644
--- a/src/uml/qumlremovestructuralfeaturevalueaction.cpp
+++ b/src/uml/qumlremovestructuralfeaturevalueaction.cpp
@@ -42,8 +42,27 @@
#include "private/qumlremovestructuralfeaturevalueactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
-
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuralFeature>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlRemoveStructuralFeatureValueAction
@@ -67,13 +86,59 @@ QUmlRemoveStructuralFeatureValueAction::~QUmlRemoveStructuralFeatureValueAction(
}
}
+QModelingObject *QUmlRemoveStructuralFeatureValueAction::clone() const
+{
+ QUmlRemoveStructuralFeatureValueAction *c = new QUmlRemoveStructuralFeatureValueAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (object())
+ c->setObject(dynamic_cast<QUmlInputPin *>(object()->clone()));
+ if (structuralFeature())
+ c->setStructuralFeature(dynamic_cast<QUmlStructuralFeature *>(structuralFeature()->clone()));
+ if (result())
+ c->setResult(dynamic_cast<QUmlOutputPin *>(result()->clone()));
+ if (value())
+ c->setValue(dynamic_cast<QUmlInputPin *>(value()->clone()));
+ c->setRemoveDuplicates(isRemoveDuplicates());
+ if (removeAt())
+ c->setRemoveAt(dynamic_cast<QUmlInputPin *>(removeAt()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies whether to remove duplicates of the value in nonunique structural features.
*/
-bool
-QUmlRemoveStructuralFeatureValueAction::isRemoveDuplicates() const
+bool QUmlRemoveStructuralFeatureValueAction::isRemoveDuplicates() const
{
// This is a read-write property
@@ -92,8 +157,7 @@ void QUmlRemoveStructuralFeatureValueAction::setRemoveDuplicates(bool isRemoveDu
/*!
Specifies the position of an existing value to remove in ordered nonunique structural features. The type of the pin is UnlimitedNatural, but the value cannot be zero or unlimited.
*/
-QUmlInputPin *
-QUmlRemoveStructuralFeatureValueAction::removeAt() const
+QUmlInputPin *QUmlRemoveStructuralFeatureValueAction::removeAt() const
{
// This is a read-write association end
diff --git a/src/uml/qumlremovestructuralfeaturevalueaction.h b/src/uml/qumlremovestructuralfeaturevalueaction.h
index 02cc8995..60ad6cf8 100644
--- a/src/uml/qumlremovestructuralfeaturevalueaction.h
+++ b/src/uml/qumlremovestructuralfeaturevalueaction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlRemoveStructuralFeatureValueAction(bool createQObject = true);
virtual ~QUmlRemoveStructuralFeatureValueAction();
+ QModelingObject *clone() const;
+
// Owned attributes
bool isRemoveDuplicates() const;
void setRemoveDuplicates(bool isRemoveDuplicates);
diff --git a/src/uml/qumlremovevariablevalueaction.cpp b/src/uml/qumlremovevariablevalueaction.cpp
index 9d50ddb3..ed980d10 100644
--- a/src/uml/qumlremovevariablevalueaction.cpp
+++ b/src/uml/qumlremovevariablevalueaction.cpp
@@ -42,8 +42,27 @@
#include "private/qumlremovevariablevalueactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
-
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlVariable>
/*!
\class QUmlRemoveVariableValueAction
@@ -67,13 +86,55 @@ QUmlRemoveVariableValueAction::~QUmlRemoveVariableValueAction()
}
}
+QModelingObject *QUmlRemoveVariableValueAction::clone() const
+{
+ QUmlRemoveVariableValueAction *c = new QUmlRemoveVariableValueAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (variable())
+ c->setVariable(dynamic_cast<QUmlVariable *>(variable()->clone()));
+ if (value())
+ c->setValue(dynamic_cast<QUmlInputPin *>(value()->clone()));
+ c->setRemoveDuplicates(isRemoveDuplicates());
+ if (removeAt())
+ c->setRemoveAt(dynamic_cast<QUmlInputPin *>(removeAt()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies whether to remove duplicates of the value in nonunique variables.
*/
-bool
-QUmlRemoveVariableValueAction::isRemoveDuplicates() const
+bool QUmlRemoveVariableValueAction::isRemoveDuplicates() const
{
// This is a read-write property
@@ -92,8 +153,7 @@ void QUmlRemoveVariableValueAction::setRemoveDuplicates(bool isRemoveDuplicates)
/*!
Specifies the position of an existing value to remove in ordered nonunique variables. The type of the pin is UnlimitedNatural, but the value cannot be zero or unlimited.
*/
-QUmlInputPin *
-QUmlRemoveVariableValueAction::removeAt() const
+QUmlInputPin *QUmlRemoveVariableValueAction::removeAt() const
{
// This is a read-write association end
diff --git a/src/uml/qumlremovevariablevalueaction.h b/src/uml/qumlremovevariablevalueaction.h
index 47cfe439..9586e0ad 100644
--- a/src/uml/qumlremovevariablevalueaction.h
+++ b/src/uml/qumlremovevariablevalueaction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlRemoveVariableValueAction(bool createQObject = true);
virtual ~QUmlRemoveVariableValueAction();
+ QModelingObject *clone() const;
+
// Owned attributes
bool isRemoveDuplicates() const;
void setRemoveDuplicates(bool isRemoveDuplicates);
diff --git a/src/uml/qumlreplyaction.cpp b/src/uml/qumlreplyaction.cpp
index baf78658..83d9aa3e 100644
--- a/src/uml/qumlreplyaction.cpp
+++ b/src/uml/qumlreplyaction.cpp
@@ -42,9 +42,27 @@
#include "private/qumlreplyactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
#include <QtUml/QUmlTrigger>
-
/*!
\class QUmlReplyAction
@@ -68,13 +86,54 @@ QUmlReplyAction::~QUmlReplyAction()
}
}
+QModelingObject *QUmlReplyAction::clone() const
+{
+ QUmlReplyAction *c = new QUmlReplyAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (replyToCall())
+ c->setReplyToCall(dynamic_cast<QUmlTrigger *>(replyToCall()->clone()));
+ foreach (QUmlInputPin *element, replyValue())
+ c->addReplyValue(dynamic_cast<QUmlInputPin *>(element->clone()));
+ if (returnInformation())
+ c->setReturnInformation(dynamic_cast<QUmlInputPin *>(returnInformation()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The trigger specifying the operation whose call is being replied to.
*/
-QUmlTrigger *
-QUmlReplyAction::replyToCall() const
+QUmlTrigger *QUmlReplyAction::replyToCall() const
{
// This is a read-write association end
@@ -95,8 +154,7 @@ void QUmlReplyAction::setReplyToCall(QUmlTrigger *replyToCall)
/*!
A list of pins containing the reply values of the operation. These values are returned to the caller.
*/
-const QSet<QUmlInputPin *>
-QUmlReplyAction::replyValue() const
+const QSet<QUmlInputPin *> QUmlReplyAction::replyValue() const
{
// This is a read-write association end
@@ -135,8 +193,7 @@ void QUmlReplyAction::removeReplyValue(QUmlInputPin *replyValue)
/*!
A pin containing the return information value produced by an earlier AcceptCallAction.
*/
-QUmlInputPin *
-QUmlReplyAction::returnInformation() const
+QUmlInputPin *QUmlReplyAction::returnInformation() const
{
// This is a read-write association end
diff --git a/src/uml/qumlreplyaction.h b/src/uml/qumlreplyaction.h
index 5f730eef..98b233d6 100644
--- a/src/uml/qumlreplyaction.h
+++ b/src/uml/qumlreplyaction.h
@@ -61,6 +61,8 @@ public:
explicit QUmlReplyAction(bool createQObject = true);
virtual ~QUmlReplyAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlTrigger *replyToCall() const;
void setReplyToCall(QUmlTrigger *replyToCall);
diff --git a/src/uml/qumlsendobjectaction.cpp b/src/uml/qumlsendobjectaction.cpp
index dd1857f8..e0bf9fe1 100644
--- a/src/uml/qumlsendobjectaction.cpp
+++ b/src/uml/qumlsendobjectaction.cpp
@@ -42,8 +42,27 @@
#include "private/qumlsendobjectactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
-
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlSendObjectAction
@@ -67,13 +86,54 @@ QUmlSendObjectAction::~QUmlSendObjectAction()
}
}
+QModelingObject *QUmlSendObjectAction::clone() const
+{
+ QUmlSendObjectAction *c = new QUmlSendObjectAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (onPort())
+ c->setOnPort(dynamic_cast<QUmlPort *>(onPort()->clone()));
+ if (request())
+ c->setRequest(dynamic_cast<QUmlInputPin *>(request()->clone()));
+ if (target())
+ c->setTarget(dynamic_cast<QUmlInputPin *>(target()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The request object, which is transmitted to the target object. The object may be copied in transmission, so identity might not be preserved.
*/
-QUmlInputPin *
-QUmlSendObjectAction::request() const
+QUmlInputPin *QUmlSendObjectAction::request() const
{
// This is a read-write association end
@@ -95,8 +155,7 @@ void QUmlSendObjectAction::setRequest(QUmlInputPin *request)
/*!
The target object to which the object is sent.
*/
-QUmlInputPin *
-QUmlSendObjectAction::target() const
+QUmlInputPin *QUmlSendObjectAction::target() const
{
// This is a read-write association end
diff --git a/src/uml/qumlsendobjectaction.h b/src/uml/qumlsendobjectaction.h
index f958bfea..f30a27d6 100644
--- a/src/uml/qumlsendobjectaction.h
+++ b/src/uml/qumlsendobjectaction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlSendObjectAction(bool createQObject = true);
virtual ~QUmlSendObjectAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlInputPin *request() const;
void setRequest(QUmlInputPin *request);
diff --git a/src/uml/qumlsendsignalaction.cpp b/src/uml/qumlsendsignalaction.cpp
index 62717345..242c048c 100644
--- a/src/uml/qumlsendsignalaction.cpp
+++ b/src/uml/qumlsendsignalaction.cpp
@@ -42,9 +42,28 @@
#include "private/qumlsendsignalactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlRedefinableElement>
#include <QtUml/QUmlSignal>
-
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlSendSignalAction
@@ -68,13 +87,56 @@ QUmlSendSignalAction::~QUmlSendSignalAction()
}
}
+QModelingObject *QUmlSendSignalAction::clone() const
+{
+ QUmlSendSignalAction *c = new QUmlSendSignalAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlInputPin *element, argument())
+ c->addArgument(dynamic_cast<QUmlInputPin *>(element->clone()));
+ if (onPort())
+ c->setOnPort(dynamic_cast<QUmlPort *>(onPort()->clone()));
+ if (signal())
+ c->setSignal(dynamic_cast<QUmlSignal *>(signal()->clone()));
+ if (target())
+ c->setTarget(dynamic_cast<QUmlInputPin *>(target()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The type of signal transmitted to the target object.
*/
-QUmlSignal *
-QUmlSendSignalAction::signal() const
+QUmlSignal *QUmlSendSignalAction::signal() const
{
// This is a read-write association end
@@ -95,8 +157,7 @@ void QUmlSendSignalAction::setSignal(QUmlSignal *signal)
/*!
The target object to which the signal is sent.
*/
-QUmlInputPin *
-QUmlSendSignalAction::target() const
+QUmlInputPin *QUmlSendSignalAction::target() const
{
// This is a read-write association end
diff --git a/src/uml/qumlsendsignalaction.h b/src/uml/qumlsendsignalaction.h
index de0cb594..7692a78c 100644
--- a/src/uml/qumlsendsignalaction.h
+++ b/src/uml/qumlsendsignalaction.h
@@ -61,6 +61,8 @@ public:
explicit QUmlSendSignalAction(bool createQObject = true);
virtual ~QUmlSendSignalAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlSignal *signal() const;
void setSignal(QUmlSignal *signal);
diff --git a/src/uml/qumlsequencenode.cpp b/src/uml/qumlsequencenode.cpp
index 6db083b1..618ab7c2 100644
--- a/src/uml/qumlsequencenode.cpp
+++ b/src/uml/qumlsequencenode.cpp
@@ -42,8 +42,31 @@
#include "private/qumlsequencenodeobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlExecutableNode>
-
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlVariable>
/*!
\class QUmlSequenceNode
@@ -66,13 +89,65 @@ QUmlSequenceNode::~QUmlSequenceNode()
}
}
+QModelingObject *QUmlSequenceNode::clone() const
+{
+ QUmlSequenceNode *c = new QUmlSequenceNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlActivityEdge *element, edge())
+ c->addEdge(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ c->setMustIsolate(mustIsolate());
+ foreach (QUmlInputPin *element, structuredNodeInput())
+ c->addStructuredNodeInput(dynamic_cast<QUmlInputPin *>(element->clone()));
+ foreach (QUmlOutputPin *element, structuredNodeOutput())
+ c->addStructuredNodeOutput(dynamic_cast<QUmlOutputPin *>(element->clone()));
+ foreach (QUmlVariable *element, variable())
+ c->addVariable(dynamic_cast<QUmlVariable *>(element->clone()));
+ foreach (QUmlExecutableNode *element, executableNode())
+ c->addExecutableNode(dynamic_cast<QUmlExecutableNode *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
An ordered set of executable nodes.
*/
-const QList<QUmlExecutableNode *>
-QUmlSequenceNode::executableNode() const
+const QList<QUmlExecutableNode *> QUmlSequenceNode::executableNode() const
{
// This is a read-write association end
diff --git a/src/uml/qumlsequencenode.h b/src/uml/qumlsequencenode.h
index 0381e539..da8f12cb 100644
--- a/src/uml/qumlsequencenode.h
+++ b/src/uml/qumlsequencenode.h
@@ -60,6 +60,8 @@ public:
explicit QUmlSequenceNode(bool createQObject = true);
virtual ~QUmlSequenceNode();
+ QModelingObject *clone() const;
+
// Owned attributes
const QList<QUmlExecutableNode *> executableNode() const;
void addExecutableNode(QUmlExecutableNode *executableNode);
diff --git a/src/uml/qumlsignal.cpp b/src/uml/qumlsignal.cpp
index 359bd462..4ef6a05f 100644
--- a/src/uml/qumlsignal.cpp
+++ b/src/uml/qumlsignal.cpp
@@ -42,8 +42,33 @@
#include "private/qumlsignalobject_p.h"
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlProperty>
-
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlSignal
@@ -65,13 +90,63 @@ QUmlSignal::~QUmlSignal()
}
}
+QModelingObject *QUmlSignal::clone() const
+{
+ QUmlSignal *c = new QUmlSignal;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The attributes owned by the signal.
*/
-const QList<QUmlProperty *>
-QUmlSignal::ownedAttribute() const
+const QList<QUmlProperty *> QUmlSignal::ownedAttribute() const
{
// This is a read-write association end
diff --git a/src/uml/qumlsignal.h b/src/uml/qumlsignal.h
index 48ee5e4f..5f167dcf 100644
--- a/src/uml/qumlsignal.h
+++ b/src/uml/qumlsignal.h
@@ -60,6 +60,8 @@ public:
explicit QUmlSignal(bool createQObject = true);
virtual ~QUmlSignal();
+ QModelingObject *clone() const;
+
// Owned attributes
const QList<QUmlProperty *> ownedAttribute() const;
void addOwnedAttribute(QUmlProperty *ownedAttribute);
diff --git a/src/uml/qumlsignalevent.cpp b/src/uml/qumlsignalevent.cpp
index 99e8063b..77947fb6 100644
--- a/src/uml/qumlsignalevent.cpp
+++ b/src/uml/qumlsignalevent.cpp
@@ -42,8 +42,16 @@
#include "private/qumlsignaleventobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlSignal>
-
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlSignalEvent
@@ -66,13 +74,32 @@ QUmlSignalEvent::~QUmlSignalEvent()
}
}
+QModelingObject *QUmlSignalEvent::clone() const
+{
+ QUmlSignalEvent *c = new QUmlSignalEvent;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (signal())
+ c->setSignal(dynamic_cast<QUmlSignal *>(signal()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The specific signal that is associated with this event.
*/
-QUmlSignal *
-QUmlSignalEvent::signal() const
+QUmlSignal *QUmlSignalEvent::signal() const
{
// This is a read-write association end
diff --git a/src/uml/qumlsignalevent.h b/src/uml/qumlsignalevent.h
index 8de77b3c..4c3bb5e1 100644
--- a/src/uml/qumlsignalevent.h
+++ b/src/uml/qumlsignalevent.h
@@ -60,6 +60,8 @@ public:
explicit QUmlSignalEvent(bool createQObject = true);
virtual ~QUmlSignalEvent();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlSignal *signal() const;
void setSignal(QUmlSignal *signal);
diff --git a/src/uml/qumlslot.cpp b/src/uml/qumlslot.cpp
index 16fd9111..62c08dc0 100644
--- a/src/uml/qumlslot.cpp
+++ b/src/uml/qumlslot.cpp
@@ -42,10 +42,11 @@
#include "private/qumlslotobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlInstanceSpecification>
#include <QtUml/QUmlStructuralFeature>
#include <QtUml/QUmlValueSpecification>
-
/*!
\class QUmlSlot
@@ -69,13 +70,26 @@ QUmlSlot::~QUmlSlot()
}
}
+QModelingObject *QUmlSlot::clone() const
+{
+ QUmlSlot *c = new QUmlSlot;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (definingFeature())
+ c->setDefiningFeature(dynamic_cast<QUmlStructuralFeature *>(definingFeature()->clone()));
+ if (owningInstance())
+ c->setOwningInstance(dynamic_cast<QUmlInstanceSpecification *>(owningInstance()->clone()));
+ foreach (QUmlValueSpecification *element, value())
+ c->addValue(dynamic_cast<QUmlValueSpecification *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The structural feature that specifies the values that may be held by the slot.
*/
-QUmlStructuralFeature *
-QUmlSlot::definingFeature() const
+QUmlStructuralFeature *QUmlSlot::definingFeature() const
{
// This is a read-write association end
@@ -96,8 +110,7 @@ void QUmlSlot::setDefiningFeature(QUmlStructuralFeature *definingFeature)
/*!
The instance specification that owns this slot.
*/
-QUmlInstanceSpecification *
-QUmlSlot::owningInstance() const
+QUmlInstanceSpecification *QUmlSlot::owningInstance() const
{
// This is a read-write association end
@@ -123,8 +136,7 @@ void QUmlSlot::setOwningInstance(QUmlInstanceSpecification *owningInstance)
/*!
The value or values corresponding to the defining feature for the owning instance specification.
*/
-const QList<QUmlValueSpecification *>
-QUmlSlot::value() const
+const QList<QUmlValueSpecification *> QUmlSlot::value() const
{
// This is a read-write association end
diff --git a/src/uml/qumlslot.h b/src/uml/qumlslot.h
index 450510f0..5dab6aa7 100644
--- a/src/uml/qumlslot.h
+++ b/src/uml/qumlslot.h
@@ -62,6 +62,8 @@ public:
explicit QUmlSlot(bool createQObject = true);
virtual ~QUmlSlot();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlStructuralFeature *definingFeature() const;
void setDefiningFeature(QUmlStructuralFeature *definingFeature);
diff --git a/src/uml/qumlstartclassifierbehavioraction.cpp b/src/uml/qumlstartclassifierbehavioraction.cpp
index 233c3522..c68fed5e 100644
--- a/src/uml/qumlstartclassifierbehavioraction.cpp
+++ b/src/uml/qumlstartclassifierbehavioraction.cpp
@@ -42,8 +42,26 @@
#include "private/qumlstartclassifierbehavioractionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
-
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlStartClassifierBehaviorAction
@@ -66,13 +84,50 @@ QUmlStartClassifierBehaviorAction::~QUmlStartClassifierBehaviorAction()
}
}
+QModelingObject *QUmlStartClassifierBehaviorAction::clone() const
+{
+ QUmlStartClassifierBehaviorAction *c = new QUmlStartClassifierBehaviorAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (object())
+ c->setObject(dynamic_cast<QUmlInputPin *>(object()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Holds the object on which to start the owned behavior.
*/
-QUmlInputPin *
-QUmlStartClassifierBehaviorAction::object() const
+QUmlInputPin *QUmlStartClassifierBehaviorAction::object() const
{
// This is a read-write association end
diff --git a/src/uml/qumlstartclassifierbehavioraction.h b/src/uml/qumlstartclassifierbehavioraction.h
index 57590e32..7493d8a6 100644
--- a/src/uml/qumlstartclassifierbehavioraction.h
+++ b/src/uml/qumlstartclassifierbehavioraction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlStartClassifierBehaviorAction(bool createQObject = true);
virtual ~QUmlStartClassifierBehaviorAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlInputPin *object() const;
void setObject(QUmlInputPin *object);
diff --git a/src/uml/qumlstartobjectbehavioraction.cpp b/src/uml/qumlstartobjectbehavioraction.cpp
index 8d5fac3b..b17aabf5 100644
--- a/src/uml/qumlstartobjectbehavioraction.cpp
+++ b/src/uml/qumlstartobjectbehavioraction.cpp
@@ -42,8 +42,27 @@
#include "private/qumlstartobjectbehavioractionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
-
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlStartObjectBehaviorAction
@@ -66,13 +85,57 @@ QUmlStartObjectBehaviorAction::~QUmlStartObjectBehaviorAction()
}
}
+QModelingObject *QUmlStartObjectBehaviorAction::clone() const
+{
+ QUmlStartObjectBehaviorAction *c = new QUmlStartObjectBehaviorAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlInputPin *element, argument())
+ c->addArgument(dynamic_cast<QUmlInputPin *>(element->clone()));
+ if (onPort())
+ c->setOnPort(dynamic_cast<QUmlPort *>(onPort()->clone()));
+ c->setSynchronous(isSynchronous());
+ foreach (QUmlOutputPin *element, result())
+ c->addResult(dynamic_cast<QUmlOutputPin *>(element->clone()));
+ if (object())
+ c->setObject(dynamic_cast<QUmlInputPin *>(object()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Holds the object which is either a behavior to be started or has a classifier behavior to be started.
*/
-QUmlInputPin *
-QUmlStartObjectBehaviorAction::object() const
+QUmlInputPin *QUmlStartObjectBehaviorAction::object() const
{
// This is a read-write association end
diff --git a/src/uml/qumlstartobjectbehavioraction.h b/src/uml/qumlstartobjectbehavioraction.h
index 766fdac3..24f67bea 100644
--- a/src/uml/qumlstartobjectbehavioraction.h
+++ b/src/uml/qumlstartobjectbehavioraction.h
@@ -60,6 +60,8 @@ public:
explicit QUmlStartObjectBehaviorAction(bool createQObject = true);
virtual ~QUmlStartObjectBehaviorAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlInputPin *object() const;
void setObject(QUmlInputPin *object);
diff --git a/src/uml/qumlstate.cpp b/src/uml/qumlstate.cpp
index 43991fc0..503ae7fa 100644
--- a/src/uml/qumlstate.cpp
+++ b/src/uml/qumlstate.cpp
@@ -44,13 +44,24 @@
#include <QtUml/QUmlBehavior>
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConnectionPointReference>
#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
#include <QtUml/QUmlPseudostate>
+#include <QtUml/QUmlRedefinableElement>
#include <QtUml/QUmlRegion>
#include <QtUml/QUmlStateMachine>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTransition>
#include <QtUml/QUmlTrigger>
-
/*!
\class QUmlState
@@ -78,13 +89,55 @@ QUmlState::~QUmlState()
}
}
+QModelingObject *QUmlState::clone() const
+{
+ QUmlState *c = new QUmlState;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ c->setLeaf(isLeaf());
+ if (container())
+ c->setContainer(dynamic_cast<QUmlRegion *>(container()->clone()));
+ foreach (QUmlConnectionPointReference *element, connection())
+ c->addConnection(dynamic_cast<QUmlConnectionPointReference *>(element->clone()));
+ foreach (QUmlPseudostate *element, connectionPoint())
+ c->addConnectionPoint(dynamic_cast<QUmlPseudostate *>(element->clone()));
+ foreach (QUmlTrigger *element, deferrableTrigger())
+ c->addDeferrableTrigger(dynamic_cast<QUmlTrigger *>(element->clone()));
+ if (doActivity())
+ c->setDoActivity(dynamic_cast<QUmlBehavior *>(doActivity()->clone()));
+ if (entry())
+ c->setEntry(dynamic_cast<QUmlBehavior *>(entry()->clone()));
+ if (exit())
+ c->setExit(dynamic_cast<QUmlBehavior *>(exit()->clone()));
+ if (redefinedState())
+ c->setRedefinedState(dynamic_cast<QUmlState *>(redefinedState()->clone()));
+ foreach (QUmlRegion *element, region())
+ c->addRegion(dynamic_cast<QUmlRegion *>(element->clone()));
+ if (stateInvariant())
+ c->setStateInvariant(dynamic_cast<QUmlConstraint *>(stateInvariant()->clone()));
+ if (submachine())
+ c->setSubmachine(dynamic_cast<QUmlStateMachine *>(submachine()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The entry and exit connection points used in conjunction with this (submachine) state, i.e. as targets and sources, respectively, in the region with the submachine state. A connection point reference references the corresponding definition of a connection point pseudostate in the statemachine referenced by the submachinestate.
*/
-const QSet<QUmlConnectionPointReference *>
-QUmlState::connection() const
+const QSet<QUmlConnectionPointReference *> QUmlState::connection() const
{
// This is a read-write association end
@@ -133,8 +186,7 @@ void QUmlState::removeConnection(QUmlConnectionPointReference *connection)
/*!
The entry and exit pseudostates of a composite state. These can only be entry or exit Pseudostates, and they must have different names. They can only be defined for composite states.
*/
-const QSet<QUmlPseudostate *>
-QUmlState::connectionPoint() const
+const QSet<QUmlPseudostate *> QUmlState::connectionPoint() const
{
// This is a read-write association end
@@ -183,8 +235,7 @@ void QUmlState::removeConnectionPoint(QUmlPseudostate *connectionPoint)
/*!
A list of triggers that are candidates to be retained by the state machine if they trigger no transitions out of the state (not consumed). A deferred trigger is retained until the state machine reaches a state configuration where it is no longer deferred.
*/
-const QSet<QUmlTrigger *>
-QUmlState::deferrableTrigger() const
+const QSet<QUmlTrigger *> QUmlState::deferrableTrigger() const
{
// This is a read-write association end
@@ -223,8 +274,7 @@ void QUmlState::removeDeferrableTrigger(QUmlTrigger *deferrableTrigger)
/*!
An optional behavior that is executed while being in the state. The execution starts when this state is entered, and stops either by itself, or when the state is exited, whichever comes first.
*/
-QUmlBehavior *
-QUmlState::doActivity() const
+QUmlBehavior *QUmlState::doActivity() const
{
// This is a read-write association end
@@ -254,8 +304,7 @@ void QUmlState::setDoActivity(QUmlBehavior *doActivity)
/*!
An optional behavior that is executed whenever this state is entered regardless of the transition taken to reach the state. If defined, entry actions are always executed to completion prior to any internal behavior or transitions performed within the state.
*/
-QUmlBehavior *
-QUmlState::entry() const
+QUmlBehavior *QUmlState::entry() const
{
// This is a read-write association end
@@ -285,8 +334,7 @@ void QUmlState::setEntry(QUmlBehavior *entry)
/*!
An optional behavior that is executed whenever this state is exited regardless of which transition was taken out of the state. If defined, exit actions are always executed to completion only after all internal activities and transition actions have completed execution.
*/
-QUmlBehavior *
-QUmlState::exit() const
+QUmlBehavior *QUmlState::exit() const
{
// This is a read-write association end
@@ -316,8 +364,7 @@ void QUmlState::setExit(QUmlBehavior *exit)
/*!
A state with isComposite=true is said to be a composite state. A composite state is a state that contains at least one region.
*/
-bool
-QUmlState::isComposite() const
+bool QUmlState::isComposite() const
{
// This is a read-only derived property
@@ -341,8 +388,7 @@ void QUmlState::setComposite(bool isComposite)
/*!
A state with isOrthogonal=true is said to be an orthogonal composite state. An orthogonal composite state contains two or more regions.
*/
-bool
-QUmlState::isOrthogonal() const
+bool QUmlState::isOrthogonal() const
{
// This is a read-only derived property
@@ -366,8 +412,7 @@ void QUmlState::setOrthogonal(bool isOrthogonal)
/*!
A state with isSimple=true is said to be a simple state. A simple state does not have any regions and it does not refer to any submachine state machine.
*/
-bool
-QUmlState::isSimple() const
+bool QUmlState::isSimple() const
{
// This is a read-only derived property
@@ -391,8 +436,7 @@ void QUmlState::setSimple(bool isSimple)
/*!
A state with isSubmachineState=true is said to be a submachine state. Such a state refers to a state machine (submachine).
*/
-bool
-QUmlState::isSubmachineState() const
+bool QUmlState::isSubmachineState() const
{
// This is a read-only derived property
@@ -416,8 +460,7 @@ void QUmlState::setSubmachineState(bool isSubmachineState)
/*!
The state of which this state is a redefinition.
*/
-QUmlState *
-QUmlState::redefinedState() const
+QUmlState *QUmlState::redefinedState() const
{
// This is a read-write association end
@@ -446,8 +489,7 @@ void QUmlState::setRedefinedState(QUmlState *redefinedState)
/*!
References the classifier in which context this element may be redefined.
*/
-QUmlClassifier *
-QUmlState::redefinitionContext() const
+QUmlClassifier *QUmlState::redefinitionContext() const
{
// This is a read-only derived association end
@@ -471,8 +513,7 @@ void QUmlState::setRedefinitionContext(QUmlClassifier *redefinitionContext)
/*!
The regions owned directly by the state.
*/
-const QSet<QUmlRegion *>
-QUmlState::region() const
+const QSet<QUmlRegion *> QUmlState::region() const
{
// This is a read-write association end
@@ -521,8 +562,7 @@ void QUmlState::removeRegion(QUmlRegion *region)
/*!
Specifies conditions that are always true when this state is the current state. In protocol state machines, state invariants are additional conditions to the preconditions of the outgoing transitions, and to the postcondition of the incoming transitions.
*/
-QUmlConstraint *
-QUmlState::stateInvariant() const
+QUmlConstraint *QUmlState::stateInvariant() const
{
// This is a read-write association end
@@ -552,8 +592,7 @@ void QUmlState::setStateInvariant(QUmlConstraint *stateInvariant)
/*!
The state machine that is to be inserted in place of the (submachine) state.
*/
-QUmlStateMachine *
-QUmlState::submachine() const
+QUmlStateMachine *QUmlState::submachine() const
{
// This is a read-write association end
diff --git a/src/uml/qumlstate.h b/src/uml/qumlstate.h
index a63313ad..0ebd9042 100644
--- a/src/uml/qumlstate.h
+++ b/src/uml/qumlstate.h
@@ -69,6 +69,8 @@ public:
explicit QUmlState(bool createQObject = true);
virtual ~QUmlState();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlConnectionPointReference *> connection() const;
void addConnection(QUmlConnectionPointReference *connection);
diff --git a/src/uml/qumlstateinvariant.cpp b/src/uml/qumlstateinvariant.cpp
index 688ef6cc..a5dfeeaf 100644
--- a/src/uml/qumlstateinvariant.cpp
+++ b/src/uml/qumlstateinvariant.cpp
@@ -42,9 +42,18 @@
#include "private/qumlstateinvariantobject_p.h"
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlGeneralOrdering>
+#include <QtUml/QUmlInteraction>
+#include <QtUml/QUmlInteractionOperand>
#include <QtUml/QUmlLifeline>
-
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlStateInvariant
@@ -68,13 +77,36 @@ QUmlStateInvariant::~QUmlStateInvariant()
}
}
+QModelingObject *QUmlStateInvariant::clone() const
+{
+ QUmlStateInvariant *c = new QUmlStateInvariant;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (enclosingInteraction())
+ c->setEnclosingInteraction(dynamic_cast<QUmlInteraction *>(enclosingInteraction()->clone()));
+ if (enclosingOperand())
+ c->setEnclosingOperand(dynamic_cast<QUmlInteractionOperand *>(enclosingOperand()->clone()));
+ foreach (QUmlGeneralOrdering *element, generalOrdering())
+ c->addGeneralOrdering(dynamic_cast<QUmlGeneralOrdering *>(element->clone()));
+ if (covered())
+ c->setCovered(dynamic_cast<QUmlLifeline *>(covered()->clone()));
+ if (invariant())
+ c->setInvariant(dynamic_cast<QUmlConstraint *>(invariant()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the Lifeline on which the StateInvariant appears.
*/
-QUmlLifeline *
-QUmlStateInvariant::covered() const
+QUmlLifeline *QUmlStateInvariant::covered() const
{
// This is a read-write association end
@@ -95,8 +127,7 @@ void QUmlStateInvariant::setCovered(QUmlLifeline *covered)
/*!
A Constraint that should hold at runtime for this StateInvariant
*/
-QUmlConstraint *
-QUmlStateInvariant::invariant() const
+QUmlConstraint *QUmlStateInvariant::invariant() const
{
// This is a read-write association end
diff --git a/src/uml/qumlstateinvariant.h b/src/uml/qumlstateinvariant.h
index 8e6e0989..0c95850a 100644
--- a/src/uml/qumlstateinvariant.h
+++ b/src/uml/qumlstateinvariant.h
@@ -61,6 +61,8 @@ public:
explicit QUmlStateInvariant(bool createQObject = true);
virtual ~QUmlStateInvariant();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlLifeline *covered() const;
void setCovered(QUmlLifeline *covered);
diff --git a/src/uml/qumlstatemachine.cpp b/src/uml/qumlstatemachine.cpp
index 4ffac829..0b80b279 100644
--- a/src/uml/qumlstatemachine.cpp
+++ b/src/uml/qumlstatemachine.cpp
@@ -42,12 +42,49 @@
#include "private/qumlstatemachineobject_p.h"
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlBehavioralFeature>
+#include <QtUml/QUmlBehavioredClassifier>
+#include <QtUml/QUmlClass>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElement>
+#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExtension>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlInterfaceRealization>
+#include <QtUml/QUmlNamedElement>
#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameter>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlParameterSet>
+#include <QtUml/QUmlPort>
+#include <QtUml/QUmlProperty>
#include <QtUml/QUmlPseudostate>
+#include <QtUml/QUmlReception>
#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
#include <QtUml/QUmlRegion>
#include <QtUml/QUmlState>
-
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlStateMachine
@@ -69,13 +106,97 @@ QUmlStateMachine::~QUmlStateMachine()
}
}
+QModelingObject *QUmlStateMachine::clone() const
+{
+ QUmlStateMachine *c = new QUmlStateMachine;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlConnector *element, ownedConnector())
+ c->addOwnedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setActive(isActive());
+ foreach (QUmlClassifier *element, nestedClassifier())
+ c->addNestedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ foreach (QUmlReception *element, ownedReception())
+ c->addOwnedReception(dynamic_cast<QUmlReception *>(element->clone()));
+ c->setReentrant(isReentrant());
+ foreach (QUmlParameter *element, ownedParameter())
+ c->addOwnedParameter(dynamic_cast<QUmlParameter *>(element->clone()));
+ foreach (QUmlParameterSet *element, ownedParameterSet())
+ c->addOwnedParameterSet(dynamic_cast<QUmlParameterSet *>(element->clone()));
+ foreach (QUmlConstraint *element, postcondition())
+ c->addPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, precondition())
+ c->addPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (specification())
+ c->setSpecification(dynamic_cast<QUmlBehavioralFeature *>(specification()->clone()));
+ foreach (QUmlPseudostate *element, connectionPoint())
+ c->addConnectionPoint(dynamic_cast<QUmlPseudostate *>(element->clone()));
+ foreach (QUmlStateMachine *element, extendedStateMachine())
+ c->addExtendedStateMachine(dynamic_cast<QUmlStateMachine *>(element->clone()));
+ foreach (QUmlRegion *element, region())
+ c->addRegion(dynamic_cast<QUmlRegion *>(element->clone()));
+ foreach (QUmlState *element, submachineState())
+ c->addSubmachineState(dynamic_cast<QUmlState *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The connection points defined for this state machine. They represent the interface of the state machine when used as part of submachine state.
*/
-const QSet<QUmlPseudostate *>
-QUmlStateMachine::connectionPoint() const
+const QSet<QUmlPseudostate *> QUmlStateMachine::connectionPoint() const
{
// This is a read-write association end
@@ -124,8 +245,7 @@ void QUmlStateMachine::removeConnectionPoint(QUmlPseudostate *connectionPoint)
/*!
The state machines of which this is an extension.
*/
-const QSet<QUmlStateMachine *>
-QUmlStateMachine::extendedStateMachine() const
+const QSet<QUmlStateMachine *> QUmlStateMachine::extendedStateMachine() const
{
// This is a read-write association end
@@ -155,8 +275,7 @@ void QUmlStateMachine::removeExtendedStateMachine(QUmlStateMachine *extendedStat
/*!
The regions owned directly by the state machine.
*/
-const QSet<QUmlRegion *>
-QUmlStateMachine::region() const
+const QSet<QUmlRegion *> QUmlStateMachine::region() const
{
// This is a read-write association end
@@ -205,8 +324,7 @@ void QUmlStateMachine::removeRegion(QUmlRegion *region)
/*!
References the submachine(s) in case of a submachine state. Multiple machines are referenced in case of a concurrent state.
*/
-const QSet<QUmlState *>
-QUmlStateMachine::submachineState() const
+const QSet<QUmlState *> QUmlStateMachine::submachineState() const
{
// This is a read-write association end
diff --git a/src/uml/qumlstatemachine.h b/src/uml/qumlstatemachine.h
index 0f71c544..37cf5870 100644
--- a/src/uml/qumlstatemachine.h
+++ b/src/uml/qumlstatemachine.h
@@ -64,6 +64,8 @@ public:
explicit QUmlStateMachine(bool createQObject = true);
virtual ~QUmlStateMachine();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlPseudostate *> connectionPoint() const;
void addConnectionPoint(QUmlPseudostate *connectionPoint);
diff --git a/src/uml/qumlstereotype.cpp b/src/uml/qumlstereotype.cpp
index d69d38d7..adf1795a 100644
--- a/src/uml/qumlstereotype.cpp
+++ b/src/uml/qumlstereotype.cpp
@@ -42,9 +42,44 @@
#include "private/qumlstereotypeobject_p.h"
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClass>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElement>
+#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExtension>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
#include <QtUml/QUmlImage>
+#include <QtUml/QUmlInterfaceRealization>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOperation>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlPort>
#include <QtUml/QUmlProfile>
-
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlReception>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlStereotype
@@ -67,13 +102,80 @@ QUmlStereotype::~QUmlStereotype()
}
}
+QModelingObject *QUmlStereotype::clone() const
+{
+ QUmlStereotype *c = new QUmlStereotype;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlConnector *element, ownedConnector())
+ c->addOwnedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setActive(isActive());
+ foreach (QUmlClassifier *element, nestedClassifier())
+ c->addNestedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlOperation *element, ownedOperation())
+ c->addOwnedOperation(dynamic_cast<QUmlOperation *>(element->clone()));
+ foreach (QUmlReception *element, ownedReception())
+ c->addOwnedReception(dynamic_cast<QUmlReception *>(element->clone()));
+ foreach (QUmlImage *element, icon())
+ c->addIcon(dynamic_cast<QUmlImage *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Stereotype can change the graphical appearance of the extended model element by using attached icons. When this association is not null, it references the location of the icon content to be displayed within diagrams presenting the extended model elements.
*/
-const QSet<QUmlImage *>
-QUmlStereotype::icon() const
+const QSet<QUmlImage *> QUmlStereotype::icon() const
{
// This is a read-write association end
@@ -112,8 +214,7 @@ void QUmlStereotype::removeIcon(QUmlImage *icon)
/*!
The profile that directly or indirectly contains this stereotype.
*/
-QUmlProfile *
-QUmlStereotype::profile() const
+QUmlProfile *QUmlStereotype::profile() const
{
// This is a read-only derived association end
diff --git a/src/uml/qumlstereotype.h b/src/uml/qumlstereotype.h
index 9fac9d96..fc364cb6 100644
--- a/src/uml/qumlstereotype.h
+++ b/src/uml/qumlstereotype.h
@@ -61,6 +61,8 @@ public:
explicit QUmlStereotype(bool createQObject = true);
virtual ~QUmlStereotype();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlImage *> icon() const;
void addIcon(QUmlImage *icon);
diff --git a/src/uml/qumlstringexpression.cpp b/src/uml/qumlstringexpression.cpp
index 8805e75d..7141e3d9 100644
--- a/src/uml/qumlstringexpression.cpp
+++ b/src/uml/qumlstringexpression.cpp
@@ -42,6 +42,18 @@
#include "private/qumlstringexpressionobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlStringExpression
@@ -65,13 +77,43 @@ QUmlStringExpression::~QUmlStringExpression()
}
}
+QModelingObject *QUmlStringExpression::clone() const
+{
+ QUmlStringExpression *c = new QUmlStringExpression;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlValueSpecification *element, operand())
+ c->addOperand(dynamic_cast<QUmlValueSpecification *>(element->clone()));
+ c->setSymbol(symbol());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ if (owningExpression())
+ c->setOwningExpression(dynamic_cast<QUmlStringExpression *>(owningExpression()->clone()));
+ foreach (QUmlStringExpression *element, subExpression())
+ c->addSubExpression(dynamic_cast<QUmlStringExpression *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The string expression of which this expression is a substring.
*/
-QUmlStringExpression *
-QUmlStringExpression::owningExpression() const
+QUmlStringExpression *QUmlStringExpression::owningExpression() const
{
// This is a read-write association end
@@ -97,8 +139,7 @@ void QUmlStringExpression::setOwningExpression(QUmlStringExpression *owningExpre
/*!
The StringExpressions that constitute this StringExpression.
*/
-const QSet<QUmlStringExpression *>
-QUmlStringExpression::subExpression() const
+const QSet<QUmlStringExpression *> QUmlStringExpression::subExpression() const
{
// This is a read-write association end
diff --git a/src/uml/qumlstringexpression.h b/src/uml/qumlstringexpression.h
index 2a4fe801..3ef6b547 100644
--- a/src/uml/qumlstringexpression.h
+++ b/src/uml/qumlstringexpression.h
@@ -59,6 +59,8 @@ public:
explicit QUmlStringExpression(bool createQObject = true);
virtual ~QUmlStringExpression();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlStringExpression *owningExpression() const;
void setOwningExpression(QUmlStringExpression *owningExpression);
diff --git a/src/uml/qumlstructuralfeature.cpp b/src/uml/qumlstructuralfeature.cpp
index 79365889..1b498860 100644
--- a/src/uml/qumlstructuralfeature.cpp
+++ b/src/uml/qumlstructuralfeature.cpp
@@ -40,6 +40,18 @@
****************************************************************************/
#include "qumlstructuralfeature.h"
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlMultiplicityElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlStructuralFeature
@@ -56,13 +68,37 @@ QUmlStructuralFeature::~QUmlStructuralFeature()
{
}
+QModelingObject *QUmlStructuralFeature::clone() const
+{
+ QUmlStructuralFeature *c = new QUmlStructuralFeature;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ c->setOrdered(isOrdered());
+ c->setUnique(isUnique());
+ if (lowerValue())
+ c->setLowerValue(dynamic_cast<QUmlValueSpecification *>(lowerValue()->clone()));
+ if (upperValue())
+ c->setUpperValue(dynamic_cast<QUmlValueSpecification *>(upperValue()->clone()));
+ c->setLeaf(isLeaf());
+ c->setStatic(isStatic());
+ c->setReadOnly(isReadOnly());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
States whether the feature's value may be modified by a client.
*/
-bool
-QUmlStructuralFeature::isReadOnly() const
+bool QUmlStructuralFeature::isReadOnly() const
{
// This is a read-write property
diff --git a/src/uml/qumlstructuralfeature.h b/src/uml/qumlstructuralfeature.h
index 306ced49..efc5025b 100644
--- a/src/uml/qumlstructuralfeature.h
+++ b/src/uml/qumlstructuralfeature.h
@@ -59,6 +59,8 @@ class Q_UML_EXPORT QUmlStructuralFeature : public virtual QUmlTypedElement, publ
public:
virtual ~QUmlStructuralFeature();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
bool isReadOnly() const;
void setReadOnly(bool isReadOnly);
diff --git a/src/uml/qumlstructuralfeatureaction.cpp b/src/uml/qumlstructuralfeatureaction.cpp
index 183bcca4..e47da1b9 100644
--- a/src/uml/qumlstructuralfeatureaction.cpp
+++ b/src/uml/qumlstructuralfeatureaction.cpp
@@ -40,9 +40,27 @@
****************************************************************************/
#include "qumlstructuralfeatureaction.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlStructuralFeature>
-
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlStructuralFeatureAction
@@ -60,13 +78,52 @@ QUmlStructuralFeatureAction::~QUmlStructuralFeatureAction()
{
}
+QModelingObject *QUmlStructuralFeatureAction::clone() const
+{
+ QUmlStructuralFeatureAction *c = new QUmlStructuralFeatureAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (object())
+ c->setObject(dynamic_cast<QUmlInputPin *>(object()->clone()));
+ if (structuralFeature())
+ c->setStructuralFeature(dynamic_cast<QUmlStructuralFeature *>(structuralFeature()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Gives the input pin from which the object whose structural feature is to be read or written is obtained.
*/
-QUmlInputPin *
-QUmlStructuralFeatureAction::object() const
+QUmlInputPin *QUmlStructuralFeatureAction::object() const
{
// This is a read-write association end
@@ -96,8 +153,7 @@ void QUmlStructuralFeatureAction::setObject(QUmlInputPin *object)
/*!
Structural feature to be read.
*/
-QUmlStructuralFeature *
-QUmlStructuralFeatureAction::structuralFeature() const
+QUmlStructuralFeature *QUmlStructuralFeatureAction::structuralFeature() const
{
// This is a read-write association end
diff --git a/src/uml/qumlstructuralfeatureaction.h b/src/uml/qumlstructuralfeatureaction.h
index 415e510e..8bda94a1 100644
--- a/src/uml/qumlstructuralfeatureaction.h
+++ b/src/uml/qumlstructuralfeatureaction.h
@@ -60,6 +60,8 @@ class Q_UML_EXPORT QUmlStructuralFeatureAction : public QUmlAction
public:
virtual ~QUmlStructuralFeatureAction();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QUmlInputPin *object() const;
void setObject(QUmlInputPin *object);
diff --git a/src/uml/qumlstructuredactivitynode.cpp b/src/uml/qumlstructuredactivitynode.cpp
index 17c02d07..e056ffea 100644
--- a/src/uml/qumlstructuredactivitynode.cpp
+++ b/src/uml/qumlstructuredactivitynode.cpp
@@ -44,11 +44,27 @@
#include <QtUml/QUmlActivity>
#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlVariable>
-
/*!
\class QUmlStructuredActivityNode
@@ -72,13 +88,65 @@ QUmlStructuredActivityNode::~QUmlStructuredActivityNode()
}
}
+QModelingObject *QUmlStructuredActivityNode::clone() const
+{
+ QUmlStructuredActivityNode *c = new QUmlStructuredActivityNode;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlActivityEdge *element, edge())
+ c->addEdge(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ c->setMustIsolate(mustIsolate());
+ foreach (QUmlActivityNode *element, node())
+ c->addNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlInputPin *element, structuredNodeInput())
+ c->addStructuredNodeInput(dynamic_cast<QUmlInputPin *>(element->clone()));
+ foreach (QUmlOutputPin *element, structuredNodeOutput())
+ c->addStructuredNodeOutput(dynamic_cast<QUmlOutputPin *>(element->clone()));
+ foreach (QUmlVariable *element, variable())
+ c->addVariable(dynamic_cast<QUmlVariable *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Activity immediately containing the node.
*/
-QUmlActivity *
-QUmlStructuredActivityNode::activity() const
+QUmlActivity *QUmlStructuredActivityNode::activity() const
{
// This is a read-write association end
@@ -99,8 +167,7 @@ void QUmlStructuredActivityNode::setActivity(QUmlActivity *activity)
/*!
Edges immediately contained in the structured node.
*/
-const QSet<QUmlActivityEdge *>
-QUmlStructuredActivityNode::edge() const
+const QSet<QUmlActivityEdge *> QUmlStructuredActivityNode::edge() const
{
// This is a read-write association end
@@ -151,8 +218,7 @@ void QUmlStructuredActivityNode::removeEdge(QUmlActivityEdge *edge)
/*!
If true, then the actions in the node execute in isolation from actions outside the node.
*/
-bool
-QUmlStructuredActivityNode::mustIsolate() const
+bool QUmlStructuredActivityNode::mustIsolate() const
{
// This is a read-write property
@@ -171,8 +237,7 @@ void QUmlStructuredActivityNode::setMustIsolate(bool mustIsolate)
/*!
Nodes immediately contained in the group.
*/
-const QSet<QUmlActivityNode *>
-QUmlStructuredActivityNode::node() const
+const QSet<QUmlActivityNode *> QUmlStructuredActivityNode::node() const
{
// This is a read-write association end
@@ -220,8 +285,7 @@ void QUmlStructuredActivityNode::removeNode(QUmlActivityNode *node)
}
}
-const QSet<QUmlInputPin *>
-QUmlStructuredActivityNode::structuredNodeInput() const
+const QSet<QUmlInputPin *> QUmlStructuredActivityNode::structuredNodeInput() const
{
// This is a read-write association end
@@ -257,8 +321,7 @@ void QUmlStructuredActivityNode::removeStructuredNodeInput(QUmlInputPin *structu
}
}
-const QSet<QUmlOutputPin *>
-QUmlStructuredActivityNode::structuredNodeOutput() const
+const QSet<QUmlOutputPin *> QUmlStructuredActivityNode::structuredNodeOutput() const
{
// This is a read-write association end
@@ -297,8 +360,7 @@ void QUmlStructuredActivityNode::removeStructuredNodeOutput(QUmlOutputPin *struc
/*!
A variable defined in the scope of the structured activity node. It has no value and may not be accessed
*/
-const QSet<QUmlVariable *>
-QUmlStructuredActivityNode::variable() const
+const QSet<QUmlVariable *> QUmlStructuredActivityNode::variable() const
{
// This is a read-write association end
diff --git a/src/uml/qumlstructuredactivitynode.h b/src/uml/qumlstructuredactivitynode.h
index 06bce6b5..e9136dd0 100644
--- a/src/uml/qumlstructuredactivitynode.h
+++ b/src/uml/qumlstructuredactivitynode.h
@@ -67,6 +67,8 @@ public:
explicit QUmlStructuredActivityNode(bool createQObject = true);
virtual ~QUmlStructuredActivityNode();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlActivity *activity() const;
void setActivity(QUmlActivity *activity);
diff --git a/src/uml/qumlstructuredclassifier.cpp b/src/uml/qumlstructuredclassifier.cpp
index 01d87095..61fa0281 100644
--- a/src/uml/qumlstructuredclassifier.cpp
+++ b/src/uml/qumlstructuredclassifier.cpp
@@ -40,10 +40,35 @@
****************************************************************************/
#include "qumlstructuredclassifier.h"
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConnectableElement>
#include <QtUml/QUmlConnector>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlProperty>
-
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlUseCase>
/*!
\class QUmlStructuredClassifier
@@ -59,13 +84,65 @@ QUmlStructuredClassifier::~QUmlStructuredClassifier()
{
}
+QModelingObject *QUmlStructuredClassifier::clone() const
+{
+ QUmlStructuredClassifier *c = new QUmlStructuredClassifier;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlProperty *element, ownedAttribute())
+ c->addOwnedAttribute(dynamic_cast<QUmlProperty *>(element->clone()));
+ foreach (QUmlConnector *element, ownedConnector())
+ c->addOwnedConnector(dynamic_cast<QUmlConnector *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the properties owned by the classifier.
*/
-const QList<QUmlProperty *>
-QUmlStructuredClassifier::ownedAttribute() const
+const QList<QUmlProperty *> QUmlStructuredClassifier::ownedAttribute() const
{
// This is a read-write association end
@@ -108,8 +185,7 @@ void QUmlStructuredClassifier::removeOwnedAttribute(QUmlProperty *ownedAttribute
/*!
References the connectors owned by the classifier.
*/
-const QSet<QUmlConnector *>
-QUmlStructuredClassifier::ownedConnector() const
+const QSet<QUmlConnector *> QUmlStructuredClassifier::ownedConnector() const
{
// This is a read-write association end
@@ -150,8 +226,7 @@ void QUmlStructuredClassifier::removeOwnedConnector(QUmlConnector *ownedConnecto
/*!
References the properties specifying instances that the classifier owns by composition. This association is derived, selecting those owned properties where isComposite is true.
*/
-const QSet<QUmlProperty *>
-QUmlStructuredClassifier::part() const
+const QSet<QUmlProperty *> QUmlStructuredClassifier::part() const
{
// This is a read-only derived association end
@@ -187,8 +262,7 @@ void QUmlStructuredClassifier::removePart(QUmlProperty *part)
/*!
References the roles that instances may play in this classifier.
*/
-const QSet<QUmlConnectableElement *>
-QUmlStructuredClassifier::role() const
+const QSet<QUmlConnectableElement *> QUmlStructuredClassifier::role() const
{
// This is a read-only derived union association end
diff --git a/src/uml/qumlstructuredclassifier.h b/src/uml/qumlstructuredclassifier.h
index 46a1abcc..3c7131d4 100644
--- a/src/uml/qumlstructuredclassifier.h
+++ b/src/uml/qumlstructuredclassifier.h
@@ -61,6 +61,8 @@ class Q_UML_EXPORT QUmlStructuredClassifier : public virtual QUmlClassifier
public:
virtual ~QUmlStructuredClassifier();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
const QList<QUmlProperty *> ownedAttribute() const;
void addOwnedAttribute(QUmlProperty *ownedAttribute);
diff --git a/src/uml/qumlsubstitution.cpp b/src/uml/qumlsubstitution.cpp
index 360d8335..57686273 100644
--- a/src/uml/qumlsubstitution.cpp
+++ b/src/uml/qumlsubstitution.cpp
@@ -43,7 +43,16 @@
#include "private/qumlsubstitutionobject_p.h"
#include <QtUml/QUmlClassifier>
-
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOpaqueExpression>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlSubstitution
@@ -68,13 +77,40 @@ QUmlSubstitution::~QUmlSubstitution()
}
}
+QModelingObject *QUmlSubstitution::clone() const
+{
+ QUmlSubstitution *c = new QUmlSubstitution;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlNamedElement *element, client())
+ c->addClient(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ foreach (QUmlNamedElement *element, supplier())
+ c->addSupplier(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ if (mapping())
+ c->setMapping(dynamic_cast<QUmlOpaqueExpression *>(mapping()->clone()));
+ if (contract())
+ c->setContract(dynamic_cast<QUmlClassifier *>(contract()->clone()));
+ if (substitutingClassifier())
+ c->setSubstitutingClassifier(dynamic_cast<QUmlClassifier *>(substitutingClassifier()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The contract with which the substituting classifier complies.
*/
-QUmlClassifier *
-QUmlSubstitution::contract() const
+QUmlClassifier *QUmlSubstitution::contract() const
{
// This is a read-write association end
@@ -103,8 +139,7 @@ void QUmlSubstitution::setContract(QUmlClassifier *contract)
/*!
Instances of the substituting classifier are runtime substitutable where instances of the contract classifier are expected.
*/
-QUmlClassifier *
-QUmlSubstitution::substitutingClassifier() const
+QUmlClassifier *QUmlSubstitution::substitutingClassifier() const
{
// This is a read-write association end
diff --git a/src/uml/qumlsubstitution.h b/src/uml/qumlsubstitution.h
index 101280d8..677f2393 100644
--- a/src/uml/qumlsubstitution.h
+++ b/src/uml/qumlsubstitution.h
@@ -60,6 +60,8 @@ public:
explicit QUmlSubstitution(bool createQObject = true);
virtual ~QUmlSubstitution();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlClassifier *contract() const;
void setContract(QUmlClassifier *contract);
diff --git a/src/uml/qumltemplateableelement.cpp b/src/uml/qumltemplateableelement.cpp
index db83887c..2ec43c5f 100644
--- a/src/uml/qumltemplateableelement.cpp
+++ b/src/uml/qumltemplateableelement.cpp
@@ -40,10 +40,11 @@
****************************************************************************/
#include "qumltemplateableelement.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlTemplateBinding>
#include <QtUml/QUmlTemplateSignature>
-
/*!
\class QUmlTemplateableElement
@@ -60,13 +61,24 @@ QUmlTemplateableElement::~QUmlTemplateableElement()
{
}
+QModelingObject *QUmlTemplateableElement::clone() const
+{
+ QUmlTemplateableElement *c = new QUmlTemplateableElement;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The optional template signature specifying the formal template parameters.
*/
-QUmlTemplateSignature *
-QUmlTemplateableElement::ownedTemplateSignature() const
+QUmlTemplateSignature *QUmlTemplateableElement::ownedTemplateSignature() const
{
// This is a read-write association end
@@ -96,8 +108,7 @@ void QUmlTemplateableElement::setOwnedTemplateSignature(QUmlTemplateSignature *o
/*!
The optional bindings from this element to templates.
*/
-const QSet<QUmlTemplateBinding *>
-QUmlTemplateableElement::templateBinding() const
+const QSet<QUmlTemplateBinding *> QUmlTemplateableElement::templateBinding() const
{
// This is a read-write association end
diff --git a/src/uml/qumltemplateableelement.h b/src/uml/qumltemplateableelement.h
index 262ea020..40ead4a7 100644
--- a/src/uml/qumltemplateableelement.h
+++ b/src/uml/qumltemplateableelement.h
@@ -61,6 +61,8 @@ class Q_UML_EXPORT QUmlTemplateableElement : public virtual QUmlElement
public:
virtual ~QUmlTemplateableElement();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QUmlTemplateSignature *ownedTemplateSignature() const;
void setOwnedTemplateSignature(QUmlTemplateSignature *ownedTemplateSignature);
diff --git a/src/uml/qumltemplatebinding.cpp b/src/uml/qumltemplatebinding.cpp
index 98038395..f100ad0d 100644
--- a/src/uml/qumltemplatebinding.cpp
+++ b/src/uml/qumltemplatebinding.cpp
@@ -42,10 +42,11 @@
#include "private/qumltemplatebindingobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlTemplateableElement>
#include <QtUml/QUmlTemplateParameterSubstitution>
#include <QtUml/QUmlTemplateSignature>
-
/*!
\class QUmlTemplateBinding
@@ -69,13 +70,26 @@ QUmlTemplateBinding::~QUmlTemplateBinding()
}
}
+QModelingObject *QUmlTemplateBinding::clone() const
+{
+ QUmlTemplateBinding *c = new QUmlTemplateBinding;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (boundElement())
+ c->setBoundElement(dynamic_cast<QUmlTemplateableElement *>(boundElement()->clone()));
+ foreach (QUmlTemplateParameterSubstitution *element, parameterSubstitution())
+ c->addParameterSubstitution(dynamic_cast<QUmlTemplateParameterSubstitution *>(element->clone()));
+ if (signature())
+ c->setSignature(dynamic_cast<QUmlTemplateSignature *>(signature()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The element that is bound by this binding.
*/
-QUmlTemplateableElement *
-QUmlTemplateBinding::boundElement() const
+QUmlTemplateableElement *QUmlTemplateBinding::boundElement() const
{
// This is a read-write association end
@@ -105,8 +119,7 @@ void QUmlTemplateBinding::setBoundElement(QUmlTemplateableElement *boundElement)
/*!
The parameter substitutions owned by this template binding.
*/
-const QSet<QUmlTemplateParameterSubstitution *>
-QUmlTemplateBinding::parameterSubstitution() const
+const QSet<QUmlTemplateParameterSubstitution *> QUmlTemplateBinding::parameterSubstitution() const
{
// This is a read-write association end
@@ -155,8 +168,7 @@ void QUmlTemplateBinding::removeParameterSubstitution(QUmlTemplateParameterSubst
/*!
The template signature for the template that is the target of the binding.
*/
-QUmlTemplateSignature *
-QUmlTemplateBinding::signature() const
+QUmlTemplateSignature *QUmlTemplateBinding::signature() const
{
// This is a read-write association end
diff --git a/src/uml/qumltemplatebinding.h b/src/uml/qumltemplatebinding.h
index c13b719f..d9ef2bd9 100644
--- a/src/uml/qumltemplatebinding.h
+++ b/src/uml/qumltemplatebinding.h
@@ -62,6 +62,8 @@ public:
explicit QUmlTemplateBinding(bool createQObject = true);
virtual ~QUmlTemplateBinding();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlTemplateableElement *boundElement() const;
void setBoundElement(QUmlTemplateableElement *boundElement);
diff --git a/src/uml/qumltemplateparameter.cpp b/src/uml/qumltemplateparameter.cpp
index 090ae1b0..a5ae2fe9 100644
--- a/src/uml/qumltemplateparameter.cpp
+++ b/src/uml/qumltemplateparameter.cpp
@@ -42,9 +42,10 @@
#include "private/qumltemplateparameterobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlTemplateSignature>
-
/*!
\class QUmlTemplateParameter
@@ -71,13 +72,30 @@ QUmlTemplateParameter::~QUmlTemplateParameter()
}
}
+QModelingObject *QUmlTemplateParameter::clone() const
+{
+ QUmlTemplateParameter *c = new QUmlTemplateParameter;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (default_())
+ c->setDefault(dynamic_cast<QUmlParameterableElement *>(default_()->clone()));
+ if (ownedDefault())
+ c->setOwnedDefault(dynamic_cast<QUmlParameterableElement *>(ownedDefault()->clone()));
+ if (ownedParameteredElement())
+ c->setOwnedParameteredElement(dynamic_cast<QUmlParameterableElement *>(ownedParameteredElement()->clone()));
+ if (parameteredElement())
+ c->setParameteredElement(dynamic_cast<QUmlParameterableElement *>(parameteredElement()->clone()));
+ if (signature())
+ c->setSignature(dynamic_cast<QUmlTemplateSignature *>(signature()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The element that is the default for this formal template parameter.
*/
-QUmlParameterableElement *
-QUmlTemplateParameter::default_() const
+QUmlParameterableElement *QUmlTemplateParameter::default_() const
{
// This is a read-write association end
@@ -98,8 +116,7 @@ void QUmlTemplateParameter::setDefault(QUmlParameterableElement *default_)
/*!
The element that is owned by this template parameter for the purpose of providing a default.
*/
-QUmlParameterableElement *
-QUmlTemplateParameter::ownedDefault() const
+QUmlParameterableElement *QUmlTemplateParameter::ownedDefault() const
{
// This is a read-write association end
@@ -130,8 +147,7 @@ void QUmlTemplateParameter::setOwnedDefault(QUmlParameterableElement *ownedDefau
/*!
The element that is owned by this template parameter.
*/
-QUmlParameterableElement *
-QUmlTemplateParameter::ownedParameteredElement() const
+QUmlParameterableElement *QUmlTemplateParameter::ownedParameteredElement() const
{
// This is a read-write association end
@@ -162,8 +178,7 @@ void QUmlTemplateParameter::setOwnedParameteredElement(QUmlParameterableElement
/*!
The element exposed by this template parameter.
*/
-QUmlParameterableElement *
-QUmlTemplateParameter::parameteredElement() const
+QUmlParameterableElement *QUmlTemplateParameter::parameteredElement() const
{
// This is a read-write association end
@@ -184,8 +199,7 @@ void QUmlTemplateParameter::setParameteredElement(QUmlParameterableElement *para
/*!
The template signature that owns this template parameter.
*/
-QUmlTemplateSignature *
-QUmlTemplateParameter::signature() const
+QUmlTemplateSignature *QUmlTemplateParameter::signature() const
{
// This is a read-write association end
diff --git a/src/uml/qumltemplateparameter.h b/src/uml/qumltemplateparameter.h
index bbba3c81..36ddbc59 100644
--- a/src/uml/qumltemplateparameter.h
+++ b/src/uml/qumltemplateparameter.h
@@ -61,6 +61,8 @@ public:
explicit QUmlTemplateParameter(bool createQObject = true);
virtual ~QUmlTemplateParameter();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlParameterableElement *default_() const;
void setDefault(QUmlParameterableElement *default_);
diff --git a/src/uml/qumltemplateparametersubstitution.cpp b/src/uml/qumltemplateparametersubstitution.cpp
index 3d2461e9..90459905 100644
--- a/src/uml/qumltemplateparametersubstitution.cpp
+++ b/src/uml/qumltemplateparametersubstitution.cpp
@@ -42,10 +42,11 @@
#include "private/qumltemplateparametersubstitutionobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlParameterableElement>
#include <QtUml/QUmlTemplateBinding>
#include <QtUml/QUmlTemplateParameter>
-
/*!
\class QUmlTemplateParameterSubstitution
@@ -71,13 +72,28 @@ QUmlTemplateParameterSubstitution::~QUmlTemplateParameterSubstitution()
}
}
+QModelingObject *QUmlTemplateParameterSubstitution::clone() const
+{
+ QUmlTemplateParameterSubstitution *c = new QUmlTemplateParameterSubstitution;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (actual())
+ c->setActual(dynamic_cast<QUmlParameterableElement *>(actual()->clone()));
+ if (formal())
+ c->setFormal(dynamic_cast<QUmlTemplateParameter *>(formal()->clone()));
+ if (ownedActual())
+ c->setOwnedActual(dynamic_cast<QUmlParameterableElement *>(ownedActual()->clone()));
+ if (templateBinding())
+ c->setTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(templateBinding()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The element that is the actual parameter for this substitution.
*/
-QUmlParameterableElement *
-QUmlTemplateParameterSubstitution::actual() const
+QUmlParameterableElement *QUmlTemplateParameterSubstitution::actual() const
{
// This is a read-write association end
@@ -98,8 +114,7 @@ void QUmlTemplateParameterSubstitution::setActual(QUmlParameterableElement *actu
/*!
The formal template parameter that is associated with this substitution.
*/
-QUmlTemplateParameter *
-QUmlTemplateParameterSubstitution::formal() const
+QUmlTemplateParameter *QUmlTemplateParameterSubstitution::formal() const
{
// This is a read-write association end
@@ -120,8 +135,7 @@ void QUmlTemplateParameterSubstitution::setFormal(QUmlTemplateParameter *formal)
/*!
The actual parameter that is owned by this substitution.
*/
-QUmlParameterableElement *
-QUmlTemplateParameterSubstitution::ownedActual() const
+QUmlParameterableElement *QUmlTemplateParameterSubstitution::ownedActual() const
{
// This is a read-write association end
@@ -152,8 +166,7 @@ void QUmlTemplateParameterSubstitution::setOwnedActual(QUmlParameterableElement
/*!
The optional bindings from this element to templates.
*/
-QUmlTemplateBinding *
-QUmlTemplateParameterSubstitution::templateBinding() const
+QUmlTemplateBinding *QUmlTemplateParameterSubstitution::templateBinding() const
{
// This is a read-write association end
diff --git a/src/uml/qumltemplateparametersubstitution.h b/src/uml/qumltemplateparametersubstitution.h
index eb783c3f..d49eacc7 100644
--- a/src/uml/qumltemplateparametersubstitution.h
+++ b/src/uml/qumltemplateparametersubstitution.h
@@ -62,6 +62,8 @@ public:
explicit QUmlTemplateParameterSubstitution(bool createQObject = true);
virtual ~QUmlTemplateParameterSubstitution();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlParameterableElement *actual() const;
void setActual(QUmlParameterableElement *actual);
diff --git a/src/uml/qumltemplatesignature.cpp b/src/uml/qumltemplatesignature.cpp
index adf3ae3a..06b3ebcb 100644
--- a/src/uml/qumltemplatesignature.cpp
+++ b/src/uml/qumltemplatesignature.cpp
@@ -42,9 +42,10 @@
#include "private/qumltemplatesignatureobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlTemplateableElement>
#include <QtUml/QUmlTemplateParameter>
-
/*!
\class QUmlTemplateSignature
@@ -67,13 +68,26 @@ QUmlTemplateSignature::~QUmlTemplateSignature()
}
}
+QModelingObject *QUmlTemplateSignature::clone() const
+{
+ QUmlTemplateSignature *c = new QUmlTemplateSignature;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlTemplateParameter *element, ownedParameter())
+ c->addOwnedParameter(dynamic_cast<QUmlTemplateParameter *>(element->clone()));
+ foreach (QUmlTemplateParameter *element, parameter())
+ c->addParameter(dynamic_cast<QUmlTemplateParameter *>(element->clone()));
+ if (template_())
+ c->setTemplate(dynamic_cast<QUmlTemplateableElement *>(template_()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The formal template parameters that are owned by this template signature.
*/
-const QList<QUmlTemplateParameter *>
-QUmlTemplateSignature::ownedParameter() const
+const QList<QUmlTemplateParameter *> QUmlTemplateSignature::ownedParameter() const
{
// This is a read-write association end
@@ -124,8 +138,7 @@ void QUmlTemplateSignature::removeOwnedParameter(QUmlTemplateParameter *ownedPar
/*!
The ordered set of all formal template parameters for this template signature.
*/
-const QList<QUmlTemplateParameter *>
-QUmlTemplateSignature::parameter() const
+const QList<QUmlTemplateParameter *> QUmlTemplateSignature::parameter() const
{
// This is a read-write association end
@@ -155,8 +168,7 @@ void QUmlTemplateSignature::removeParameter(QUmlTemplateParameter *parameter)
/*!
The element that owns this template signature.
*/
-QUmlTemplateableElement *
-QUmlTemplateSignature::template_() const
+QUmlTemplateableElement *QUmlTemplateSignature::template_() const
{
// This is a read-write association end
diff --git a/src/uml/qumltemplatesignature.h b/src/uml/qumltemplatesignature.h
index f0a0a9f2..db65a6a3 100644
--- a/src/uml/qumltemplatesignature.h
+++ b/src/uml/qumltemplatesignature.h
@@ -61,6 +61,8 @@ public:
explicit QUmlTemplateSignature(bool createQObject = true);
virtual ~QUmlTemplateSignature();
+ QModelingObject *clone() const;
+
// Owned attributes
const QList<QUmlTemplateParameter *> ownedParameter() const;
void addOwnedParameter(QUmlTemplateParameter *ownedParameter);
diff --git a/src/uml/qumltestidentityaction.cpp b/src/uml/qumltestidentityaction.cpp
index 78666588..3874fc4e 100644
--- a/src/uml/qumltestidentityaction.cpp
+++ b/src/uml/qumltestidentityaction.cpp
@@ -42,9 +42,26 @@
#include "private/qumltestidentityactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlTestIdentityAction
@@ -69,13 +86,54 @@ QUmlTestIdentityAction::~QUmlTestIdentityAction()
}
}
+QModelingObject *QUmlTestIdentityAction::clone() const
+{
+ QUmlTestIdentityAction *c = new QUmlTestIdentityAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (first())
+ c->setFirst(dynamic_cast<QUmlInputPin *>(first()->clone()));
+ if (result())
+ c->setResult(dynamic_cast<QUmlOutputPin *>(result()->clone()));
+ if (second())
+ c->setSecond(dynamic_cast<QUmlInputPin *>(second()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Gives the pin on which an object is placed.
*/
-QUmlInputPin *
-QUmlTestIdentityAction::first() const
+QUmlInputPin *QUmlTestIdentityAction::first() const
{
// This is a read-write association end
@@ -105,8 +163,7 @@ void QUmlTestIdentityAction::setFirst(QUmlInputPin *first)
/*!
Tells whether the two input objects are identical.
*/
-QUmlOutputPin *
-QUmlTestIdentityAction::result() const
+QUmlOutputPin *QUmlTestIdentityAction::result() const
{
// This is a read-write association end
@@ -136,8 +193,7 @@ void QUmlTestIdentityAction::setResult(QUmlOutputPin *result)
/*!
Gives the pin on which an object is placed.
*/
-QUmlInputPin *
-QUmlTestIdentityAction::second() const
+QUmlInputPin *QUmlTestIdentityAction::second() const
{
// This is a read-write association end
diff --git a/src/uml/qumltestidentityaction.h b/src/uml/qumltestidentityaction.h
index 67cb39b7..77c13d2d 100644
--- a/src/uml/qumltestidentityaction.h
+++ b/src/uml/qumltestidentityaction.h
@@ -61,6 +61,8 @@ public:
explicit QUmlTestIdentityAction(bool createQObject = true);
virtual ~QUmlTestIdentityAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlInputPin *first() const;
void setFirst(QUmlInputPin *first);
diff --git a/src/uml/qumltimeconstraint.cpp b/src/uml/qumltimeconstraint.cpp
index bc0e9404..84d09fa7 100644
--- a/src/uml/qumltimeconstraint.cpp
+++ b/src/uml/qumltimeconstraint.cpp
@@ -42,8 +42,18 @@
#include "private/qumltimeconstraintobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterval>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
#include <QtUml/QUmlTimeInterval>
-
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlTimeConstraint
@@ -68,13 +78,37 @@ QUmlTimeConstraint::~QUmlTimeConstraint()
}
}
+QModelingObject *QUmlTimeConstraint::clone() const
+{
+ QUmlTimeConstraint *c = new QUmlTimeConstraint;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlElement *element, constrainedElement())
+ c->addConstrainedElement(dynamic_cast<QUmlElement *>(element->clone()));
+ if (context())
+ c->setContext(dynamic_cast<QUmlNamespace *>(context()->clone()));
+ c->setFirstEvent(firstEvent());
+ if (specification())
+ c->setSpecification(dynamic_cast<QUmlTimeInterval *>(specification()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The value of firstEvent is related to constrainedElement. If firstEvent is true, then the corresponding observation event is the first time instant the execution enters constrainedElement. If firstEvent is false, then the corresponding observation event is the last time instant the execution is within constrainedElement.
*/
-bool
-QUmlTimeConstraint::firstEvent() const
+bool QUmlTimeConstraint::firstEvent() const
{
// This is a read-write property
@@ -93,8 +127,7 @@ void QUmlTimeConstraint::setFirstEvent(bool firstEvent)
/*!
A condition that must be true when evaluated in order for the constraint to be satisfied.
*/
-QUmlTimeInterval *
-QUmlTimeConstraint::specification() const
+QUmlTimeInterval *QUmlTimeConstraint::specification() const
{
// This is a read-write association end
diff --git a/src/uml/qumltimeconstraint.h b/src/uml/qumltimeconstraint.h
index 3f027ebe..6c1cfe8f 100644
--- a/src/uml/qumltimeconstraint.h
+++ b/src/uml/qumltimeconstraint.h
@@ -60,6 +60,8 @@ public:
explicit QUmlTimeConstraint(bool createQObject = true);
virtual ~QUmlTimeConstraint();
+ QModelingObject *clone() const;
+
// Owned attributes
bool firstEvent() const;
void setFirstEvent(bool firstEvent);
diff --git a/src/uml/qumltimeevent.cpp b/src/uml/qumltimeevent.cpp
index 87373d06..962e92d8 100644
--- a/src/uml/qumltimeevent.cpp
+++ b/src/uml/qumltimeevent.cpp
@@ -42,8 +42,16 @@
#include "private/qumltimeeventobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
#include <QtUml/QUmlTimeExpression>
-
/*!
\class QUmlTimeEvent
@@ -67,13 +75,33 @@ QUmlTimeEvent::~QUmlTimeEvent()
}
}
+QModelingObject *QUmlTimeEvent::clone() const
+{
+ QUmlTimeEvent *c = new QUmlTimeEvent;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setRelative(isRelative());
+ if (when())
+ c->setWhen(dynamic_cast<QUmlTimeExpression *>(when()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies whether it is relative or absolute time.
*/
-bool
-QUmlTimeEvent::isRelative() const
+bool QUmlTimeEvent::isRelative() const
{
// This is a read-write property
@@ -92,8 +120,7 @@ void QUmlTimeEvent::setRelative(bool isRelative)
/*!
Specifies the corresponding time deadline.
*/
-QUmlTimeExpression *
-QUmlTimeEvent::when() const
+QUmlTimeExpression *QUmlTimeEvent::when() const
{
// This is a read-write association end
diff --git a/src/uml/qumltimeevent.h b/src/uml/qumltimeevent.h
index 9656e077..e1a0b674 100644
--- a/src/uml/qumltimeevent.h
+++ b/src/uml/qumltimeevent.h
@@ -60,6 +60,8 @@ public:
explicit QUmlTimeEvent(bool createQObject = true);
virtual ~QUmlTimeEvent();
+ QModelingObject *clone() const;
+
// Owned attributes
bool isRelative() const;
void setRelative(bool isRelative);
diff --git a/src/uml/qumltimeexpression.cpp b/src/uml/qumltimeexpression.cpp
index be00f7ee..40f87519 100644
--- a/src/uml/qumltimeexpression.cpp
+++ b/src/uml/qumltimeexpression.cpp
@@ -42,8 +42,18 @@
#include "private/qumltimeexpressionobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlObservation>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlTimeExpression
@@ -66,13 +76,36 @@ QUmlTimeExpression::~QUmlTimeExpression()
}
}
+QModelingObject *QUmlTimeExpression::clone() const
+{
+ QUmlTimeExpression *c = new QUmlTimeExpression;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (expr())
+ c->setExpr(dynamic_cast<QUmlValueSpecification *>(expr()->clone()));
+ foreach (QUmlObservation *element, observation())
+ c->addObservation(dynamic_cast<QUmlObservation *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The value of the time expression.
*/
-QUmlValueSpecification *
-QUmlTimeExpression::expr() const
+QUmlValueSpecification *QUmlTimeExpression::expr() const
{
// This is a read-write association end
@@ -102,8 +135,7 @@ void QUmlTimeExpression::setExpr(QUmlValueSpecification *expr)
/*!
Refers to the time and duration observations that are involved in expr.
*/
-const QSet<QUmlObservation *>
-QUmlTimeExpression::observation() const
+const QSet<QUmlObservation *> QUmlTimeExpression::observation() const
{
// This is a read-write association end
diff --git a/src/uml/qumltimeexpression.h b/src/uml/qumltimeexpression.h
index 0e39db27..f523e641 100644
--- a/src/uml/qumltimeexpression.h
+++ b/src/uml/qumltimeexpression.h
@@ -60,6 +60,8 @@ public:
explicit QUmlTimeExpression(bool createQObject = true);
virtual ~QUmlTimeExpression();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlValueSpecification *expr() const;
void setExpr(QUmlValueSpecification *expr);
diff --git a/src/uml/qumltimeinterval.cpp b/src/uml/qumltimeinterval.cpp
index 1f7e89ef..af568a61 100644
--- a/src/uml/qumltimeinterval.cpp
+++ b/src/uml/qumltimeinterval.cpp
@@ -42,8 +42,18 @@
#include "private/qumltimeintervalobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
#include <QtUml/QUmlTimeExpression>
-
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlTimeInterval
@@ -68,13 +78,36 @@ QUmlTimeInterval::~QUmlTimeInterval()
}
}
+QModelingObject *QUmlTimeInterval::clone() const
+{
+ QUmlTimeInterval *c = new QUmlTimeInterval;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (max())
+ c->setMax(dynamic_cast<QUmlTimeExpression *>(max()->clone()));
+ if (min())
+ c->setMin(dynamic_cast<QUmlTimeExpression *>(min()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Refers to the TimeExpression denoting the maximum value of the range.
*/
-QUmlTimeExpression *
-QUmlTimeInterval::max() const
+QUmlTimeExpression *QUmlTimeInterval::max() const
{
// This is a read-write association end
@@ -95,8 +128,7 @@ void QUmlTimeInterval::setMax(QUmlTimeExpression *max)
/*!
Refers to the TimeExpression denoting the minimum value of the range.
*/
-QUmlTimeExpression *
-QUmlTimeInterval::min() const
+QUmlTimeExpression *QUmlTimeInterval::min() const
{
// This is a read-write association end
diff --git a/src/uml/qumltimeinterval.h b/src/uml/qumltimeinterval.h
index 7679da93..8273496f 100644
--- a/src/uml/qumltimeinterval.h
+++ b/src/uml/qumltimeinterval.h
@@ -60,6 +60,8 @@ public:
explicit QUmlTimeInterval(bool createQObject = true);
virtual ~QUmlTimeInterval();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlTimeExpression *max() const;
void setMax(QUmlTimeExpression *max);
diff --git a/src/uml/qumltimeobservation.cpp b/src/uml/qumltimeobservation.cpp
index c4a568ca..a04c30ae 100644
--- a/src/uml/qumltimeobservation.cpp
+++ b/src/uml/qumltimeobservation.cpp
@@ -42,8 +42,15 @@
#include "private/qumltimeobservationobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlNamedElement>
-
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlTimeObservation
@@ -67,13 +74,33 @@ QUmlTimeObservation::~QUmlTimeObservation()
}
}
+QModelingObject *QUmlTimeObservation::clone() const
+{
+ QUmlTimeObservation *c = new QUmlTimeObservation;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (event())
+ c->setEvent(dynamic_cast<QUmlNamedElement *>(event()->clone()));
+ c->setFirstEvent(firstEvent());
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The observation is determined by the entering or exiting of the event element during execution.
*/
-QUmlNamedElement *
-QUmlTimeObservation::event() const
+QUmlNamedElement *QUmlTimeObservation::event() const
{
// This is a read-write association end
@@ -94,8 +121,7 @@ void QUmlTimeObservation::setEvent(QUmlNamedElement *event)
/*!
The value of firstEvent is related to event. If firstEvent is true, then the corresponding observation event is the first time instant the execution enters event. If firstEvent is false, then the corresponding observation event is the time instant the execution exits event.
*/
-bool
-QUmlTimeObservation::firstEvent() const
+bool QUmlTimeObservation::firstEvent() const
{
// This is a read-write property
diff --git a/src/uml/qumltimeobservation.h b/src/uml/qumltimeobservation.h
index c120b3b5..d7f17f29 100644
--- a/src/uml/qumltimeobservation.h
+++ b/src/uml/qumltimeobservation.h
@@ -60,6 +60,8 @@ public:
explicit QUmlTimeObservation(bool createQObject = true);
virtual ~QUmlTimeObservation();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlNamedElement *event() const;
void setEvent(QUmlNamedElement *event);
diff --git a/src/uml/qumltransition.cpp b/src/uml/qumltransition.cpp
index babf197c..548e823d 100644
--- a/src/uml/qumltransition.cpp
+++ b/src/uml/qumltransition.cpp
@@ -44,12 +44,22 @@
#include <QtUml/QUmlBehavior>
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlRedefinableElement>
#include <QtUml/QUmlRegion>
#include <QtUml/QUmlStateMachine>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlTrigger>
#include <QtUml/QUmlVertex>
-
/*!
\class QUmlTransition
@@ -78,13 +88,48 @@ QUmlTransition::~QUmlTransition()
}
}
+QModelingObject *QUmlTransition::clone() const
+{
+ QUmlTransition *c = new QUmlTransition;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (container())
+ c->setContainer(dynamic_cast<QUmlRegion *>(container()->clone()));
+ if (effect())
+ c->setEffect(dynamic_cast<QUmlBehavior *>(effect()->clone()));
+ if (guard())
+ c->setGuard(dynamic_cast<QUmlConstraint *>(guard()->clone()));
+ c->setKind(kind());
+ if (redefinedTransition())
+ c->setRedefinedTransition(dynamic_cast<QUmlTransition *>(redefinedTransition()->clone()));
+ if (source())
+ c->setSource(dynamic_cast<QUmlVertex *>(source()->clone()));
+ if (target())
+ c->setTarget(dynamic_cast<QUmlVertex *>(target()->clone()));
+ foreach (QUmlTrigger *element, trigger())
+ c->addTrigger(dynamic_cast<QUmlTrigger *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Designates the region that owns this transition.
*/
-QUmlRegion *
-QUmlTransition::container() const
+QUmlRegion *QUmlTransition::container() const
{
// This is a read-write association end
@@ -110,8 +155,7 @@ void QUmlTransition::setContainer(QUmlRegion *container)
/*!
Specifies an optional behavior to be performed when the transition fires.
*/
-QUmlBehavior *
-QUmlTransition::effect() const
+QUmlBehavior *QUmlTransition::effect() const
{
// This is a read-write association end
@@ -141,8 +185,7 @@ void QUmlTransition::setEffect(QUmlBehavior *effect)
/*!
A guard is a constraint that provides a fine-grained control over the firing of the transition. The guard is evaluated when an event occurrence is dispatched by the state machine. If the guard is true at that time, the transition may be enabled, otherwise, it is disabled. Guards should be pure expressions without side effects. Guard expressions with side effects are ill formed.
*/
-QUmlConstraint *
-QUmlTransition::guard() const
+QUmlConstraint *QUmlTransition::guard() const
{
// This is a read-write association end
@@ -172,8 +215,7 @@ void QUmlTransition::setGuard(QUmlConstraint *guard)
/*!
Indicates the precise type of the transition.
*/
-QtUml::TransitionKind
-QUmlTransition::kind() const
+QtUml::TransitionKind QUmlTransition::kind() const
{
// This is a read-write property
@@ -192,8 +234,7 @@ void QUmlTransition::setKind(QtUml::TransitionKind kind)
/*!
The transition that is redefined by this transition.
*/
-QUmlTransition *
-QUmlTransition::redefinedTransition() const
+QUmlTransition *QUmlTransition::redefinedTransition() const
{
// This is a read-write association end
@@ -222,8 +263,7 @@ void QUmlTransition::setRedefinedTransition(QUmlTransition *redefinedTransition)
/*!
References the classifier in which context this element may be redefined.
*/
-QUmlClassifier *
-QUmlTransition::redefinitionContext() const
+QUmlClassifier *QUmlTransition::redefinitionContext() const
{
// This is a read-only derived association end
@@ -247,8 +287,7 @@ void QUmlTransition::setRedefinitionContext(QUmlClassifier *redefinitionContext)
/*!
Designates the originating vertex (state or pseudostate) of the transition.
*/
-QUmlVertex *
-QUmlTransition::source() const
+QUmlVertex *QUmlTransition::source() const
{
// This is a read-write association end
@@ -269,8 +308,7 @@ void QUmlTransition::setSource(QUmlVertex *source)
/*!
Designates the target vertex that is reached when the transition is taken.
*/
-QUmlVertex *
-QUmlTransition::target() const
+QUmlVertex *QUmlTransition::target() const
{
// This is a read-write association end
@@ -291,8 +329,7 @@ void QUmlTransition::setTarget(QUmlVertex *target)
/*!
Specifies the triggers that may fire the transition.
*/
-const QSet<QUmlTrigger *>
-QUmlTransition::trigger() const
+const QSet<QUmlTrigger *> QUmlTransition::trigger() const
{
// This is a read-write association end
diff --git a/src/uml/qumltransition.h b/src/uml/qumltransition.h
index 48be00c2..31a7af2a 100644
--- a/src/uml/qumltransition.h
+++ b/src/uml/qumltransition.h
@@ -69,6 +69,8 @@ public:
explicit QUmlTransition(bool createQObject = true);
virtual ~QUmlTransition();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlRegion *container() const;
void setContainer(QUmlRegion *container);
diff --git a/src/uml/qumltrigger.cpp b/src/uml/qumltrigger.cpp
index 610858da..64fbd96f 100644
--- a/src/uml/qumltrigger.cpp
+++ b/src/uml/qumltrigger.cpp
@@ -42,9 +42,15 @@
#include "private/qumltriggerobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
#include <QtUml/QUmlEvent>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
#include <QtUml/QUmlPort>
-
+#include <QtUml/QUmlStringExpression>
/*!
\class QUmlTrigger
@@ -67,13 +73,30 @@ QUmlTrigger::~QUmlTrigger()
}
}
+QModelingObject *QUmlTrigger::clone() const
+{
+ QUmlTrigger *c = new QUmlTrigger;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (event())
+ c->setEvent(dynamic_cast<QUmlEvent *>(event()->clone()));
+ foreach (QUmlPort *element, port())
+ c->addPort(dynamic_cast<QUmlPort *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The event that causes the trigger.
*/
-QUmlEvent *
-QUmlTrigger::event() const
+QUmlEvent *QUmlTrigger::event() const
{
// This is a read-write association end
@@ -94,8 +117,7 @@ void QUmlTrigger::setEvent(QUmlEvent *event)
/*!
A optional port of the receiver object on which the behavioral feature is invoked.
*/
-const QSet<QUmlPort *>
-QUmlTrigger::port() const
+const QSet<QUmlPort *> QUmlTrigger::port() const
{
// This is a read-write association end
diff --git a/src/uml/qumltrigger.h b/src/uml/qumltrigger.h
index 88e4fbe2..cf6d9df4 100644
--- a/src/uml/qumltrigger.h
+++ b/src/uml/qumltrigger.h
@@ -61,6 +61,8 @@ public:
explicit QUmlTrigger(bool createQObject = true);
virtual ~QUmlTrigger();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlEvent *event() const;
void setEvent(QUmlEvent *event);
diff --git a/src/uml/qumltype.cpp b/src/uml/qumltype.cpp
index 19e5a281..21948239 100644
--- a/src/uml/qumltype.cpp
+++ b/src/uml/qumltype.cpp
@@ -40,8 +40,15 @@
****************************************************************************/
#include "qumltype.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlPackage>
-
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlType
@@ -58,13 +65,32 @@ QUmlType::~QUmlType()
{
}
+QModelingObject *QUmlType::clone() const
+{
+ QUmlType *c = new QUmlType;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Specifies the owning package of this classifier, if any.
*/
-QUmlPackage *
-QUmlType::package() const
+QUmlPackage *QUmlType::package() const
{
// This is a read-write association end
diff --git a/src/uml/qumltype.h b/src/uml/qumltype.h
index a23981ef..33d4e6cb 100644
--- a/src/uml/qumltype.h
+++ b/src/uml/qumltype.h
@@ -59,6 +59,8 @@ class Q_UML_EXPORT QUmlType : public QUmlPackageableElement
public:
virtual ~QUmlType();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QUmlPackage *package() const;
void setPackage(QUmlPackage *package);
diff --git a/src/uml/qumltypedelement.cpp b/src/uml/qumltypedelement.cpp
index a2725ca8..8899b9d0 100644
--- a/src/uml/qumltypedelement.cpp
+++ b/src/uml/qumltypedelement.cpp
@@ -40,8 +40,14 @@
****************************************************************************/
#include "qumltypedelement.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlType>
-
/*!
\class QUmlTypedElement
@@ -58,13 +64,28 @@ QUmlTypedElement::~QUmlTypedElement()
{
}
+QModelingObject *QUmlTypedElement::clone() const
+{
+ QUmlTypedElement *c = new QUmlTypedElement;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
This information is derived from the return result for this Operation.The type of the TypedElement.
*/
-QUmlType *
-QUmlTypedElement::type() const
+QUmlType *QUmlTypedElement::type() const
{
// This is a read-write association end
diff --git a/src/uml/qumltypedelement.h b/src/uml/qumltypedelement.h
index c5e1535c..165dfd02 100644
--- a/src/uml/qumltypedelement.h
+++ b/src/uml/qumltypedelement.h
@@ -59,6 +59,8 @@ class Q_UML_EXPORT QUmlTypedElement : public virtual QUmlNamedElement
public:
virtual ~QUmlTypedElement();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QUmlType *type() const;
void setType(QUmlType *type);
diff --git a/src/uml/qumlunmarshallaction.cpp b/src/uml/qumlunmarshallaction.cpp
index 37811671..662f6306 100644
--- a/src/uml/qumlunmarshallaction.cpp
+++ b/src/uml/qumlunmarshallaction.cpp
@@ -42,10 +42,26 @@
#include "private/qumlunmarshallactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlUnmarshallAction
@@ -69,13 +85,54 @@ QUmlUnmarshallAction::~QUmlUnmarshallAction()
}
}
+QModelingObject *QUmlUnmarshallAction::clone() const
+{
+ QUmlUnmarshallAction *c = new QUmlUnmarshallAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (object())
+ c->setObject(dynamic_cast<QUmlInputPin *>(object()->clone()));
+ foreach (QUmlOutputPin *element, result())
+ c->addResult(dynamic_cast<QUmlOutputPin *>(element->clone()));
+ if (unmarshallType())
+ c->setUnmarshallType(dynamic_cast<QUmlClassifier *>(unmarshallType()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The object to be unmarshalled.
*/
-QUmlInputPin *
-QUmlUnmarshallAction::object() const
+QUmlInputPin *QUmlUnmarshallAction::object() const
{
// This is a read-write association end
@@ -105,8 +162,7 @@ void QUmlUnmarshallAction::setObject(QUmlInputPin *object)
/*!
The values of the structural features of the input object.
*/
-const QSet<QUmlOutputPin *>
-QUmlUnmarshallAction::result() const
+const QSet<QUmlOutputPin *> QUmlUnmarshallAction::result() const
{
// This is a read-write association end
@@ -145,8 +201,7 @@ void QUmlUnmarshallAction::removeResult(QUmlOutputPin *result)
/*!
The type of the object to be unmarshalled.
*/
-QUmlClassifier *
-QUmlUnmarshallAction::unmarshallType() const
+QUmlClassifier *QUmlUnmarshallAction::unmarshallType() const
{
// This is a read-write association end
diff --git a/src/uml/qumlunmarshallaction.h b/src/uml/qumlunmarshallaction.h
index 505694fb..1da6539f 100644
--- a/src/uml/qumlunmarshallaction.h
+++ b/src/uml/qumlunmarshallaction.h
@@ -62,6 +62,8 @@ public:
explicit QUmlUnmarshallAction(bool createQObject = true);
virtual ~QUmlUnmarshallAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlInputPin *object() const;
void setObject(QUmlInputPin *object);
diff --git a/src/uml/qumlusage.cpp b/src/uml/qumlusage.cpp
index bbac557f..f924ccf6 100644
--- a/src/uml/qumlusage.cpp
+++ b/src/uml/qumlusage.cpp
@@ -42,6 +42,15 @@
#include "private/qumlusageobject_p.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
/*!
\class QUmlUsage
@@ -64,3 +73,25 @@ QUmlUsage::~QUmlUsage()
}
}
+QModelingObject *QUmlUsage::clone() const
+{
+ QUmlUsage *c = new QUmlUsage;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ foreach (QUmlNamedElement *element, client())
+ c->addClient(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ foreach (QUmlNamedElement *element, supplier())
+ c->addSupplier(dynamic_cast<QUmlNamedElement *>(element->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlusage.h b/src/uml/qumlusage.h
index 6e0d3060..9786b197 100644
--- a/src/uml/qumlusage.h
+++ b/src/uml/qumlusage.h
@@ -58,6 +58,8 @@ public:
explicit QUmlUsage(bool createQObject = true);
virtual ~QUmlUsage();
+ QModelingObject *clone() const;
+
protected:
};
diff --git a/src/uml/qumlusecase.cpp b/src/uml/qumlusecase.cpp
index eae5db7f..786588f1 100644
--- a/src/uml/qumlusecase.cpp
+++ b/src/uml/qumlusecase.cpp
@@ -42,11 +42,37 @@
#include "private/qumlusecaseobject_p.h"
+#include <QtUml/QUmlBehavior>
#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlClassifierTemplateParameter>
+#include <QtUml/QUmlCollaborationUse>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlElementImport>
#include <QtUml/QUmlExtend>
#include <QtUml/QUmlExtensionPoint>
+#include <QtUml/QUmlFeature>
+#include <QtUml/QUmlGeneralization>
+#include <QtUml/QUmlGeneralizationSet>
#include <QtUml/QUmlInclude>
-
+#include <QtUml/QUmlInterfaceRealization>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlPackageableElement>
+#include <QtUml/QUmlPackageImport>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlProperty>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlRedefinableTemplateSignature>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlSubstitution>
+#include <QtUml/QUmlTemplateBinding>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlTemplateSignature>
+#include <QtUml/QUmlType>
/*!
\class QUmlUseCase
@@ -68,13 +94,75 @@ QUmlUseCase::~QUmlUseCase()
}
}
+QModelingObject *QUmlUseCase::clone() const
+{
+ QUmlUseCase *c = new QUmlUseCase;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ foreach (QUmlElementImport *element, elementImport())
+ c->addElementImport(dynamic_cast<QUmlElementImport *>(element->clone()));
+ foreach (QUmlConstraint *element, ownedRule())
+ c->addOwnedRule(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlPackageImport *element, packageImport())
+ c->addPackageImport(dynamic_cast<QUmlPackageImport *>(element->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ c->setVisibility(visibility());
+ if (package())
+ c->setPackage(dynamic_cast<QUmlPackage *>(package()->clone()));
+ c->setLeaf(isLeaf());
+ foreach (QUmlTemplateBinding *element, templateBinding())
+ c->addTemplateBinding(dynamic_cast<QUmlTemplateBinding *>(element->clone()));
+ foreach (QUmlCollaborationUse *element, collaborationUse())
+ c->addCollaborationUse(dynamic_cast<QUmlCollaborationUse *>(element->clone()));
+ foreach (QUmlGeneralization *element, generalization())
+ c->addGeneralization(dynamic_cast<QUmlGeneralization *>(element->clone()));
+ c->setAbstract(isAbstract());
+ c->setFinalSpecialization(isFinalSpecialization());
+ if (ownedTemplateSignature())
+ c->setOwnedTemplateSignature(dynamic_cast<QUmlRedefinableTemplateSignature *>(ownedTemplateSignature()->clone()));
+ foreach (QUmlUseCase *element, ownedUseCase())
+ c->addOwnedUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ foreach (QUmlGeneralizationSet *element, powertypeExtent())
+ c->addPowertypeExtent(dynamic_cast<QUmlGeneralizationSet *>(element->clone()));
+ foreach (QUmlClassifier *element, redefinedClassifier())
+ c->addRedefinedClassifier(dynamic_cast<QUmlClassifier *>(element->clone()));
+ if (representation())
+ c->setRepresentation(dynamic_cast<QUmlCollaborationUse *>(representation()->clone()));
+ foreach (QUmlSubstitution *element, substitution())
+ c->addSubstitution(dynamic_cast<QUmlSubstitution *>(element->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlClassifierTemplateParameter *>(templateParameter()->clone()));
+ foreach (QUmlUseCase *element, useCase())
+ c->addUseCase(dynamic_cast<QUmlUseCase *>(element->clone()));
+ if (classifierBehavior())
+ c->setClassifierBehavior(dynamic_cast<QUmlBehavior *>(classifierBehavior()->clone()));
+ foreach (QUmlInterfaceRealization *element, interfaceRealization())
+ c->addInterfaceRealization(dynamic_cast<QUmlInterfaceRealization *>(element->clone()));
+ foreach (QUmlBehavior *element, ownedBehavior())
+ c->addOwnedBehavior(dynamic_cast<QUmlBehavior *>(element->clone()));
+ foreach (QUmlExtend *element, extend())
+ c->addExtend(dynamic_cast<QUmlExtend *>(element->clone()));
+ foreach (QUmlExtensionPoint *element, extensionPoint())
+ c->addExtensionPoint(dynamic_cast<QUmlExtensionPoint *>(element->clone()));
+ foreach (QUmlInclude *element, include())
+ c->addInclude(dynamic_cast<QUmlInclude *>(element->clone()));
+ foreach (QUmlClassifier *element, subject())
+ c->addSubject(dynamic_cast<QUmlClassifier *>(element->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
References the Extend relationships owned by this use case.
*/
-const QSet<QUmlExtend *>
-QUmlUseCase::extend() const
+const QSet<QUmlExtend *> QUmlUseCase::extend() const
{
// This is a read-write association end
@@ -123,8 +211,7 @@ void QUmlUseCase::removeExtend(QUmlExtend *extend)
/*!
References the ExtensionPoints owned by the use case.
*/
-const QSet<QUmlExtensionPoint *>
-QUmlUseCase::extensionPoint() const
+const QSet<QUmlExtensionPoint *> QUmlUseCase::extensionPoint() const
{
// This is a read-write association end
@@ -173,8 +260,7 @@ void QUmlUseCase::removeExtensionPoint(QUmlExtensionPoint *extensionPoint)
/*!
References the Include relationships owned by this use case.
*/
-const QSet<QUmlInclude *>
-QUmlUseCase::include() const
+const QSet<QUmlInclude *> QUmlUseCase::include() const
{
// This is a read-write association end
@@ -223,8 +309,7 @@ void QUmlUseCase::removeInclude(QUmlInclude *include)
/*!
References the subjects to which this use case applies. The subject or its parts realize all the use cases that apply to this subject. Use cases need not be attached to any specific subject, however. The subject may, but need not, own the use cases that apply to it.
*/
-const QSet<QUmlClassifier *>
-QUmlUseCase::subject() const
+const QSet<QUmlClassifier *> QUmlUseCase::subject() const
{
// This is a read-write association end
diff --git a/src/uml/qumlusecase.h b/src/uml/qumlusecase.h
index 593835a1..617048aa 100644
--- a/src/uml/qumlusecase.h
+++ b/src/uml/qumlusecase.h
@@ -63,6 +63,8 @@ public:
explicit QUmlUseCase(bool createQObject = true);
virtual ~QUmlUseCase();
+ QModelingObject *clone() const;
+
// Owned attributes
const QSet<QUmlExtend *> extend() const;
void addExtend(QUmlExtend *extend);
diff --git a/src/uml/qumlvaluepin.cpp b/src/uml/qumlvaluepin.cpp
index 67dbc4ab..b98a2672 100644
--- a/src/uml/qumlvaluepin.cpp
+++ b/src/uml/qumlvaluepin.cpp
@@ -42,8 +42,27 @@
#include "private/qumlvaluepinobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlBehavior>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlMultiplicityElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlState>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlType>
#include <QtUml/QUmlValueSpecification>
-
/*!
\class QUmlValuePin
@@ -67,13 +86,60 @@ QUmlValuePin::~QUmlValuePin()
}
}
+QModelingObject *QUmlValuePin::clone() const
+{
+ QUmlValuePin *c = new QUmlValuePin;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ c->setOrdered(isOrdered());
+ c->setUnique(isUnique());
+ if (lowerValue())
+ c->setLowerValue(dynamic_cast<QUmlValueSpecification *>(lowerValue()->clone()));
+ if (upperValue())
+ c->setUpperValue(dynamic_cast<QUmlValueSpecification *>(upperValue()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ foreach (QUmlState *element, inState())
+ c->addInState(dynamic_cast<QUmlState *>(element->clone()));
+ c->setControlType(isControlType());
+ c->setOrdering(ordering());
+ if (selection())
+ c->setSelection(dynamic_cast<QUmlBehavior *>(selection()->clone()));
+ if (upperBound())
+ c->setUpperBound(dynamic_cast<QUmlValueSpecification *>(upperBound()->clone()));
+ c->setControl(isControl());
+ if (value())
+ c->setValue(dynamic_cast<QUmlValueSpecification *>(value()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Value that the pin will provide.
*/
-QUmlValueSpecification *
-QUmlValuePin::value() const
+QUmlValueSpecification *QUmlValuePin::value() const
{
// This is a read-write association end
diff --git a/src/uml/qumlvaluepin.h b/src/uml/qumlvaluepin.h
index 3ae5f0f5..f020dcb4 100644
--- a/src/uml/qumlvaluepin.h
+++ b/src/uml/qumlvaluepin.h
@@ -60,6 +60,8 @@ public:
explicit QUmlValuePin(bool createQObject = true);
virtual ~QUmlValuePin();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlValueSpecification *value() const;
void setValue(QUmlValueSpecification *value);
diff --git a/src/uml/qumlvaluespecification.cpp b/src/uml/qumlvaluespecification.cpp
index 4a558639..a3e75b4d 100644
--- a/src/uml/qumlvaluespecification.cpp
+++ b/src/uml/qumlvaluespecification.cpp
@@ -40,8 +40,16 @@
****************************************************************************/
#include "qumlvaluespecification.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
#include <QtUml/QUmlParameterableElement>
-
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
/*!
\class QUmlValueSpecification
@@ -57,6 +65,26 @@ QUmlValueSpecification::~QUmlValueSpecification()
{
}
+QModelingObject *QUmlValueSpecification::clone() const
+{
+ QUmlValueSpecification *c = new QUmlValueSpecification;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone()));
+ c->setVisibility(visibility());
+ return c;
+}
+
// OPERATIONS
/*!
diff --git a/src/uml/qumlvaluespecification.h b/src/uml/qumlvaluespecification.h
index ec92a50d..f7c7ebd3 100644
--- a/src/uml/qumlvaluespecification.h
+++ b/src/uml/qumlvaluespecification.h
@@ -60,6 +60,8 @@ class Q_UML_EXPORT QUmlValueSpecification : public QUmlTypedElement, public QUml
public:
virtual ~QUmlValueSpecification();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Operations
bool booleanValue() const;
diff --git a/src/uml/qumlvaluespecificationaction.cpp b/src/uml/qumlvaluespecificationaction.cpp
index 9a17ea94..0c7f08ee 100644
--- a/src/uml/qumlvaluespecificationaction.cpp
+++ b/src/uml/qumlvaluespecificationaction.cpp
@@ -42,9 +42,27 @@
#include "private/qumlvaluespecificationactionobject_p.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
#include <QtUml/QUmlValueSpecification>
-
/*!
\class QUmlValueSpecificationAction
@@ -68,13 +86,52 @@ QUmlValueSpecificationAction::~QUmlValueSpecificationAction()
}
}
+QModelingObject *QUmlValueSpecificationAction::clone() const
+{
+ QUmlValueSpecificationAction *c = new QUmlValueSpecificationAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (result())
+ c->setResult(dynamic_cast<QUmlOutputPin *>(result()->clone()));
+ if (value())
+ c->setValue(dynamic_cast<QUmlValueSpecification *>(value()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Gives the output pin on which the result is put.
*/
-QUmlOutputPin *
-QUmlValueSpecificationAction::result() const
+QUmlOutputPin *QUmlValueSpecificationAction::result() const
{
// This is a read-write association end
@@ -104,8 +161,7 @@ void QUmlValueSpecificationAction::setResult(QUmlOutputPin *result)
/*!
Value specification to be evaluated.
*/
-QUmlValueSpecification *
-QUmlValueSpecificationAction::value() const
+QUmlValueSpecification *QUmlValueSpecificationAction::value() const
{
// This is a read-write association end
diff --git a/src/uml/qumlvaluespecificationaction.h b/src/uml/qumlvaluespecificationaction.h
index 5704f2a8..99ee6a44 100644
--- a/src/uml/qumlvaluespecificationaction.h
+++ b/src/uml/qumlvaluespecificationaction.h
@@ -61,6 +61,8 @@ public:
explicit QUmlValueSpecificationAction(bool createQObject = true);
virtual ~QUmlValueSpecificationAction();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlOutputPin *result() const;
void setResult(QUmlOutputPin *result);
diff --git a/src/uml/qumlvariable.cpp b/src/uml/qumlvariable.cpp
index 557707e3..2d5e71f8 100644
--- a/src/uml/qumlvariable.cpp
+++ b/src/uml/qumlvariable.cpp
@@ -44,8 +44,21 @@
#include <QtUml/QUmlAction>
#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConnectableElementTemplateParameter>
+#include <QtUml/QUmlConnectorEnd>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlMultiplicityElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlParameterableElement>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlStructuredActivityNode>
-
+#include <QtUml/QUmlTemplateParameter>
+#include <QtUml/QUmlType>
+#include <QtUml/QUmlValueSpecification>
/*!
\class QUmlVariable
@@ -69,13 +82,42 @@ QUmlVariable::~QUmlVariable()
}
}
+QModelingObject *QUmlVariable::clone() const
+{
+ QUmlVariable *c = new QUmlVariable;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ c->setOrdered(isOrdered());
+ c->setUnique(isUnique());
+ if (lowerValue())
+ c->setLowerValue(dynamic_cast<QUmlValueSpecification *>(lowerValue()->clone()));
+ if (upperValue())
+ c->setUpperValue(dynamic_cast<QUmlValueSpecification *>(upperValue()->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (type())
+ c->setType(dynamic_cast<QUmlType *>(type()->clone()));
+ if (owningTemplateParameter())
+ c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone()));
+ if (templateParameter())
+ c->setTemplateParameter(dynamic_cast<QUmlConnectableElementTemplateParameter *>(templateParameter()->clone()));
+ if (activityScope())
+ c->setActivityScope(dynamic_cast<QUmlActivity *>(activityScope()->clone()));
+ if (scope())
+ c->setScope(dynamic_cast<QUmlStructuredActivityNode *>(scope()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
An activity that owns the variable.
*/
-QUmlActivity *
-QUmlVariable::activityScope() const
+QUmlActivity *QUmlVariable::activityScope() const
{
// This is a read-write association end
@@ -101,8 +143,7 @@ void QUmlVariable::setActivityScope(QUmlActivity *activityScope)
/*!
A structured activity node that owns the variable.
*/
-QUmlStructuredActivityNode *
-QUmlVariable::scope() const
+QUmlStructuredActivityNode *QUmlVariable::scope() const
{
// This is a read-write association end
diff --git a/src/uml/qumlvariable.h b/src/uml/qumlvariable.h
index 5732d9d2..c053f47c 100644
--- a/src/uml/qumlvariable.h
+++ b/src/uml/qumlvariable.h
@@ -63,6 +63,8 @@ public:
explicit QUmlVariable(bool createQObject = true);
virtual ~QUmlVariable();
+ QModelingObject *clone() const;
+
// Owned attributes
QUmlActivity *activityScope() const;
void setActivityScope(QUmlActivity *activityScope);
diff --git a/src/uml/qumlvariableaction.cpp b/src/uml/qumlvariableaction.cpp
index 6de6b51d..083cacf9 100644
--- a/src/uml/qumlvariableaction.cpp
+++ b/src/uml/qumlvariableaction.cpp
@@ -40,8 +40,27 @@
****************************************************************************/
#include "qumlvariableaction.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
#include <QtUml/QUmlVariable>
-
/*!
\class QUmlVariableAction
@@ -58,13 +77,50 @@ QUmlVariableAction::~QUmlVariableAction()
{
}
+QModelingObject *QUmlVariableAction::clone() const
+{
+ QUmlVariableAction *c = new QUmlVariableAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (variable())
+ c->setVariable(dynamic_cast<QUmlVariable *>(variable()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Variable to be read.
*/
-QUmlVariable *
-QUmlVariableAction::variable() const
+QUmlVariable *QUmlVariableAction::variable() const
{
// This is a read-write association end
diff --git a/src/uml/qumlvariableaction.h b/src/uml/qumlvariableaction.h
index c7bc2a0f..5f48b8d9 100644
--- a/src/uml/qumlvariableaction.h
+++ b/src/uml/qumlvariableaction.h
@@ -59,6 +59,8 @@ class Q_UML_EXPORT QUmlVariableAction : public QUmlAction
public:
virtual ~QUmlVariableAction();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QUmlVariable *variable() const;
void setVariable(QUmlVariable *variable);
diff --git a/src/uml/qumlvertex.cpp b/src/uml/qumlvertex.cpp
index ead5585b..16fea4ad 100644
--- a/src/uml/qumlvertex.cpp
+++ b/src/uml/qumlvertex.cpp
@@ -40,10 +40,16 @@
****************************************************************************/
#include "qumlvertex.h"
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlPackage>
#include <QtUml/QUmlRegion>
#include <QtUml/QUmlStateMachine>
+#include <QtUml/QUmlStringExpression>
#include <QtUml/QUmlTransition>
-
/*!
\class QUmlVertex
@@ -60,13 +66,28 @@ QUmlVertex::~QUmlVertex()
{
}
+QModelingObject *QUmlVertex::clone() const
+{
+ QUmlVertex *c = new QUmlVertex;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ if (container())
+ c->setContainer(dynamic_cast<QUmlRegion *>(container()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
The region that contains this vertex.
*/
-QUmlRegion *
-QUmlVertex::container() const
+QUmlRegion *QUmlVertex::container() const
{
// This is a read-write association end
@@ -92,8 +113,7 @@ void QUmlVertex::setContainer(QUmlRegion *container)
/*!
Specifies the transitions entering this vertex.
*/
-const QSet<QUmlTransition *>
-QUmlVertex::incoming() const
+const QSet<QUmlTransition *> QUmlVertex::incoming() const
{
// This is a read-only derived association end
@@ -139,8 +159,7 @@ void QUmlVertex::removeIncoming(QUmlTransition *incoming)
/*!
Specifies the transitions departing from this vertex.
*/
-const QSet<QUmlTransition *>
-QUmlVertex::outgoing() const
+const QSet<QUmlTransition *> QUmlVertex::outgoing() const
{
// This is a read-only derived association end
diff --git a/src/uml/qumlvertex.h b/src/uml/qumlvertex.h
index f70a6950..c868472e 100644
--- a/src/uml/qumlvertex.h
+++ b/src/uml/qumlvertex.h
@@ -61,6 +61,8 @@ class Q_UML_EXPORT QUmlVertex : public virtual QUmlNamedElement
public:
virtual ~QUmlVertex();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QUmlRegion *container() const;
void setContainer(QUmlRegion *container);
diff --git a/src/uml/qumlwritelinkaction.cpp b/src/uml/qumlwritelinkaction.cpp
index e8c89df6..bb24ef5e 100644
--- a/src/uml/qumlwritelinkaction.cpp
+++ b/src/uml/qumlwritelinkaction.cpp
@@ -40,6 +40,28 @@
****************************************************************************/
#include "qumlwritelinkaction.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlAssociation>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
+#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlLinkEndData>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlWriteLinkAction
@@ -55,3 +77,43 @@ QUmlWriteLinkAction::~QUmlWriteLinkAction()
{
}
+QModelingObject *QUmlWriteLinkAction::clone() const
+{
+ QUmlWriteLinkAction *c = new QUmlWriteLinkAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlLinkEndData *element, endData())
+ c->addEndData(dynamic_cast<QUmlLinkEndData *>(element->clone()));
+ foreach (QUmlInputPin *element, inputValue())
+ c->addInputValue(dynamic_cast<QUmlInputPin *>(element->clone()));
+ return c;
+}
+
diff --git a/src/uml/qumlwritelinkaction.h b/src/uml/qumlwritelinkaction.h
index 8f16e2a6..b1b92167 100644
--- a/src/uml/qumlwritelinkaction.h
+++ b/src/uml/qumlwritelinkaction.h
@@ -57,6 +57,8 @@ class Q_UML_EXPORT QUmlWriteLinkAction : public QUmlLinkAction
public:
virtual ~QUmlWriteLinkAction();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
protected:
explicit QUmlWriteLinkAction();
diff --git a/src/uml/qumlwritestructuralfeatureaction.cpp b/src/uml/qumlwritestructuralfeatureaction.cpp
index 437e54ab..17d483fe 100644
--- a/src/uml/qumlwritestructuralfeatureaction.cpp
+++ b/src/uml/qumlwritestructuralfeatureaction.cpp
@@ -40,9 +40,27 @@
****************************************************************************/
#include "qumlwritestructuralfeatureaction.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
#include <QtUml/QUmlOutputPin>
-
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuralFeature>
+#include <QtUml/QUmlStructuredActivityNode>
/*!
\class QUmlWriteStructuralFeatureAction
@@ -60,13 +78,56 @@ QUmlWriteStructuralFeatureAction::~QUmlWriteStructuralFeatureAction()
{
}
+QModelingObject *QUmlWriteStructuralFeatureAction::clone() const
+{
+ QUmlWriteStructuralFeatureAction *c = new QUmlWriteStructuralFeatureAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (object())
+ c->setObject(dynamic_cast<QUmlInputPin *>(object()->clone()));
+ if (structuralFeature())
+ c->setStructuralFeature(dynamic_cast<QUmlStructuralFeature *>(structuralFeature()->clone()));
+ if (result())
+ c->setResult(dynamic_cast<QUmlOutputPin *>(result()->clone()));
+ if (value())
+ c->setValue(dynamic_cast<QUmlInputPin *>(value()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Gives the output pin on which the result is put.
*/
-QUmlOutputPin *
-QUmlWriteStructuralFeatureAction::result() const
+QUmlOutputPin *QUmlWriteStructuralFeatureAction::result() const
{
// This is a read-write association end
@@ -96,8 +157,7 @@ void QUmlWriteStructuralFeatureAction::setResult(QUmlOutputPin *result)
/*!
Value to be added or removed from the structural feature.
*/
-QUmlInputPin *
-QUmlWriteStructuralFeatureAction::value() const
+QUmlInputPin *QUmlWriteStructuralFeatureAction::value() const
{
// This is a read-write association end
diff --git a/src/uml/qumlwritestructuralfeatureaction.h b/src/uml/qumlwritestructuralfeatureaction.h
index 341e15fe..09110188 100644
--- a/src/uml/qumlwritestructuralfeatureaction.h
+++ b/src/uml/qumlwritestructuralfeatureaction.h
@@ -60,6 +60,8 @@ class Q_UML_EXPORT QUmlWriteStructuralFeatureAction : public QUmlStructuralFeatu
public:
virtual ~QUmlWriteStructuralFeatureAction();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QUmlOutputPin *result() const;
void setResult(QUmlOutputPin *result);
diff --git a/src/uml/qumlwritevariableaction.cpp b/src/uml/qumlwritevariableaction.cpp
index b7f843d5..f5793c1b 100644
--- a/src/uml/qumlwritevariableaction.cpp
+++ b/src/uml/qumlwritevariableaction.cpp
@@ -40,8 +40,27 @@
****************************************************************************/
#include "qumlwritevariableaction.h"
+#include <QtUml/QUmlActivity>
+#include <QtUml/QUmlActivityEdge>
+#include <QtUml/QUmlActivityGroup>
+#include <QtUml/QUmlActivityNode>
+#include <QtUml/QUmlActivityPartition>
+#include <QtUml/QUmlClassifier>
+#include <QtUml/QUmlComment>
+#include <QtUml/QUmlConstraint>
+#include <QtUml/QUmlDependency>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlExceptionHandler>
#include <QtUml/QUmlInputPin>
-
+#include <QtUml/QUmlInterruptibleActivityRegion>
+#include <QtUml/QUmlNamedElement>
+#include <QtUml/QUmlNamespace>
+#include <QtUml/QUmlOutputPin>
+#include <QtUml/QUmlPackage>
+#include <QtUml/QUmlRedefinableElement>
+#include <QtUml/QUmlStringExpression>
+#include <QtUml/QUmlStructuredActivityNode>
+#include <QtUml/QUmlVariable>
/*!
\class QUmlWriteVariableAction
@@ -58,13 +77,52 @@ QUmlWriteVariableAction::~QUmlWriteVariableAction()
{
}
+QModelingObject *QUmlWriteVariableAction::clone() const
+{
+ QUmlWriteVariableAction *c = new QUmlWriteVariableAction;
+ foreach (QUmlComment *element, ownedComment())
+ c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone()));
+ foreach (QUmlDependency *element, clientDependency())
+ c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone()));
+ c->setName(name());
+ if (nameExpression())
+ c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone()));
+ c->setVisibility(visibility());
+ c->setLeaf(isLeaf());
+ if (activity())
+ c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone()));
+ foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion())
+ c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone()));
+ foreach (QUmlActivityPartition *element, inPartition())
+ c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone()));
+ if (inStructuredNode())
+ c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone()));
+ foreach (QUmlActivityEdge *element, incoming())
+ c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityEdge *element, outgoing())
+ c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone()));
+ foreach (QUmlActivityNode *element, redefinedNode())
+ c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone()));
+ foreach (QUmlExceptionHandler *element, handler())
+ c->addHandler(dynamic_cast<QUmlExceptionHandler *>(element->clone()));
+ c->setLocallyReentrant(isLocallyReentrant());
+ foreach (QUmlConstraint *element, localPostcondition())
+ c->addLocalPostcondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ foreach (QUmlConstraint *element, localPrecondition())
+ c->addLocalPrecondition(dynamic_cast<QUmlConstraint *>(element->clone()));
+ if (variable())
+ c->setVariable(dynamic_cast<QUmlVariable *>(variable()->clone()));
+ if (value())
+ c->setValue(dynamic_cast<QUmlInputPin *>(value()->clone()));
+ return c;
+}
+
// OWNED ATTRIBUTES
/*!
Value to be added or removed from the variable.
*/
-QUmlInputPin *
-QUmlWriteVariableAction::value() const
+QUmlInputPin *QUmlWriteVariableAction::value() const
{
// This is a read-write association end
diff --git a/src/uml/qumlwritevariableaction.h b/src/uml/qumlwritevariableaction.h
index 0dc9d2ab..e9c95492 100644
--- a/src/uml/qumlwritevariableaction.h
+++ b/src/uml/qumlwritevariableaction.h
@@ -59,6 +59,8 @@ class Q_UML_EXPORT QUmlWriteVariableAction : public QUmlVariableAction
public:
virtual ~QUmlWriteVariableAction();
+ Q_DECL_HIDDEN QModelingObject *clone() const;
+
// Owned attributes
QUmlInputPin *value() const;
void setValue(QUmlInputPin *value);
diff --git a/src/uml/uml.pro b/src/uml/uml.pro
index 26b526ac..1ca93deb 100644
--- a/src/uml/uml.pro
+++ b/src/uml/uml.pro
@@ -9,4 +9,4 @@ load(qt_module)
include(uml.pri)
-HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS
+HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS \ No newline at end of file