




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
25五月20231第六讲:SDL中面向对象概念25五月20232SDL中的类typeinstantiatesasspecializesasparameterizedtypedefinitionwithsomecontextparametersboundiswithallcontextparametersboundisparameterizesasinstanceimpliedtype25五月20233代理类——代理类的定义(1)<agenttypediagram>::=<systemtypediagram>|<blocktypediagram>|<processtypediagram><systemtypediagram>::=<framesymbol>contains
{<systemtypeheading><agenttypediagramcontent>}[isassociatedwith<packageusearea>]<systemtypeheading>::=systemtype[<qualifier>]<systemtypename><agenttypeadditionalheading>25五月20234代理类——代理类的定义(2)<blocktypediagram>::=<framesymbol>contains
{<blocktypeheading><agenttypediagramcontent>}
isconnectedto{{<gateondiagram>*}set}[isassociatedwith<packageusearea>]<blocktypeheading>::=<typepreamble>
blocktype[<qualifier>]<blocktypename><agenttypeadditionalheading><typepreamble>::=[<virtuality>|<abstract>]<virtuality>::=virtual|redefined|finalized<abstract>::=abstract25五月20235代理类——代理类的定义(3)<processtypediagram>::=<framesymbol>contains
{<processtypeheading><agenttypediagramcontent>}
isconnectedto{{<gateondiagram>*}set}[isassociatedwith<packageusearea>]<processtypeheading>::=<typepreamble>
processtype[<qualifier>]<processtypename><agenttypeadditionalheading>25五月20236代理类——代理类的定义(4)<agenttypeadditionalheading>::=[<formalcontextparameters>][virtualityconstraint]<agentadditionalheading><virtualityconstraint>::=atleast<identifier><agentadditionalheading>::=[<specialization>][<agentformalparameters>]<specialization>::=inherits<typeexpression>[adding]<agentformalparameters>::=(<parametersofsort>{,<parametersofsort>}*)<parametersofsort>::=<variablename>{,<variablename>}*<sort>25五月20237processtypeGame(playerPid)GameidtoplayerevendclcountInteger:=01(3)ProbeResultEndGameg1GameidWin,LoseScoreg2Gameoverg3进程类定义Gate定义信号列表25五月20238processtypeGame(playerPid)2(3)Probe,Result,EndGameg1Gameid,Win,Lose,Scoreg2g3Gameovercount:=count+1-evennoneLosetoplayerProbeProbenoneevenWintoplayeroddcount:=count-1-25五月20239processtypeGame(playerPid)3(3)Probe,Result,EndGameg1Gameid,Win,Lose,Scoreg2g3GameoverGameover(player)*ResultEndGameScore(count)toplayer-25五月202310代理类的实例化systemDemongamesignalNewgame,Probe,Result,Endgame,Gameid,Win,Lose,Score(Integer)GameservermsginmsgoutNewGame,Probe,EndGameResult,GameidWin,ScoreLose,25五月202311blockGameserversignalGameover(Pid)GameMonitor(1,1)g3
Games(0,):Gameg1g2Gameid,Win,Lose,ScoreNewgameR1R4R3GameoverProbe,Result,EndgameR2引用进程类实例化Gate与信道相连msginmsgout25五月202312类的参数化形式化上下文参数定义
<formalcontextparameters>::=<contextparametersstart><formalcontextparameterlist><contextparametersend><contextparametersstart>::=<lessthansign><contextparametersend>::=<greaterthansign><formalcontextparameterlist>::=<formalcontextparameter>{<end><formalcontextparameter>}*25五月202313<formalcontextparameter>::=<agentcontextparameter>|<procedurecontextparameter>|<remoterprocedurecontextparameter>|<signalcontextparameter>|<variablecontextparameter>|<timercontextparameter>|…<agentcontextparameter>::={process|block}<agentname>[<agentconstraint>]<agentconstraint>::={atleast|<colon>}<agenttypeidentifier>|<agentsignature><agentsignature>::=<sortlist>25五月202314processtypeMonitor<processLog>EventtoLogblockB1MonitorLogP1Monitors:Monitor<logP1>g1ToLog[Event]ToMon[..][..]C125五月202315类的特例化(继承)<specialization>::=inherits<typeexpression>[adding]<typeexpression>::=<basetype>[<actualcontextparameters>]<basetype>::=<identifier>25五月202316blocktypeSpeakingGameServerinheritsGameserveradding
Gamesg2LoadSpeakerR3R4[Gameid,Win,Lose,Score,voiceWin,voiceLose]mo[voiceWin,voiceLose]子类中添加进程25五月202317processtypeSpecialGameinheritsGameadding
g4[Evil]Evil-evenEvilevenodd子类中增加迁移25五月202318类中的虚定义(virtual)processtypeGame(playerPid)2(3)evennoneoddcount:=count+1-WintoplayernoneevenProbe,Result,EndGameg1Gameid,Win,Lose,Scoreg2g3GameoverLosetoplayerProbevirtualProbevirtualcount:=count-1-25五月202319processtypeOppositeGameinheritsGame1(1)oddcount:=count-1-LosetoplayerProberedefinedevencount:=count+1-WintoplayerProberedefined25五月202320虚定义可以应用在下列符号中:进程开始符过程开始符连续信号优先输入自发输入远端过程输入25五月202321SDL中的选择域usesig_packagesynonymnotATMonlyBoolean=external;systembankSystemBankHeadQuarterBankHeadQuarterATMC1[card,code,amount][cash,receipt,(failure)]C2[transactOK,transactNOK,(failure)][
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 图书管理员全员阅读推广试题及答案
- 2024年消防设施认证试题及答案
- 2025年精密模具采购合同协议样本
- 学校操场运动器材的保养与清洁
- 2025建筑工程租赁合同模板
- 学院专业教育与创新人才培养
- 2025官方版居间服务合同范本
- 多设备互通性的的统一管理系统的实现方案与实验
- 2025委托聘用合同书
- 企业形象塑造与宣传推广
- 2023年全国中学生生物学联赛试题及详细解析
- 【MOOC】电子线路设计、测试与实验(二)-华中科技大学 中国大学慕课MOOC答案
- 兴业银行个人助学贷款协议
- 医院依法执业培训课件
- 2024年煤矿安全管理人员(掘进班组长)考试题库(浓缩500题)
- 人教版小学数学四年级下册第一单元测试卷附答案(共9套)
- 生物合成薄荷酮的新途径
- 四年级语文国测复习试题有答案
- 一年级道德与法治下册 第四单元 我们在一起 16 大家一起来教案 新人教版
- 天燃气工程管道施工组织设计及方案2
- 陕西省2024年中考英语真题(A)【附真题答案】
评论
0/150
提交评论