Changeset 37068 in vbox
- Timestamp:
- May 13, 2011 12:38:28 PM (14 years ago)
- Location:
- trunk/include/VBox/com
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/list.h
r36659 r37068 28 28 #define ___VBox_com_list_h 29 29 30 #include <VBox/com/ptr.h> 30 31 #include <VBox/com/string.h> 31 32 #include <iprt/cpp/list.h> 33 34 /** 35 * Specialized list class for using with com::ComPtr<C> 36 * 37 * @note: This is necessary cause ComPtr<IFACE> has a size of 8. 38 */ 39 template <typename C> 40 class RTCList< ComPtr<C> >: public RTCListBase< ComPtr<C>, ComPtr<C>*, false> 41 { 42 /* Traits */ 43 typedef ComPtr<C> T; 44 typedef T *ITYPE; 45 static const bool MT = false; 46 typedef RTCListBase<T, ITYPE, MT> BASE; 47 48 public: 49 /** 50 * Creates a new list. 51 * 52 * This preallocates @a cCapacity elements within the list. 53 * 54 * @param cCapacitiy The initial capacity the list has. 55 * @throws std::bad_alloc 56 */ 57 RTCList(size_t cCapacity = BASE::DefaultCapacity) 58 : BASE(cCapacity) {} 59 60 /* Define our own new and delete. */ 61 RTMEMEF_NEW_AND_DELETE_OPERATORS(); 62 }; 63 64 /** 65 * Specialized list class for using with com::ComObjPtr<C> 66 * 67 * @note: This is necessary cause ComObjPtr<IFACE> has a size of 8. 68 */ 69 template <typename C> 70 class RTCList< ComObjPtr<C> >: public RTCListBase< ComObjPtr<C>, ComObjPtr<C>*, false> 71 { 72 /* Traits */ 73 typedef ComObjPtr<C> T; 74 typedef T *ITYPE; 75 static const bool MT = false; 76 typedef RTCListBase<T, ITYPE, MT> BASE; 77 78 public: 79 /** 80 * Creates a new list. 81 * 82 * This preallocates @a cCapacity elements within the list. 83 * 84 * @param cCapacitiy The initial capacity the list has. 85 * @throws std::bad_alloc 86 */ 87 RTCList(size_t cCapacity = BASE::DefaultCapacity) 88 : BASE(cCapacity) {} 89 90 /* Define our own new and delete. */ 91 RTMEMEF_NEW_AND_DELETE_OPERATORS(); 92 }; 32 93 33 94 /** -
trunk/include/VBox/com/mtlist.h
r36659 r37068 28 28 #define ___VBox_com_mtlist_h 29 29 30 #include <VBox/com/ptr.h> 30 31 #include <VBox/com/string.h> 31 32 #include <iprt/cpp/mtlist.h> 33 34 /** 35 * Specialized thread-safe list class for using with com::ComPtr<C> 36 * 37 * @note: This is necessary cause ComPtr<IFACE> has a size of 8. 38 */ 39 template <typename C> 40 class RTCMTList< ComPtr<C> >: public RTCListBase< ComPtr<C>, ComPtr<C>*, true> 41 { 42 /* Traits */ 43 typedef ComPtr<C> T; 44 typedef T *ITYPE; 45 static const bool MT = true; 46 typedef RTCListBase<T, ITYPE, MT> BASE; 47 48 public: 49 /** 50 * Creates a new list. 51 * 52 * This preallocates @a cCapacity elements within the list. 53 * 54 * @param cCapacitiy The initial capacity the list has. 55 * @throws std::bad_alloc 56 */ 57 RTCList(size_t cCapacity = BASE::DefaultCapacity) 58 : BASE(cCapacity) {} 59 60 /* Define our own new and delete. */ 61 RTMEMEF_NEW_AND_DELETE_OPERATORS(); 62 }; 63 64 /** 65 * Specialized thread-safe list class for using with com::ComObjPtr<C> 66 * 67 * @note: This is necessary cause ComObjPtr<IFACE> has a size of 8. 68 */ 69 template <typename C> 70 class RTCMTList< ComObjPtr<C> >: public RTCListBase< ComObjPtr<C>, ComObjPtr<C>*, true> 71 { 72 /* Traits */ 73 typedef ComObjPtr<C> T; 74 typedef T *ITYPE; 75 static const bool MT = true; 76 typedef RTCListBase<T, ITYPE, MT> BASE; 77 78 public: 79 /** 80 * Creates a new list. 81 * 82 * This preallocates @a cCapacity elements within the list. 83 * 84 * @param cCapacitiy The initial capacity the list has. 85 * @throws std::bad_alloc 86 */ 87 RTCList(size_t cCapacity = BASE::DefaultCapacity) 88 : BASE(cCapacity) {} 89 90 /* Define our own new and delete. */ 91 RTMEMEF_NEW_AND_DELETE_OPERATORS(); 92 }; 32 93 33 94 /**
Note:
See TracChangeset
for help on using the changeset viewer.