author | marci |
Wed, 04 Feb 2004 12:59:17 +0000 | |
changeset 60 | 89d2ce014e12 |
parent 56 | 6f1cdec3949d |
child 61 | 30e734e6adff |
permissions | -rw-r--r-- |
alpar@52 | 1 |
// -*-mode: c++; -*- |
alpar@52 | 2 |
|
alpar@52 | 3 |
class Graph |
alpar@52 | 4 |
{ |
alpar@52 | 5 |
public: |
alpar@52 | 6 |
class EdgeIt {}; |
alpar@52 | 7 |
|
alpar@52 | 8 |
class InEdgeIt : public EdgeIt |
alpar@52 | 9 |
class OutEdgeIt : public EdgeIt {}; |
alpar@52 | 10 |
class SymEdgeIt : public EdgeIt {}; |
alpar@52 | 11 |
class EachEdgeIt : public EdgeIt {}; |
alpar@52 | 12 |
|
alpar@52 | 13 |
class NodeIt {}; |
alpar@52 | 14 |
|
alpar@56 | 15 |
NodeIt &getFirst(NodeIt &) const; |
alpar@56 | 16 |
InEdgeIt &getFirst(InEdgeIt &,const NodeIt) const; |
alpar@56 | 17 |
OutEdgeIt &getFirst(OutEdgeIt &,const NodeIt) const; |
alpar@56 | 18 |
SymEdgeIt &getFirst(SymEdgeIt &,const NodeIt) const; |
alpar@56 | 19 |
EachEdgeIt &getFirst(EachEdgeIt &) const; |
alpar@52 | 20 |
|
alpar@56 | 21 |
NodeIt next(const NodeIt) const; |
alpar@56 | 22 |
InEdgeIt next(const InEdgeIt) const; |
alpar@56 | 23 |
OutEdgeIt next(const OutEdgeIt) const; |
alpar@56 | 24 |
SymEdgeIt next(const SymEdgeIt) const; |
alpar@56 | 25 |
EachEdgeIt next(const EachEdgeIt) const; |
alpar@52 | 26 |
|
alpar@56 | 27 |
NodeIt &goNext(NodeIt &) const; |
alpar@56 | 28 |
InEdgeIt &goNext(InEdgeIt &) const; |
alpar@56 | 29 |
OutEdgeIt &goNext(OutEdgeIt &) const; |
alpar@56 | 30 |
SymEdgeIt &goNext(SymEdgeIt &) const; |
alpar@56 | 31 |
EachEdgeIt &goNext(EachEdgeIt &) const; |
alpar@52 | 32 |
|
alpar@56 | 33 |
NodeIt head(const EdgeIt) const; |
alpar@56 | 34 |
NodeIt tail(const EdgeIt) const; |
alpar@55 | 35 |
|
alpar@56 | 36 |
NodeIt aNode(const InEdgeIt) const; |
alpar@56 | 37 |
NodeIt aNode(const OutEdgeIt) const; |
alpar@56 | 38 |
NodeIt aNode(const SymEdgeIt) const; |
alpar@52 | 39 |
|
alpar@56 | 40 |
NodeIt bNode(const InEdgeIt) const; |
alpar@56 | 41 |
NodeIt bNode(const OutEdgeIt) const; |
alpar@56 | 42 |
NodeIt bNode(const SymEdgeIt) const; |
alpar@55 | 43 |
|
alpar@56 | 44 |
bool valid(const NodeIt) const; |
alpar@56 | 45 |
bool valid(const EdgeIt) const; |
alpar@55 | 46 |
|
alpar@56 | 47 |
void setInvalid(NodeIt &) const; |
alpar@56 | 48 |
void setInvalid(EdgeIt &) const; |
alpar@52 | 49 |
|
alpar@52 | 50 |
NodeIt addNode(); |
alpar@52 | 51 |
EdgeIt addEdge(const NodeIt from,const NodeIt to); |
alpar@52 | 52 |
|
alpar@52 | 53 |
void delete(NodeIt n); |
alpar@52 | 54 |
void delete(EdgeIt e); |
alpar@52 | 55 |
|
alpar@57 | 56 |
void clear(); |
alpar@52 | 57 |
|
alpar@52 | 58 |
template<class T> class NodeMap |
alpar@52 | 59 |
{ |
alpar@52 | 60 |
public: |
alpar@52 | 61 |
typedef T value_type; |
alpar@52 | 62 |
void set(const NodeIt i, const T &t); |
alpar@52 | 63 |
T get(const NodeIt i) const; |
alpar@53 | 64 |
T &operator[](const NodeIt i); |
alpar@52 | 65 |
|
alpar@52 | 66 |
NodeMap(const Graph &G); |
alpar@52 | 67 |
}; |
alpar@52 | 68 |
|
alpar@52 | 69 |
template<class T> class EdgeMap |
alpar@52 | 70 |
{ |
alpar@52 | 71 |
public: |
alpar@52 | 72 |
typedef T value_type; |
alpar@52 | 73 |
void set(const EdgeIt i, const T &t); |
alpar@52 | 74 |
T get(const EdgeIt i) const; |
alpar@53 | 75 |
T &operator[](const EdgeIt i); |
alpar@52 | 76 |
|
alpar@52 | 77 |
EdgeMap(const Graph &G); |
alpar@52 | 78 |
}; |
alpar@52 | 79 |
}; |