Commit Graph

3 Commits (aa442e9450c8a288b8aaa2dda79ccb69d8774429)

Author SHA1 Message Date
Giuseppe D'Angelo aa442e9450 Q(E)SDP(V2): fill the API gap left by take()
take() returns a pointer to the shared data object *without*
decrementing the reference counter. The primary use case
is adopting the object from a Q(E)SDP into a different reference
counting mechanism. This is fine, but if we support the
"extraction" part, we shall also support the "adoption" part.
Also, the API for the shared data pointer classes should
match.

Add an adopting tag type and suitable constructors to the
shared data pointer classes, and add take() to the classes
lacking it.

Drive by, apply qExchange to take()'s implementation.

[ChangeLog][QtCore][QAdoptSharedDataTag] New class.
It is now possible to adopt pointers to shared data into
a QExplicitlySharedDataPointer or a QSharedDataPointer object
without incrementing the object's reference counter.

Change-Id: I62b8b005c1bfbe2add58566206fca27634bb7e70
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-16 13:53:03 +02:00
Giuseppe D'Angelo c580a5cdd4 Fix -Wshadow warnings
Turns out headersclean doesn't run on this header...

Change-Id: Ice8691dc0b4b46b2bde38467ca398b61b569a769
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-04 07:12:32 +02:00
Giuseppe D'Angelo a7723f8fa7 Temporarily add a private QESDPv2
To unlock work while waiting for QISP. QESDP is lacking
a few crucial APIs (isDetached() / isShared() / reset(ptr) / deep
const), so we can't go there right away.

Change-Id: I647eb0db4ea800488a323f3b64661e848998168d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-22 16:33:29 +02:00