tailieunhanh - Symbian OS Explained Effective C++ Programming for Smartphones phần 4

hoặc nếu không có đủ bộ nhớ để cấp phát các đối tượng (nghĩa là, nếu các hệ điều hành Symbian đặc biệt tình trạng quá tải của lá điều hành mới) hoặc nếu ConstructL giai đoạn thứ hai () chức năng lá. Nếu xây dựng giai đoạn thứ hai không thành công, ngăn xếp dọn dẹp đảm bảo cả hai đối tượng một phần xây dựng bị phá hủy | Simpo PDF Merge and Split UnregisteredRVersioni-Fhttp unnecessary. However if there are usually 11 objects a granularity of 10 wastes memory for 9 objects unnecessarily. A granularity of 1 would also be foolish since it would incur multiple reallocations. Symbian OS provides a number of different dynamic array classes with names prefixed by CArray such as CArrayFixFlat CAr-rayFixSeg and CArrayVarSeg which I ll refer to collectively as CArrayX as well as the RArray and RPointerArray classes. It can be quite difficult to determine which to use so this chapter guides you through their main characteristics. Choose the granularity of a dynamic array carefully to avoid wasting storage space if the granularity chosen is too large or frequent re-allocations if it is chosen too small . CArrayX Classes There are a number of CArrayX classes which makes this dynamic array family very flexible albeit with an associated performance overhead which I ll discuss later in this chapter. To sidestep the performance penalty the RArray and RPointerArray classes were added to Symbian OS to provide simpler and more efficient dynamic arrays. You should use these classes in preference to CArrayX where possible. However for background information I ll run through some brief details of the CArrayX classes. The naming scheme works as follows for each class the CArray prefix is followed by Fix for elements which have the same length and are copied so they may be contained in the array buffer. Var where the elements are of different lengths each element is contained within its own heap cell and the array buffer contains pointers to the elements. Pak for a packed array where the elements are of variable length they are copied so they may be contained within the array buffer. Each element is preceded by its length information rather like a descriptor. Ptr for an array of pointers to CBase-derived objects. Following this the array class name ends with Flat for classes which use

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.