~ubuntu-branches/ubuntu/intrepid/tcm/intrepid

« back to all changes in this revision

Viewing changes to src/sd/bv/adshyperedge.h

  • Committer: Bazaar Package Importer
  • Author(s): Otavio Salvador
  • Date: 2003-07-03 20:08:21 UTC
  • Revision ID: james.westby@ubuntu.com-20030703200821-se4xtqx25e5miczi
Tags: upstream-2.20
ImportĀ upstreamĀ versionĀ 2.20

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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).
 
5
//
 
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.
 
10
//
 
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.
 
15
//
 
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
 
19
// 02111-1307, USA.
 
20
////////////////////////////////////////////////////////////////////////////////
 
21
#ifndef _ADSHYPEREDGE_H
 
22
#define _ADSHYPEREDGE_H
 
23
 
 
24
#include "hyperedge.h"
 
25
#include "llist.h"
 
26
#include "adsclockconstraint.h"
 
27
#include <stdlib.h>
 
28
 
 
29
class Prop;
 
30
class ADSVar;
 
31
class OutputFile;
 
32
class ADSHyperGraph;
 
33
 
 
34
/// Graph activity machine hyper edge class
 
35
class ADSHyperEdge: public HyperEdge {
 
36
/*@Doc: {\large {\bf scope:} diagram} */
 
37
public:
 
38
     ///
 
39
     ADSHyperEdge(ADSHyperGraph *a) : HyperEdge((HyperGraph *)a){cc=0;sendevent=NULL;internal=False;};
 
40
     ///
 
41
     ADSHyperEdge(ADSHyperGraph *a, Edge *e);
 
42
     ///
 
43
     bool AddProp(Prop *p);
 
44
     ///
 
45
     bool AddVar(ADSVar *v);
 
46
     ///
 
47
     bool refersto(ADSVar *v){return varl.contains(v);};
 
48
     ///
 
49
     void GetPropList(List <Prop *> &p);
 
50
     ///
 
51
     void GetVarList(List <ADSVar *> &v);
 
52
     ///
 
53
     void SetClockConstraint(ClockConstraint *);
 
54
     ///
 
55
     ClockConstraint *GetClockConstraint();
 
56
     ///
 
57
     bool hasClockConstraint();
 
58
     ///
 
59
     void WriteMembers(OutputFile *f);
 
60
     ///
 
61
     void WriteScreen();
 
62
     ///
 
63
     void AddEdges(List <Subject *> l);
 
64
     ///
 
65
     void GetEdges(List <Subject *> *l);
 
66
     /// 
 
67
     void AddConflict(ADSHyperEdge *ah){conflict.add(ah);}
 
68
     ///
 
69
     void GetConflict(List <ADSHyperEdge *> *al){*al=conflict;}
 
70
     ///
 
71
     bool conflicts(ADSHyperEdge *);
 
72
     ///
 
73
     bool isconflicting();
 
74
     ///
 
75
     bool inpredicaterefersto(Subject *n){return (inlist.contains(n)||notinlist.contains(n));}
 
76
     /// 
 
77
     void AddInNode(Subject *n){if (!inlist.contains(n)) inlist.add(n);}
 
78
     ///
 
79
     void GetInNodes(List <Subject *> *nl){*nl=inlist;}
 
80
     /// 
 
81
     void AddNotInNode(Subject *n){if (!notinlist.contains(n)) notinlist.add(n);}
 
82
     ///
 
83
     void GetNotInNodes(List <Subject *> *nl){*nl=notinlist;}
 
84
     ///
 
85
     void SetSendEvent(Prop *p){sendevent=p;}
 
86
     ///
 
87
     Prop *GetSendEvent(){return sendevent;}
 
88
     ///
 
89
     void SetInternal(){internal=True;}
 
90
     ///
 
91
     bool GetInternal(){return internal;}
 
92
     ///
 
93
     string GetUniqueName();
 
94
 
 
95
private:
 
96
     ///
 
97
     List <Prop *> propl;
 
98
     ///
 
99
     List <ADSVar *>  varl;
 
100
     ///
 
101
     ClockConstraint *cc;
 
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;
 
106
     ///
 
107
     List <Subject *> edgelist; 
 
108
     ///
 
109
     List <ADSHyperEdge *> conflict;
 
110
     ///
 
111
     Prop *sendevent;
 
112
     /// true if triggered by internal event
 
113
     bool internal;
 
114
};
 
115
 
 
116
#endif