56 defineBinding (topic);
62 return val == getAdvice();
80 link_.defineBinding (topic);
86 link_.setAdvice (val);
92 link_.retractAdvice();
120 createCollaboration();
121 overwriting_and_retracting();
131 CHECK (client.got (0));
134 CHECK (client.got (0));
136 int rr (1 + (rand() % 1000));
139 CHECK (client.got (rr));
147 TheAdvised client1 (
"topic1()");
148 TheAdvisor server2 (
"topic2()");
150 int r1 (1 + (rand() % 1000));
151 int r2 (1 + (rand() % 1000));
153 server2.publish (r2);
154 CHECK (client1.got(0));
156 TheAdvised client2 (
"topic2()");
157 CHECK (client2.got(r2));
160 CHECK (client1.got(0));
162 server1.publish (r1);
163 CHECK (client1.got(0));
164 CHECK (client2.got(r2));
166 server1.rebind (
"topic1()");
167 CHECK (client1.got(r1));
168 CHECK (client2.got(r2));
184 TheAdvised client1 (
"slot1");
185 TheAdvised client2 (
"slot2");
186 CHECK (client1.got(0));
187 CHECK (client2.got(0));
189 int r1 (1 + (rand() % 1000));
190 int r2 (1 + (rand() % 1000));
193 TheAdvisor server(
"slot1()");
194 CHECK (client1.got(0));
195 CHECK (client2.got(0));
198 CHECK (client1.got(r1));
199 CHECK (client2.got(0));
202 CHECK (client1.got(r2));
203 CHECK (client2.got(0));
205 server.rebind(
"slot2()");
206 CHECK (client1.got(0));
207 CHECK (client2.got(r2));
210 CHECK (client1.got(0));
211 CHECK (client2.got(r2));
214 TheAdvisor anotherServer(
"slot1");
215 CHECK (client1.got(0));
216 CHECK (client2.got(r2));
218 anotherServer.publish (r1);
219 CHECK (client1.got(r1));
220 CHECK (client2.got(r2));
223 CHECK (client1.got(r1));
224 CHECK (client2.got(r2));
227 TheAdvisor yetAnotherServer(
"slot2");
228 CHECK (client1.got(r1));
229 CHECK (client2.got(r2));
231 yetAnotherServer.publish (r1);
232 CHECK (client1.got(r1));
233 CHECK (client2.got(r1));
235 yetAnotherServer.rebind(
"slot1");
236 CHECK (client1.got(r1));
237 CHECK (client2.got(r2));
239 yetAnotherServer.clear();
240 CHECK (client1.got(r1));
241 CHECK (client2.got(r2));
243 yetAnotherServer.rebind(
"slot2");
244 CHECK (client1.got(r1));
245 CHECK (client2.got(r2));
247 yetAnotherServer.publish (5);
248 CHECK (client1.got(r1));
249 CHECK (client2.got(5));
252 CHECK (client1.got(r1));
253 CHECK (client2.got(5));
255 client1.rebind(
"slot2");
256 CHECK (client1.got(5));
257 CHECK (client2.got(5));
259 client2.rebind(
"nonExistingSlot");
260 CHECK (client1.got(5));
261 CHECK (client2.got(0));
Access point for the advised entity (client).
void createCollaboration()
inline string literal This is a marker type to indicate that
Expecting Advice and giving Advice: a cross-cutting collaboration of loosely coupled participants...
Simple test class runner.
Lumiera public interface.
void overwriting_and_retracting()