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

« back to all changes in this revision

Viewing changes to src/sd/fv/dcfgraph.c

  • 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
//
 
3
// This file is part of Toolkit for Conceptual Modeling (TCM).
 
4
// (c) copyright 1995, Vrije Universiteit Amsterdam.
 
5
// Author: Frank Dehne (frank@cs.vu.nl).
 
6
//
 
7
// TCM is free software; you can redistribute it and/or modify
 
8
// it under the terms of the GNU General Public License as published by
 
9
// the Free Software Foundation; either version 2 of the License, or
 
10
// (at your option) any later version.
 
11
//
 
12
// TCM is distributed in the hope that it will be useful,
 
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
// GNU General Public License for more details.
 
16
//
 
17
// You should have received a copy of the GNU General Public License
 
18
// along with TCM; if not, write to the Free Software
 
19
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
20
// 02111-1307, USA.
 
21
////////////////////////////////////////////////////////////////////////////////
 
22
#include "dcfgraph.h"
 
23
#include "code.h"
 
24
 
 
25
DCFGraph::DCFGraph(): DFGraph() {
 
26
        int i=0;
 
27
        int j=0;
 
28
        nodeTypes[i++] = Code::COMMENT;
 
29
        nodeTypes[i++] = Code::DATA_PROCESS;
 
30
        nodeTypes[i++] = Code::CONTROL_PROCESS;
 
31
        nodeTypes[i++] = Code::DATA_STORE;
 
32
        nodeTypes[i++] = Code::EVENT_STORE;
 
33
        nodeTypes[i++] = Code::EXTERNAL_ENTITY;
 
34
        nodeTypes[i++] = Code::SPLIT_MERGE_NODE;
 
35
        nodeTypes[i++] = 0;
 
36
 
 
37
        edgeTypes[j++] = Code::DATA_FLOW;
 
38
        edgeTypes[j++] = Code::BIDIRECTIONAL_DATA_FLOW;
 
39
        edgeTypes[j++] = Code::CONTINUOUS_DATA_FLOW;
 
40
        edgeTypes[j++] = Code::EVENT_FLOW;
 
41
        edgeTypes[j++] = Code::CONTINUOUS_EVENT_FLOW;
 
42
        edgeTypes[j++] = 0;
 
43
}
 
44
 
 
45
void DCFGraph::InitConnections() {
 
46
        int DP=Code::GetIndex(Code::DATA_PROCESS, nodeTypes);   
 
47
        int DS=Code::GetIndex(Code::DATA_STORE, nodeTypes);
 
48
        int EE=Code::GetIndex(Code::EXTERNAL_ENTITY, nodeTypes);
 
49
        int SN=Code::GetIndex(Code::SPLIT_MERGE_NODE, nodeTypes);
 
50
        int CP=Code::GetIndex(Code::CONTROL_PROCESS, nodeTypes);
 
51
        int ES=Code::GetIndex(Code::EVENT_STORE, nodeTypes);
 
52
 
 
53
        int DD=Code::GetIndex(Code::DATA_FLOW, edgeTypes);
 
54
        int BD=Code::GetIndex(Code::BIDIRECTIONAL_DATA_FLOW, edgeTypes);
 
55
        int CD=Code::GetIndex(Code::CONTINUOUS_DATA_FLOW, edgeTypes);
 
56
        int DE=Code::GetIndex(Code::EVENT_FLOW, edgeTypes);
 
57
        int CE=Code::GetIndex(Code::CONTINUOUS_EVENT_FLOW, edgeTypes);
 
58
 
 
59
        connections[EE][EE][DD] = True;
 
60
        connections[EE][EE][BD] = True;
 
61
        connections[EE][EE][CD] = True;
 
62
 
 
63
        connections[EE][DP][DD] = True;
 
64
        connections[EE][DP][DE] = True;
 
65
        connections[EE][DP][CD] = True;
 
66
        connections[EE][DP][CE] = True;
 
67
 
 
68
        connections[EE][CP][DE] = True;
 
69
        connections[EE][CP][CE] = True;
 
70
 
 
71
        connections[DP][EE][DD] = True;
 
72
        connections[DP][EE][DE] = True;
 
73
        connections[DP][EE][CD] = True;
 
74
        connections[DP][EE][CE] = True;
 
75
 
 
76
        connections[DP][DP][DD] = True;
 
77
        connections[DP][DP][DE] = True;
 
78
        connections[DP][DP][CD] = True;
 
79
        connections[DP][DP][CE] = True;
 
80
 
 
81
        connections[DP][CP][DE] = True;
 
82
        connections[DP][CP][CE] = True;
 
83
 
 
84
        connections[DP][DS][DD] = True;
 
85
        connections[DP][DS][BD] = True;
 
86
        connections[DP][DS][CD] = True;
 
87
 
 
88
        connections[DP][SN][DD] = True;
 
89
        connections[DP][SN][CD] = True;
 
90
 
 
91
        connections[CP][EE][DE] = True;
 
92
        connections[CP][EE][CE] = True;
 
93
 
 
94
        connections[CP][DP][DE] = True;
 
95
 
 
96
        connections[CP][CP][DE] = True;
 
97
        connections[CP][CP][CE] = True;
 
98
 
 
99
        connections[CP][ES][DE] = True;
 
100
        connections[CP][ES][CE] = True;
 
101
 
 
102
        connections[DS][DP][DD] = True;
 
103
        connections[DS][DP][CD] = True;
 
104
        connections[DS][DP][BD] = True;
 
105
 
 
106
        connections[ES][CP][DE] = True;
 
107
        connections[ES][CP][CE] = True;
 
108
 
 
109
        connections[SN][DP][DD] = True;
 
110
        connections[SN][DP][CD] = True;
 
111
}