summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qarraydataops.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Add erase operation to QArrayDataOpsJoão Abecasis2012-07-031-0/+63
| | | | | Change-Id: I37d3ac465f5beddb5038e22e9cda32acb16c78fc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix compilation of tests/auto/corelib/tools with QT_STRICT_ITERATORSThiago Macieira2012-06-121-1/+1
| | | | | | | | | Most fixes are simple and quite obvious. The ones more involved are the ones to QArrayData, which had probably not been compiled with strict iterators thus far. Change-Id: Ic4ff84c34fd9a04fd686fecaa98149b1c47c9346 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Introduce QArrayDataOps::truncateJoão Abecasis2012-04-021-0/+20
| | | | | | | | | | | | | | This enables a truncating resize() to be implemented. It is similar to destroyAll(), but updates the size() as it goes, so it is safe to use outside a container's destructor (and doesn't necessarily destroy all elements). The appendInitialize test was repurposed and now doubles as an additional test for QArrayDataOps as well as exercising SimpleVector's resize(). Change-Id: Iee94a685c9ea436c6af5b1b77486734a38c49ca1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Introduce QArrayDataOps::appendInitializeJoão Abecasis2012-04-021-0/+23
| | | | | | | | | | | | | Adds given number of default-initialized elements at end of array. For POD types, initialization is reduced to a single memset call. Other types get default constructed in place. As part of adding a test for the new functionality the arrayOps test was extended to verify objects are being constructed and assigned as desired. Change-Id: I9fb2afe0d92667e76993313fcd370fe129d72b90 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix warnings on shadowing data members with argumentsJoão Abecasis2012-02-221-8/+8
| | | | | | | | | Example emitted by GCC 4.2.1: warning: declaration of ‘iter’ shadows a member of 'this' Change-Id: I288da01c511a1404bf41881a6c96a5f3cd00d0a7 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Remove use of QT_MODULE from QArrayData stackJoão Abecasis2012-02-061-2/+0
| | | | | | | | The macro was made empty in 4ecf82795de54fba530ac9c386f3afff2174edbd, and is no longer necessary or used. Change-Id: If000ff51729e41bdcd1b0409961cf94d50e5f172 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update license headersJoão Abecasis2012-02-061-3/+3
| | | | | | | | | | | - Updated copyright year, per 1fdfc2abfe1fa26b86028934d4853432e25b4655 - Updated contact information, 629d6eda5cf67122776981de9073857bbc3dcba2 - Drop "All rights reserved", 5635823e17db3395d9b0fa8cfcc72f82fea583f4 (Empty line added to maintain license header line count) Change-Id: Ie401e2b6e40a4b79f4191377dd50dc60be801e1f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't use RefCount int operationsJoão Abecasis2012-01-171-2/+2
| | | | | | | | | | , as those are going away. This cleans use of those operations in the QArrayData stack. Change-Id: I67705fe0a2f8d99ea13739b675021356a5736f83 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: hjk <qthjk@ovi.com>
* Add setSharable support in QArrayData stackJoão Abecasis2012-01-061-7/+7
| | | | | | | | | | | | | | | Making use of the same feature added in RefCount. To keep with the intention of avoiding the allocation of "empty" array headers, this introduces an unsharable_empty, which allows users to maintain the "unsharable bit" on empty containers, without imposing any actual allocations. (Before anyone asks, there is no point to a zero-sized capacity-reserved container so no other combinations are needed for now.) Change-Id: Icaa40ac3100ad954fdc20dee0c991861136a5b19 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* QArrayDataOps::insertJoão Abecasis2011-12-141-0/+142
| | | | | | | | | | | | | | | | | | | | | | | Inserting elements anywhere in the array requires moving the elements that follow out of the way and writing in the new ones. Trivial for PODs and almost as much for movable types. For "complex" types, we start by extending the array with placement new and copy constructing elements. Then, copy assignment resets the elements that were previously part of the array. QPodArrayOps uses non-throwing operations. QMovableArrayOps provides full rollback in the face of exceptions (strong guarantee). QGenericArrayOps enforces that no data is leaked (all destructors called) and invariants are maintained on exceptions -- the basic guarantee. With 3 different implementations, 2 of which are non-trivial, this operation is a good showcase for QArrayOpsSelector and the different implementations. As such, it warrants its own commit. Change-Id: I21d9b4cb8e810db82623bcd1d78f583ebf3b6cb7 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* QArrayDataOps: generic array operationsJoão Abecasis2011-12-141-0/+182
This class, the selector and underlying implementations provide specialized operations on QArrayData, while allowing for optimized implementations that benefit from type-specific information. Currently, offering a generic implementation and specializations for PODs (trivial ctor, dtor and move operations) and movable types (can be trivially moved in memory). Change-Id: I2c5829b66c2aea79f12f21debe5c01f7104c7ea3 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>