|
|
| 264 |
|
264 |
|
| 265 |
/** |
265 |
/** |
| 266 |
* \param classId class id of the constructor to invoke. |
266 |
* \param classId class id of the constructor to invoke. |
| 267 |
* \param iid interface id to query for |
|
|
| 268 |
* \return a pointer to the instance created. |
267 |
* \return a pointer to the instance created. |
| 269 |
* |
268 |
* |
| 270 |
* Create an instance of the object identified by its |
269 |
* Create an instance of the object identified by its |
|
|
| 272 |
* result. |
271 |
* result. |
| 273 |
*/ |
272 |
*/ |
| 274 |
template <typename T> |
273 |
template <typename T> |
| 275 |
static Ptr<T> Create (ClassId classId, InterfaceId iid); |
274 |
static Ptr<T> Create (ClassId classId); |
| 276 |
|
275 |
|
| 277 |
/** |
276 |
/** |
| 278 |
* \param classId class id of the constructor to invoke. |
277 |
* \param classId class id of the constructor to invoke. |
| 279 |
* \param iid interface id to query for |
|
|
| 280 |
* \param a1 first argument to pass to constructor |
278 |
* \param a1 first argument to pass to constructor |
| 281 |
* \return a pointer to the instance created. |
279 |
* \return a pointer to the instance created. |
| 282 |
* |
280 |
* |
|
|
| 285 |
* result. |
283 |
* result. |
| 286 |
*/ |
284 |
*/ |
| 287 |
template <typename T, typename T1> |
285 |
template <typename T, typename T1> |
| 288 |
static Ptr<T> Create (ClassId classId, InterfaceId iid, T1 a1); |
286 |
static Ptr<T> Create (ClassId classId, T1 a1); |
| 289 |
|
287 |
|
| 290 |
/** |
288 |
/** |
| 291 |
* \param classId class id of the constructor to invoke. |
289 |
* \param classId class id of the constructor to invoke. |
| 292 |
* \param iid interface id to query for |
|
|
| 293 |
* \param a1 first argument to pass to constructor |
290 |
* \param a1 first argument to pass to constructor |
| 294 |
* \param a2 second argument to pass to constructor |
291 |
* \param a2 second argument to pass to constructor |
| 295 |
* \return a pointer to the instance created. |
292 |
* \return a pointer to the instance created. |
|
|
| 299 |
* result. |
296 |
* result. |
| 300 |
*/ |
297 |
*/ |
| 301 |
template <typename T, typename T1, typename T2> |
298 |
template <typename T, typename T1, typename T2> |
| 302 |
static Ptr<T> Create (ClassId classId, InterfaceId iid, T1 a1, T2 a2); |
299 |
static Ptr<T> Create (ClassId classId, T1 a1, T2 a2); |
| 303 |
|
300 |
|
| 304 |
/** |
301 |
/** |
| 305 |
* \param classId class id of the constructor to invoke. |
302 |
* \param classId class id of the constructor to invoke. |
| 306 |
* \param iid interface id to query for |
|
|
| 307 |
* \param a1 first argument to pass to constructor |
303 |
* \param a1 first argument to pass to constructor |
| 308 |
* \param a2 second argument to pass to constructor |
304 |
* \param a2 second argument to pass to constructor |
| 309 |
* \param a3 third argument to pass to constructor |
305 |
* \param a3 third argument to pass to constructor |
|
|
| 314 |
* result. |
310 |
* result. |
| 315 |
*/ |
311 |
*/ |
| 316 |
template <typename T, typename T1, typename T2, typename T3> |
312 |
template <typename T, typename T1, typename T2, typename T3> |
| 317 |
static Ptr<T> Create (ClassId classId, InterfaceId iid, T1 a1, T2 a2, T3 a3); |
313 |
static Ptr<T> Create (ClassId classId, T1 a1, T2 a2, T3 a3); |
| 318 |
|
314 |
|
| 319 |
/** |
315 |
/** |
| 320 |
* \param classId class id of the constructor to invoke. |
316 |
* \param classId class id of the constructor to invoke. |
| 321 |
* \param iid interface id to query for |
|
|
| 322 |
* \param a1 first argument to pass to constructor |
317 |
* \param a1 first argument to pass to constructor |
| 323 |
* \param a2 second argument to pass to constructor |
318 |
* \param a2 second argument to pass to constructor |
| 324 |
* \param a3 third argument to pass to constructor |
319 |
* \param a3 third argument to pass to constructor |
|
|
| 330 |
* result. |
325 |
* result. |
| 331 |
*/ |
326 |
*/ |
| 332 |
template <typename T, typename T1, typename T2, typename T3, typename T4> |
327 |
template <typename T, typename T1, typename T2, typename T3, typename T4> |
| 333 |
static Ptr<T> Create (ClassId classId, InterfaceId iid, T1 a1, T2 a2, T3 a3, T4 a4); |
328 |
static Ptr<T> Create (ClassId classId, T1 a1, T2 a2, T3 a3, T4 a4); |
| 334 |
|
329 |
|
| 335 |
/** |
330 |
/** |
| 336 |
* \param classId class id of the constructor to invoke. |
331 |
* \param classId class id of the constructor to invoke. |
| 337 |
* \param iid interface id to query for |
|
|
| 338 |
* \param a1 first argument to pass to constructor |
332 |
* \param a1 first argument to pass to constructor |
| 339 |
* \param a2 second argument to pass to constructor |
333 |
* \param a2 second argument to pass to constructor |
| 340 |
* \param a3 third argument to pass to constructor |
334 |
* \param a3 third argument to pass to constructor |
|
|
| 347 |
* result. |
341 |
* result. |
| 348 |
*/ |
342 |
*/ |
| 349 |
template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5> |
343 |
template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5> |
| 350 |
static Ptr<T> Create (ClassId classId, InterfaceId iid, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5); |
344 |
static Ptr<T> Create (ClassId classId, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5); |
| 351 |
|
345 |
|
| 352 |
private: |
346 |
private: |
| 353 |
friend void RegisterCallback (ClassId classId, CallbackBase *callback, |
347 |
friend void RegisterCallback (ClassId classId, CallbackBase *callback, |
| 354 |
std::vector<const InterfaceId *> supportedInterfaces); |
348 |
std::vector<const InterfaceId *> supportedInterfaces); |
| 355 |
static void Register (ClassId classId, CallbackBase *callback, |
349 |
static void Register (ClassId classId, CallbackBase *callback, |
| 356 |
std::vector<const InterfaceId *> supportedInterfaces); |
350 |
std::vector<const InterfaceId *> supportedInterfaces); |
| 357 |
|
351 |
|
|
Lines 627-682
ComponentManager::Create (ClassId classI
|
Link Here
|
|---|
|
| 627 |
|
621 |
|
| 628 |
template <typename T> |
622 |
template <typename T> |
| 629 |
Ptr<T> |
623 |
Ptr<T> |
| 630 |
ComponentManager::Create (ClassId classId, InterfaceId iid) |
624 |
ComponentManager::Create (ClassId classId) |
| 631 |
{ |
625 |
{ |
| 632 |
Ptr<Object> obj = Create (classId); |
626 |
Ptr<Object> obj = Create (classId); |
| 633 |
Ptr<T> i = obj->QueryInterface<T> (iid); |
627 |
Ptr<T> i = obj->QueryInterface<T> (); |
| 634 |
return i; |
628 |
return i; |
| 635 |
} |
629 |
} |
| 636 |
|
630 |
|
| 637 |
template <typename T, typename T1> |
631 |
template <typename T, typename T1> |
| 638 |
Ptr<T> |
632 |
Ptr<T> |
| 639 |
ComponentManager::Create (ClassId classId, InterfaceId iid, T1 a1) |
633 |
ComponentManager::Create (ClassId classId, T1 a1) |
| 640 |
{ |
634 |
{ |
| 641 |
Ptr<Object> obj = Create (classId, a1); |
635 |
Ptr<Object> obj = Create (classId, a1); |
| 642 |
Ptr<T> i = obj->QueryInterface<T> (iid); |
636 |
Ptr<T> i = obj->QueryInterface<T> (); |
| 643 |
return i; |
637 |
return i; |
| 644 |
} |
638 |
} |
| 645 |
|
639 |
|
| 646 |
template <typename T, typename T1, typename T2> |
640 |
template <typename T, typename T1, typename T2> |
| 647 |
Ptr<T> |
641 |
Ptr<T> |
| 648 |
ComponentManager::Create (ClassId classId, InterfaceId iid, T1 a1, T2 a2) |
642 |
ComponentManager::Create (ClassId classId, T1 a1, T2 a2) |
| 649 |
{ |
643 |
{ |
| 650 |
Ptr<Object> obj = Create (classId, a1, a2); |
644 |
Ptr<Object> obj = Create (classId, a1, a2); |
| 651 |
Ptr<T> i = obj->QueryInterface<T> (iid); |
645 |
Ptr<T> i = obj->QueryInterface<T> (); |
| 652 |
return i; |
646 |
return i; |
| 653 |
} |
647 |
} |
| 654 |
|
648 |
|
| 655 |
|
649 |
|
| 656 |
template <typename T, typename T1, typename T2, typename T3> |
650 |
template <typename T, typename T1, typename T2, typename T3> |
| 657 |
Ptr<T> |
651 |
Ptr<T> |
| 658 |
ComponentManager::Create (ClassId classId, InterfaceId iid, T1 a1, T2 a2, T3 a3) |
652 |
ComponentManager::Create (ClassId classId, T1 a1, T2 a2, T3 a3) |
| 659 |
{ |
653 |
{ |
| 660 |
Ptr<Object> obj = Create (classId, a1, a2, a3); |
654 |
Ptr<Object> obj = Create (classId, a1, a2, a3); |
| 661 |
Ptr<T> i = obj->QueryInterface<T> (iid); |
655 |
Ptr<T> i = obj->QueryInterface<T> (); |
| 662 |
return i; |
656 |
return i; |
| 663 |
} |
657 |
} |
| 664 |
|
658 |
|
| 665 |
template <typename T, typename T1, typename T2, typename T3, typename T4> |
659 |
template <typename T, typename T1, typename T2, typename T3, typename T4> |
| 666 |
Ptr<T> |
660 |
Ptr<T> |
| 667 |
ComponentManager::Create (ClassId classId, InterfaceId iid, T1 a1, T2 a2, T3 a3, T4 a4) |
661 |
ComponentManager::Create (ClassId classId, T1 a1, T2 a2, T3 a3, T4 a4) |
| 668 |
{ |
662 |
{ |
| 669 |
Ptr<Object> obj = Create (classId, a1, a2, a3, a4); |
663 |
Ptr<Object> obj = Create (classId, a1, a2, a3, a4); |
| 670 |
Ptr<T> i = obj->QueryInterface<T> (iid); |
664 |
Ptr<T> i = obj->QueryInterface<T> (); |
| 671 |
return i; |
665 |
return i; |
| 672 |
} |
666 |
} |
| 673 |
|
667 |
|
| 674 |
template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5> |
668 |
template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5> |
| 675 |
Ptr<T> |
669 |
Ptr<T> |
| 676 |
ComponentManager::Create (ClassId classId, InterfaceId iid, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) |
670 |
ComponentManager::Create (ClassId classId, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) |
| 677 |
{ |
671 |
{ |
| 678 |
Ptr<Object> obj = Create (classId, a1, a2, a3, a4, a5); |
672 |
Ptr<Object> obj = Create (classId, a1, a2, a3, a4, a5); |
| 679 |
Ptr<T> i = obj->QueryInterface<T> (iid); |
673 |
Ptr<T> i = obj->QueryInterface<T> (); |
| 680 |
return i; |
674 |
return i; |
| 681 |
} |
675 |
} |
| 682 |
|
676 |
|