Class documentation of Concepts

Loading...
Searching...
No Matches
connectorSet.hh
Go to the documentation of this file.
1
6#ifndef ConnectorSet_hh
7#define ConnectorSet_hh
8
9#include "connector.hh"
10#include "toolbox/set.hh"
11
12namespace concepts {
13
14 // ******************************************************** Set<Attribute> **
15
16 template<>
17 class Set<Attribute> : public BaseSet<Attribute> {
18 public:
22 Set(const Set<uint>& set) : BaseSet<Attribute>() {
23 for(Set<uint>::const_iterator i = set.begin(); i != set.end();)
24 this->insert(*i++);
25 }
31 Set(const std::string& str) : BaseSet<Attribute>() {
32 *this = Set<uint>(str);
33 }
35 Set(const Attribute& attr) : BaseSet<Attribute>() { insert(attr); }
37 Set(const uint attr) : BaseSet<Attribute>() { insert(Attribute(attr)); }
38 virtual ~Set() {}
39 };
40
41 // ******************************************************* Set<const Key*> **
42
43 template<>
44 class Set<const Key*> : public BaseSet<const Key*> {
45 public:
47 template<class F>
48 Set(const F& set) : BaseSet<const Key*>(set) {}
49 virtual ~Set() {}
50
51 Set<uint> key() const;
52 };
53
54 // ************************************************* Set<const Connector*> **
55
56 template<>
57 class Set<const Connector*> : public BaseSet<const Connector*> {
58 public:
60 template<class F>
61 Set(const F& set) : BaseSet<const Connector*>(set) {}
62 virtual ~Set() {}
63
64 Set<const Key*> key() const;
65 };
66
67 // ******************************************************* Set<Connector*> **
68
69 template<>
71 public:
73 template<class F>
74 Set(const F& set) : BaseSet<Connector*>(set) {}
75 virtual ~Set() {}
76
77 Set<const Key*> key() const;
78 };
79
80 // ************************************************ Set<const Connector0*> **
81
82 template<>
83 class Set<const Connector0*> : public BaseSet<const Connector0*> {
84 public:
86 template<class F>
87 Set(const F& set) : BaseSet<const Connector0*>(set) {}
88// virtual ~Set() {}
89
90 Set<const Key*> key() const;
91 };
92
93 // ****************************************************** Set<Connector0*> **
94
95 template<>
97 public:
99 template<class F>
100 Set(const F& set) : BaseSet<Connector0*>(set) {}
101// virtual ~Set() {}
102
103 Set<const Key*> key() const;
104 };
105
106 // ************************************************ Set<const Connector1*> **
107
108 template<>
110 public:
112 template<class F>
113 Set(const F& set) : BaseSet<const Connector1*>(set) {}
114 virtual ~Set() {}
115
116 Set<const Key*> key() const;
117 Set<Connector0*> vertex(uint i) const;
118 Set<const Connector1*> child(uint i) const;
119 };
120
121 // ****************************************************** Set<Connector1*> **
122
123 template<>
125 public:
127 template<class F>
128 Set(const F& set) : BaseSet<Connector1*>(set) {}
129 virtual ~Set() {}
130
131 Set<const Key*> key() const;
132 Set<Connector0*> vertex(uint i) const;
133 Set<const Connector1*> child(uint i) const;
134 };
135
136 // ************************************************ Set<const Connector2*> **
137
138 template<>
140 public:
142 template<class F>
143 Set(const F& set) : BaseSet<const Connector2*>(set) {}
144 virtual ~Set() {}
145
146 Set<const Key*> key() const;
147 Set<Connector0*> vertex(uint i) const;
148 Set<Connector1*> edge(uint i) const;
149 Set<const Connector2*> child(uint i) const;
150 };
151
152 // ****************************************************** Set<Connector2*> **
153
154 template<>
156 public:
158 template<class F>
159 Set(const F& set) : BaseSet<Connector2*>(set) {}
160 virtual ~Set() {}
161
162 Set<const Key*> key() const;
163 Set<Connector0*> vertex(uint i) const;
164 Set<Connector1*> edge(uint i) const;
165 Set<const Connector2*> child(uint i) const;
166 };
167
168 // ********************************************************* allConnectors **
169
176 template<class F, class G>
177 void allConnectors(const F& cntr, G* (F::*fun)(uint) const, Set<G*>& set) {
178 G* cntri; // connectors inside cntr
179 uint i = 0;
180 while ((cntri = (cntr.*fun)(i++)) != 0) set.insert(cntri);
181 }
182
183} // namespace concepts
184
185#endif // ConnectorSet_hh
186
Set(const Attribute &attr)
Constructor for a single attribute.
Set(const Set< uint > &set)
Constructor if a set of unsigned integer is given.
Set()
Default constructor.
Set(const std::string &str)
Set(const uint attr)
Constructor for a single attribute.
Sequence< G * > allConnectors(const F &cntr, G *(F::*fun)(uint) const)
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320