Class documentation of Concepts

Loading...
Searching...
No Matches
connectorSequence.hh
1
6#ifndef ConnectorSequence_hh
7#define ConnectorSequence_hh
8
9#include "connector.hh"
10#include "toolbox/sequence.hh"
11
12namespace concepts {
13
14 // ************************************************** Sequence<const Key*> **
15
16 template<>
17 class Sequence<const Key*> : public BaseSequence<const Key*> {
18 public:
20 template<class F>
22 virtual ~Sequence() {}
23
24 Sequence<uint> key() const;
25 };
26
27 // ******************************************* Sequence<const Connector0*> **
28
29 template<>
30 class Sequence<const Connector0*> :
32 public:
34 template<class F>
36 virtual ~Sequence() {}
37
38 Sequence<const Key*> key() const;
39 };
40
41 // ************************************************* Sequence<Connector0*> **
42
43 template<>
45 public:
47 template<class F>
49 virtual ~Sequence() {}
50
51 Sequence<const Key*> key() const;
52 };
53
54 // ******************************************* Sequence<const Connector1*> **
55
56 template<>
57 class Sequence<const Connector1*> :
59 public:
61 template<class F>
63 virtual ~Sequence() {}
64
65 Sequence<const Key*> key() const;
66 Sequence<Connector0*> vertex(uint i) const;
67 Sequence<const Connector1*> child(uint i) const;
68 };
69
70 // ************************************************* Sequence<Connector1*> **
71
72 template<>
74 public:
76 template<class F>
78 virtual ~Sequence() {}
79
80 Sequence<const Key*> key() const;
81 Sequence<Connector0*> vertex(uint i) const;
82 Sequence<const Connector1*> child(uint i) const;
83 };
84
85 // ******************************************* Sequence<const Connector2*> **
86
87 template<>
88 class Sequence<const Connector2*> :
90 public:
92 template<class F>
94 virtual ~Sequence() {}
95
96 Sequence<const Key*> key() const;
97 Sequence<Connector0*> vertex(uint i) const;
98 Sequence<Connector1*> edge(uint i) const;
99 Sequence<const Connector2*> child(uint i) const;
100 };
101
102 // ************************************************* Sequence<Connector2*> **
103
104 template<>
106 public:
108 template<class F>
110 virtual ~Sequence() {}
111
112 Sequence<const Key*> key() const;
113 Sequence<Connector0*> vertex(uint i) const;
114 Sequence<Connector1*> edge(uint i) const;
115 Sequence<const Connector2*> child(uint i) const;
116 };
117
118 // ********************************************************* allConnectors **
119
125 template<class F, class G>
126 Sequence<G*> allConnectors(const F& cntr, G* (F::*fun)(uint) const) {
128 G* cntri; // connectors inside cntr
129 uint i = 0;
130 while ((cntri = (cntr.*fun)(i++)) != 0) seq.push_back(cntri);
131 return seq;
132 }
133
134} // namespace concepts
135
136#endif // ConnectorSequence_hh
137
Sequence< G * > allConnectors(const F &cntr, G *(F::*fun)(uint) const)
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320