LEFT | RIGHT |
(no file at all) | |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2005,2006 INRIA | 3 * Copyright (c) 2005,2006 INRIA |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 * \ingroup callbackimpl | 194 * \ingroup callbackimpl |
195 * CallbackImpl classes with varying numbers of argument types | 195 * CallbackImpl classes with varying numbers of argument types |
196 * | 196 * |
197 * @{ | 197 * @{ |
198 */ | 198 */ |
199 /** CallbackImpl class with no arguments. */ | 199 /** CallbackImpl class with no arguments. */ |
200 template <typename R> | 200 template <typename R> |
201 class CallbackImpl<R,empty,empty,empty,empty,empty,empty,empty,empty,empty> : pu
blic CallbackImplBase { | 201 class CallbackImpl<R,empty,empty,empty,empty,empty,empty,empty,empty,empty> : pu
blic CallbackImplBase { |
202 public: | 202 public: |
203 virtual ~CallbackImpl () {} | 203 virtual ~CallbackImpl () {} |
204 virtual R operator() (void) = 0; //!< Abstract operator | 204 /**· |
| 205 * Abstract operator |
| 206 * \returns R object |
| 207 */ |
| 208 virtual R operator() (void) = 0; |
205 virtual std::string GetTypeid (void) const | 209 virtual std::string GetTypeid (void) const |
206 { | 210 { |
207 return DoGetTypeid (); | 211 return DoGetTypeid (); |
208 } | 212 } |
209 /** \copydoc GetTypeid(). */ | 213 /** \copydoc GetTypeid(). */ |
210 static std::string DoGetTypeid (void) | 214 static std::string DoGetTypeid (void) |
211 { | 215 { |
212 static std::string id = "CallbackImpl<" + | 216 static std::string id = "CallbackImpl<" + |
213 GetCppTypeid<R> () + | 217 GetCppTypeid<R> () + |
214 ">"; | 218 ">"; |
215 return id; | 219 return id; |
216 } | 220 } |
217 }; | 221 }; |
218 /** CallbackImpl class with one argument. */ | 222 /** CallbackImpl class with one argument. */ |
219 template <typename R, typename T1> | 223 template <typename R, typename T1> |
220 class CallbackImpl<R,T1,empty,empty,empty,empty,empty,empty,empty,empty> : publi
c CallbackImplBase { | 224 class CallbackImpl<R,T1,empty,empty,empty,empty,empty,empty,empty,empty> : publi
c CallbackImplBase { |
221 public: | 225 public: |
222 virtual ~CallbackImpl () {} | 226 virtual ~CallbackImpl () {} |
| 227 /**· |
| 228 * Abstract operator |
| 229 * \returns R object |
| 230 */ |
223 virtual R operator() (T1) = 0; //!< Abstract operator | 231 virtual R operator() (T1) = 0; //!< Abstract operator |
224 virtual std::string GetTypeid (void) const | 232 virtual std::string GetTypeid (void) const |
225 { | 233 { |
226 return DoGetTypeid (); | 234 return DoGetTypeid (); |
227 } | 235 } |
228 /** \copydoc GetTypeid(). */ | 236 /** \copydoc GetTypeid(). */ |
229 static std::string DoGetTypeid (void) | 237 static std::string DoGetTypeid (void) |
230 { | 238 { |
231 static std::string id = "CallbackImpl<" + | 239 static std::string id = "CallbackImpl<" + |
232 GetCppTypeid<R> () + "," + | 240 GetCppTypeid<R> () + "," + |
233 GetCppTypeid<T1> () + | 241 GetCppTypeid<T1> () + |
234 ">"; | 242 ">"; |
235 return id; | 243 return id; |
236 } | 244 } |
237 }; | 245 }; |
238 /** CallbackImpl class with two arguments. */ | 246 /** CallbackImpl class with two arguments. */ |
239 template <typename R, typename T1, typename T2> | 247 template <typename R, typename T1, typename T2> |
240 class CallbackImpl<R,T1,T2,empty,empty,empty,empty,empty,empty,empty> : public C
allbackImplBase { | 248 class CallbackImpl<R,T1,T2,empty,empty,empty,empty,empty,empty,empty> : public C
allbackImplBase { |
241 public: | 249 public: |
242 virtual ~CallbackImpl () {} | 250 virtual ~CallbackImpl () {} |
| 251 /**· |
| 252 * Abstract operator |
| 253 * \returns R object |
| 254 */ |
243 virtual R operator() (T1, T2) = 0; //!< Abstract operator | 255 virtual R operator() (T1, T2) = 0; //!< Abstract operator |
244 virtual std::string GetTypeid (void) const | 256 virtual std::string GetTypeid (void) const |
245 { | 257 { |
246 return DoGetTypeid (); | 258 return DoGetTypeid (); |
247 } | 259 } |
248 /** \copydoc GetTypeid(). */ | 260 /** \copydoc GetTypeid(). */ |
249 static std::string DoGetTypeid (void) | 261 static std::string DoGetTypeid (void) |
250 { | 262 { |
251 static std::string id = "CallbackImpl<" + | 263 static std::string id = "CallbackImpl<" + |
252 GetCppTypeid<R> () + "," + | 264 GetCppTypeid<R> () + "," + |
253 GetCppTypeid<T1> () + "," + | 265 GetCppTypeid<T1> () + "," + |
254 GetCppTypeid<T2> () + | 266 GetCppTypeid<T2> () + |
255 ">"; | 267 ">"; |
256 return id; | 268 return id; |
257 } | 269 } |
258 }; | 270 }; |
259 /** CallbackImpl class with three arguments. */ | 271 /** CallbackImpl class with three arguments. */ |
260 template <typename R, typename T1, typename T2, typename T3> | 272 template <typename R, typename T1, typename T2, typename T3> |
261 class CallbackImpl<R,T1,T2,T3,empty,empty,empty,empty,empty,empty> : public Call
backImplBase { | 273 class CallbackImpl<R,T1,T2,T3,empty,empty,empty,empty,empty,empty> : public Call
backImplBase { |
262 public: | 274 public: |
263 virtual ~CallbackImpl () {} | 275 virtual ~CallbackImpl () {} |
| 276 /**· |
| 277 * Abstract operator |
| 278 * \returns R object |
| 279 */ |
264 virtual R operator() (T1, T2, T3) = 0; //!< Abstract operator | 280 virtual R operator() (T1, T2, T3) = 0; //!< Abstract operator |
265 virtual std::string GetTypeid (void) const | 281 virtual std::string GetTypeid (void) const |
266 { | 282 { |
267 return DoGetTypeid (); | 283 return DoGetTypeid (); |
268 } | 284 } |
269 /** \copydoc GetTypeid(). */ | 285 /** \copydoc GetTypeid(). */ |
270 static std::string DoGetTypeid (void) | 286 static std::string DoGetTypeid (void) |
271 { | 287 { |
272 static std::string id = "CallbackImpl<" + | 288 static std::string id = "CallbackImpl<" + |
273 GetCppTypeid<R> () + "," + | 289 GetCppTypeid<R> () + "," + |
274 GetCppTypeid<T1> () + "," + | 290 GetCppTypeid<T1> () + "," + |
275 GetCppTypeid<T2> () + "," + | 291 GetCppTypeid<T2> () + "," + |
276 GetCppTypeid<T3> () + | 292 GetCppTypeid<T3> () + |
277 ">"; | 293 ">"; |
278 return id; | 294 return id; |
279 } | 295 } |
280 }; | 296 }; |
281 /** CallbackImpl class with four arguments. */ | 297 /** CallbackImpl class with four arguments. */ |
282 template <typename R, typename T1, typename T2, typename T3, typename T4> | 298 template <typename R, typename T1, typename T2, typename T3, typename T4> |
283 class CallbackImpl<R,T1,T2,T3,T4,empty,empty,empty,empty,empty> : public Callbac
kImplBase { | 299 class CallbackImpl<R,T1,T2,T3,T4,empty,empty,empty,empty,empty> : public Callbac
kImplBase { |
284 public: | 300 public: |
285 virtual ~CallbackImpl () {} | 301 virtual ~CallbackImpl () {} |
| 302 /**· |
| 303 * Abstract operator |
| 304 * \returns R object |
| 305 */ |
286 virtual R operator() (T1, T2, T3, T4) = 0; //!< Abstract operator | 306 virtual R operator() (T1, T2, T3, T4) = 0; //!< Abstract operator |
287 virtual std::string GetTypeid (void) const | 307 virtual std::string GetTypeid (void) const |
288 { | 308 { |
289 return DoGetTypeid (); | 309 return DoGetTypeid (); |
290 } | 310 } |
291 /** \copydoc GetTypeid(). */ | 311 /** \copydoc GetTypeid(). */ |
292 static std::string DoGetTypeid (void) | 312 static std::string DoGetTypeid (void) |
293 { | 313 { |
294 static std::string id = "CallbackImpl<" + | 314 static std::string id = "CallbackImpl<" + |
295 GetCppTypeid<R> () + "," + | 315 GetCppTypeid<R> () + "," + |
296 GetCppTypeid<T1> () + "," + | 316 GetCppTypeid<T1> () + "," + |
297 GetCppTypeid<T2> () + "," + | 317 GetCppTypeid<T2> () + "," + |
298 GetCppTypeid<T3> () + "," + | 318 GetCppTypeid<T3> () + "," + |
299 GetCppTypeid<T4> () + | 319 GetCppTypeid<T4> () + |
300 ">"; | 320 ">"; |
301 return id; | 321 return id; |
302 } | 322 } |
303 }; | 323 }; |
304 /** CallbackImpl class with five arguments. */ | 324 /** CallbackImpl class with five arguments. */ |
305 template <typename R, typename T1, typename T2, typename T3, typename T4, typena
me T5> | 325 template <typename R, typename T1, typename T2, typename T3, typename T4, typena
me T5> |
306 class CallbackImpl<R,T1,T2,T3,T4,T5,empty,empty,empty,empty> : public CallbackIm
plBase { | 326 class CallbackImpl<R,T1,T2,T3,T4,T5,empty,empty,empty,empty> : public CallbackIm
plBase { |
307 public: | 327 public: |
308 virtual ~CallbackImpl () {} | 328 virtual ~CallbackImpl () {} |
| 329 /**· |
| 330 * Abstract operator |
| 331 * \returns R object |
| 332 */ |
309 virtual R operator() (T1, T2, T3, T4, T5) = 0; //!< Abstract operator | 333 virtual R operator() (T1, T2, T3, T4, T5) = 0; //!< Abstract operator |
310 virtual std::string GetTypeid (void) const | 334 virtual std::string GetTypeid (void) const |
311 { | 335 { |
312 return DoGetTypeid (); | 336 return DoGetTypeid (); |
313 } | 337 } |
314 /** \copydoc GetTypeid(). */ | 338 /** \copydoc GetTypeid(). */ |
315 static std::string DoGetTypeid (void) | 339 static std::string DoGetTypeid (void) |
316 { | 340 { |
317 static std::string id = "CallbackImpl<" + | 341 static std::string id = "CallbackImpl<" + |
318 GetCppTypeid<R> () + "," + | 342 GetCppTypeid<R> () + "," + |
319 GetCppTypeid<T1> () + "," + | 343 GetCppTypeid<T1> () + "," + |
320 GetCppTypeid<T2> () + "," + | 344 GetCppTypeid<T2> () + "," + |
321 GetCppTypeid<T3> () + "," + | 345 GetCppTypeid<T3> () + "," + |
322 GetCppTypeid<T4> () + "," + | 346 GetCppTypeid<T4> () + "," + |
323 GetCppTypeid<T5> () + | 347 GetCppTypeid<T5> () + |
324 ">"; | 348 ">"; |
325 return id; | 349 return id; |
326 } | 350 } |
327 }; | 351 }; |
328 /** CallbackImpl class with six arguments. */ | 352 /** CallbackImpl class with six arguments. */ |
329 template <typename R, typename T1, typename T2, typename T3, typename T4, typena
me T5, typename T6> | 353 template <typename R, typename T1, typename T2, typename T3, typename T4, typena
me T5, typename T6> |
330 class CallbackImpl<R,T1,T2,T3,T4,T5,T6,empty,empty,empty> : public CallbackImplB
ase { | 354 class CallbackImpl<R,T1,T2,T3,T4,T5,T6,empty,empty,empty> : public CallbackImplB
ase { |
331 public: | 355 public: |
332 virtual ~CallbackImpl () {} | 356 virtual ~CallbackImpl () {} |
| 357 /**· |
| 358 * Abstract operator |
| 359 * \returns R object |
| 360 */ |
333 virtual R operator() (T1, T2, T3, T4, T5, T6) = 0; //!< Abstract operator | 361 virtual R operator() (T1, T2, T3, T4, T5, T6) = 0; //!< Abstract operator |
334 virtual std::string GetTypeid (void) const | 362 virtual std::string GetTypeid (void) const |
335 { | 363 { |
336 return DoGetTypeid (); | 364 return DoGetTypeid (); |
337 } | 365 } |
338 /** \copydoc GetTypeid(). */ | 366 /** \copydoc GetTypeid(). */ |
339 static std::string DoGetTypeid (void) | 367 static std::string DoGetTypeid (void) |
340 { | 368 { |
341 static std::string id = "CallbackImpl<" + | 369 static std::string id = "CallbackImpl<" + |
342 GetCppTypeid<R> () + "," + | 370 GetCppTypeid<R> () + "," + |
343 GetCppTypeid<T1> () + "," + | 371 GetCppTypeid<T1> () + "," + |
344 GetCppTypeid<T2> () + "," + | 372 GetCppTypeid<T2> () + "," + |
345 GetCppTypeid<T3> () + "," + | 373 GetCppTypeid<T3> () + "," + |
346 GetCppTypeid<T4> () + "," + | 374 GetCppTypeid<T4> () + "," + |
347 GetCppTypeid<T5> () + "," + | 375 GetCppTypeid<T5> () + "," + |
348 GetCppTypeid<T6> () + | 376 GetCppTypeid<T6> () + |
349 ">"; | 377 ">"; |
350 return id; | 378 return id; |
351 } | 379 } |
352 }; | 380 }; |
353 /** CallbackImpl class with seven arguments. */ | 381 /** CallbackImpl class with seven arguments. */ |
354 template <typename R, typename T1, typename T2, typename T3, typename T4, typena
me T5, typename T6, typename T7> | 382 template <typename R, typename T1, typename T2, typename T3, typename T4, typena
me T5, typename T6, typename T7> |
355 class CallbackImpl<R,T1,T2,T3,T4,T5,T6,T7,empty,empty> : public CallbackImplBase
{ | 383 class CallbackImpl<R,T1,T2,T3,T4,T5,T6,T7,empty,empty> : public CallbackImplBase
{ |
356 public: | 384 public: |
357 virtual ~CallbackImpl () {} | 385 virtual ~CallbackImpl () {} |
| 386 /**· |
| 387 * Abstract operator |
| 388 * \returns R object |
| 389 */ |
358 virtual R operator() (T1, T2, T3, T4, T5, T6, T7) = 0; //!< Abstract operator | 390 virtual R operator() (T1, T2, T3, T4, T5, T6, T7) = 0; //!< Abstract operator |
359 virtual std::string GetTypeid (void) const | 391 virtual std::string GetTypeid (void) const |
360 { | 392 { |
361 return DoGetTypeid (); | 393 return DoGetTypeid (); |
362 } | 394 } |
363 /** \copydoc GetTypeid(). */ | 395 /** \copydoc GetTypeid(). */ |
364 static std::string DoGetTypeid (void) | 396 static std::string DoGetTypeid (void) |
365 { | 397 { |
366 static std::string id = "CallbackImpl<" + | 398 static std::string id = "CallbackImpl<" + |
367 GetCppTypeid<R> () + "," + | 399 GetCppTypeid<R> () + "," + |
368 GetCppTypeid<T1> () + "," + | 400 GetCppTypeid<T1> () + "," + |
369 GetCppTypeid<T2> () + "," + | 401 GetCppTypeid<T2> () + "," + |
370 GetCppTypeid<T3> () + "," + | 402 GetCppTypeid<T3> () + "," + |
371 GetCppTypeid<T4> () + "," + | 403 GetCppTypeid<T4> () + "," + |
372 GetCppTypeid<T5> () + "," + | 404 GetCppTypeid<T5> () + "," + |
373 GetCppTypeid<T6> () + "," + | 405 GetCppTypeid<T6> () + "," + |
374 GetCppTypeid<T7> () + | 406 GetCppTypeid<T7> () + |
375 ">"; | 407 ">"; |
376 return id; | 408 return id; |
377 } | 409 } |
378 }; | 410 }; |
379 /** CallbackImpl class with eight arguments. */ | 411 /** CallbackImpl class with eight arguments. */ |
380 template <typename R, typename T1, typename T2, typename T3, typename T4, typena
me T5, typename T6, typename T7, typename T8> | 412 template <typename R, typename T1, typename T2, typename T3, typename T4, typena
me T5, typename T6, typename T7, typename T8> |
381 class CallbackImpl<R,T1,T2,T3,T4,T5,T6,T7,T8,empty> : public CallbackImplBase { | 413 class CallbackImpl<R,T1,T2,T3,T4,T5,T6,T7,T8,empty> : public CallbackImplBase { |
382 public: | 414 public: |
383 virtual ~CallbackImpl () {} | 415 virtual ~CallbackImpl () {} |
| 416 /**· |
| 417 * Abstract operator |
| 418 * \returns R object |
| 419 */ |
384 virtual R operator() (T1, T2, T3, T4, T5, T6, T7, T8) = 0; //!< Abstract oper
ator | 420 virtual R operator() (T1, T2, T3, T4, T5, T6, T7, T8) = 0; //!< Abstract oper
ator |
385 virtual std::string GetTypeid (void) const | 421 virtual std::string GetTypeid (void) const |
386 { | 422 { |
387 return DoGetTypeid (); | 423 return DoGetTypeid (); |
388 } | 424 } |
389 /** \copydoc GetTypeid(). */ | 425 /** \copydoc GetTypeid(). */ |
390 static std::string DoGetTypeid (void) | 426 static std::string DoGetTypeid (void) |
391 { | 427 { |
392 static std::string id = "CallbackImpl<" + | 428 static std::string id = "CallbackImpl<" + |
393 GetCppTypeid<R> () + "," + | 429 GetCppTypeid<R> () + "," + |
394 GetCppTypeid<T1> () + "," + | 430 GetCppTypeid<T1> () + "," + |
395 GetCppTypeid<T2> () + "," + | 431 GetCppTypeid<T2> () + "," + |
396 GetCppTypeid<T3> () + "," + | 432 GetCppTypeid<T3> () + "," + |
397 GetCppTypeid<T4> () + "," + | 433 GetCppTypeid<T4> () + "," + |
398 GetCppTypeid<T5> () + "," + | 434 GetCppTypeid<T5> () + "," + |
399 GetCppTypeid<T6> () + "," + | 435 GetCppTypeid<T6> () + "," + |
400 GetCppTypeid<T7> () + "," + | 436 GetCppTypeid<T7> () + "," + |
401 GetCppTypeid<T8> () + | 437 GetCppTypeid<T8> () + |
402 ">"; | 438 ">"; |
403 return id; | 439 return id; |
404 } | 440 } |
405 }; | 441 }; |
406 /** CallbackImpl class with nine arguments. */ | 442 /** CallbackImpl class with nine arguments. */ |
407 template <typename R, typename T1, typename T2, typename T3, typename T4, typena
me T5, typename T6, typename T7, typename T8, typename T9> | 443 template <typename R, typename T1, typename T2, typename T3, typename T4, typena
me T5, typename T6, typename T7, typename T8, typename T9> |
408 class CallbackImpl : public CallbackImplBase { | 444 class CallbackImpl : public CallbackImplBase { |
409 public: | 445 public: |
410 virtual ~CallbackImpl () {} | 446 virtual ~CallbackImpl () {} |
| 447 /**· |
| 448 * Abstract operator |
| 449 * \returns R object |
| 450 */ |
411 virtual R operator() (T1, T2, T3, T4, T5, T6, T7, T8, T9) = 0; //!< Abstract
operator | 451 virtual R operator() (T1, T2, T3, T4, T5, T6, T7, T8, T9) = 0; //!< Abstract
operator |
412 virtual std::string GetTypeid (void) const | 452 virtual std::string GetTypeid (void) const |
413 { | 453 { |
414 return DoGetTypeid (); | 454 return DoGetTypeid (); |
415 } | 455 } |
416 /** \copydoc GetTypeid(). */ | 456 /** \copydoc GetTypeid(). */ |
417 static std::string DoGetTypeid (void) | 457 static std::string DoGetTypeid (void) |
418 { | 458 { |
419 static std::string id = "CallbackImpl<" + | 459 static std::string id = "CallbackImpl<" + |
420 GetCppTypeid<R> () + "," + | 460 GetCppTypeid<R> () + "," + |
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1935 NS_FATAL_ERROR_NO_MSG (); | 1975 NS_FATAL_ERROR_NO_MSG (); |
1936 return true; | 1976 return true; |
1937 } | 1977 } |
1938 return false; | 1978 return false; |
1939 } | 1979 } |
1940 | 1980 |
1941 } // namespace ns3 | 1981 } // namespace ns3 |
1942 | 1982 |
1943 | 1983 |
1944 #endif /* CALLBACK_H */ | 1984 #endif /* CALLBACK_H */ |
LEFT | RIGHT |