1
//////////////////////////////////////////////////////////////////////////////////
2
// This file is part of Toolkit for Conceptual Modeling (TCM).
3
// (c) copyright 2001, Universiteit Twente.
4
// Author: Rik Eshuis (eshuis@cs.utwente.nl).
6
// TCM is free software; you can redistribute it and/or modify
7
// it under the terms of the GNU General Public License as published by
8
// the Free Software Foundation; either version 2 of the License, or
9
// (at your option) any later version.
11
// TCM is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
// GNU General Public License for more details.
16
// You should have received a copy of the GNU General Public License
17
// along with TCM; if not, write to the Free Software
18
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20
////////////////////////////////////////////////////////////////////////////////
21
#ifndef _ADSHYPEREDGE_H
22
#define _ADSHYPEREDGE_H
24
#include "hyperedge.h"
26
#include "adsclockconstraint.h"
34
/// Graph activity machine hyper edge class
35
class ADSHyperEdge: public HyperEdge {
36
/*@Doc: {\large {\bf scope:} diagram} */
39
ADSHyperEdge(ADSHyperGraph *a) : HyperEdge((HyperGraph *)a){cc=0;sendevent=NULL;internal=False;};
41
ADSHyperEdge(ADSHyperGraph *a, Edge *e);
43
bool AddProp(Prop *p);
45
bool AddVar(ADSVar *v);
47
bool refersto(ADSVar *v){return varl.contains(v);};
49
void GetPropList(List <Prop *> &p);
51
void GetVarList(List <ADSVar *> &v);
53
void SetClockConstraint(ClockConstraint *);
55
ClockConstraint *GetClockConstraint();
57
bool hasClockConstraint();
59
void WriteMembers(OutputFile *f);
63
void AddEdges(List <Subject *> l);
65
void GetEdges(List <Subject *> *l);
67
void AddConflict(ADSHyperEdge *ah){conflict.add(ah);}
69
void GetConflict(List <ADSHyperEdge *> *al){*al=conflict;}
71
bool conflicts(ADSHyperEdge *);
75
bool inpredicaterefersto(Subject *n){return (inlist.contains(n)||notinlist.contains(n));}
77
void AddInNode(Subject *n){if (!inlist.contains(n)) inlist.add(n);}
79
void GetInNodes(List <Subject *> *nl){*nl=inlist;}
81
void AddNotInNode(Subject *n){if (!notinlist.contains(n)) notinlist.add(n);}
83
void GetNotInNodes(List <Subject *> *nl){*nl=notinlist;}
85
void SetSendEvent(Prop *p){sendevent=p;}
87
Prop *GetSendEvent(){return sendevent;}
89
void SetInternal(){internal=True;}
91
bool GetInternal(){return internal;}
93
string GetUniqueName();
102
/// list of nodes tested with `in' predicate
103
List <Subject *> inlist;
104
/// list of nodes tested with `not in' predicate
105
List <Subject *> notinlist;
107
List <Subject *> edgelist;
109
List <ADSHyperEdge *> conflict;
112
/// true if triggered by internal event