cxx_graph.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00102 #ifndef cxx_graph_INCLUDED
00103 #define cxx_graph_INCLUDED "cxx_graph.h"
00104
00105 #ifdef _KEEP_RCS_ID
00106 #endif
00107
00108 #ifndef defs_INCLUDED
00109 #include "defs.h"
00110 #endif
00111 #ifndef cxx_graph_i_INCLUDED
00112 #include "cxx_graph.i"
00113 #endif
00114 #ifndef graph_template_INCLUDED
00115 #include "graph_template.h"
00116 #endif
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131 class VERTEX16 {
00132 friend class DIRECTED_GRAPH16<class EDGE16, class VERTEX16>;
00133 friend class DIRECTED_GRAPH16<class ARRAY_EDGE16,class ARRAY_VERTEX16>;
00134 friend class DIRECTED_GRAPH16<class LAT_EDGE16,class LAT_VERTEX16>;
00135 friend class DIRECTED_GRAPH16<class TEDGE,class TVERTEX>;
00136 friend class DIRECTED_GRAPH16<class FB_EDGE, class FB_NODE>;
00137 private:
00138 EINDEX16 _from;
00139
00140 EINDEX16 _to;
00141
00142
00143
00144 VERTEX16(const VERTEX16&);
00145
00146 protected:
00147 void Set_Next_Free_Vertex(VINDEX16 i){ _from = i; }
00148 void Set_To_Free() { _to = INVALID_VINDEX16; }
00149 BOOL Is_Free() const { return _to == INVALID_VINDEX16; }
00150 VINDEX16 Get_Next_Free_Vertex() const { return _from; }
00151 void Set_Out_Edge(EINDEX16 i) { _from = i; }
00152 void Set_In_Edge(EINDEX16 i) { _to = i; }
00153
00154 public:
00155 VERTEX16() { _from = 0; _to = 0; }
00156 ~VERTEX16() {};
00157
00158 VERTEX16& operator = (const VERTEX16&);
00159
00160 EINDEX16 Get_In_Edge() const { return _to; }
00161
00162 EINDEX16 Get_Out_Edge() const { return _from; }
00163
00164 };
00165
00166 class EDGE16 {
00167 friend class DIRECTED_GRAPH16<class EDGE16,class VERTEX16>;
00168 friend class DIRECTED_GRAPH16<class ARRAY_EDGE16,class ARRAY_VERTEX16>;
00169 friend class DIRECTED_GRAPH16<class LAT_EDGE16,class LAT_VERTEX16>;
00170 friend class DIRECTED_GRAPH16<class TEDGE,class TVERTEX>;
00171 friend class DIRECTED_GRAPH16<class FB_EDGE, class FB_NODE>;
00172 friend class SCC_DIRECTED_GRAPH16;
00173 private:
00174
00175 VINDEX16 _from;
00176 VINDEX16 _to;
00177 EINDEX16 _nfrom;
00178 EINDEX16 _nto;
00179
00180 EDGE16(const EDGE16&);
00181
00182 protected:
00183 void Set_Source(VINDEX16 i) { _from = i; }
00184 void Set_Sink(VINDEX16 i) { _to = i; }
00185 void Set_Next_Out_Edge(EINDEX16 i) { _nfrom = i; }
00186 void Set_Next_In_Edge(EINDEX16 i) { _nto = i; }
00187 void Set_Next_Free_Edge(EINDEX16 i) { _from = i; }
00188 void Set_To_Free() { _to = INVALID_VINDEX16; }
00189 BOOL Is_Free() const { return _to == INVALID_VINDEX16; }
00190 VINDEX16 Get_Next_Free_Edge() const { return _from; }
00191 EINDEX16 Get_Next_Out_Edge() const { return _nfrom; }
00192 EINDEX16 Get_Next_In_Edge() const { return _nto; }
00193 public:
00194 EDGE16() { _from=_to=_nfrom=_nto=0; }
00195 ~EDGE16() {}
00196
00197 EDGE16& operator = (const EDGE16&);
00198
00199 VINDEX16 Get_Source() const { return _from; }
00200 VINDEX16 Get_Sink() const { return _to; }
00201 };
00202
00203 #endif // cxx_graph_INCLUDED
00204