//////////////////////////////////////////////////////////////////////////////// // // This file is part of Toolkit for Conceptual Modeling (TCM). // (c) copyright 1996, Vrije Universiteit Amsterdam. // Author: Frank Dehne (frank@cs.vu.nl). // // TCM is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // TCM is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with TCM; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. //////////////////////////////////////////////////////////////////////////////// #include "scdtransitionedge.h" #include "scgraph.h" #include "inputfile.h" #include "outputfile.h" #include "error.h" #include "adsproperty.h" #include "scnode.h" SCDTransitionEdge::SCDTransitionEdge(SCGraph *g, Subject *n1, Subject *n2) :Edge(g, n1, n2) { SetDirected(True); sendevent=0; cc=0; label=""; } string SCDTransitionEdge::GetLabel(){ return label; } void SCDTransitionEdge::SetLabel(string s){ label=s; } string SCDTransitionEdge::GetEvent(){ string txt=""; unsigned i=0; while (i &p){ p=propl; } void SCDTransitionEdge::SetClockConstraint(ClockConstraint *c){ cc=c; } ClockConstraint *SCDTransitionEdge::GetClockConstraint(){ return cc; } bool SCDTransitionEdge::hasClockConstraint(){ return (cc!=0); } string SCDTransitionEdge::GetUniqueName(){ string str="HE_"; string hid=(unsigned int)GetId(); return str+hid; } SCNode *SCDTransitionEdge::GetScope(){ if (!GetSubject1()->GetParent()) return 0; List scnodes; GetGraph()->GetNodes((List *)&scnodes); SCNode *scope=0; for (scnodes.first();!scnodes.done();scnodes.next()){ if (scnodes.cur()->GetClassType()==Code::SCD_OR_STATE){ if (((SCNode *)(GetSubject1()))->isancestor(scnodes.cur()) && (((SCNode * )GetSubject2())->isancestor(scnodes.cur()))){ if (scope){ if (scnodes.cur()->isancestor(scope)){ scope=scnodes.cur(); } } else scope=scnodes.cur(); } } } return scope; }