17 #include <QtCore/QSharedPointer> 29 : mPointer(other.mPointer)
30 , mPointerGuard(other.mPointerGuard)
37 : mPointer(&foreignObject)
45 : mPointer(sharedObject.
data())
46 , mPointerGuard(sharedObject)
53 , mPointerGuard(ownObject)
82 QSharedPointer<T> mPointerGuard;
Definition: analogSensor.h:23
T * operator->()
Operator that allows to access members of stored object.
Definition: differentOwnerPointer.h:58
T & operator*()
Provides reference to stored object.
Definition: differentOwnerPointer.h:64
DifferentOwnerPointer< T > & operator=(const DifferentOwnerPointer< T > &other)=default
Assignment operator to provide value semantics.
DifferentOwnerPointer(T *const ownObject)
Constructor which takes raw pointer and takes ownership over it.
Definition: differentOwnerPointer.h:51
DifferentOwnerPointer(const QSharedPointer< T > &sharedObject)
Constructor which takes shared pointer to object and makes DifferentOwnerPointer behave like shared p...
Definition: differentOwnerPointer.h:44
DifferentOwnerPointer< T > createDifferentOwnerPointer(T &foreignObject)
Helper function that creates DifferentOwnerPointer that does not own object.
Definition: differentOwnerPointer.h:87
DifferentOwnerPointer(T &foreignObject)
Constructor which takes a reference to object owned by someone else, so we need only to store the ref...
Definition: differentOwnerPointer.h:36
T * data() const
Returns raw pointer to an object, does not transfer ownership.
Definition: differentOwnerPointer.h:70
DifferentOwnerPointer(const DifferentOwnerPointer< T > &other)
Copy constructor. Preserves ownership semantics of a copied object.
Definition: differentOwnerPointer.h:28
Smart pointer that can hold two different kinds of pointers: where ownership belongs to someone else ...
Definition: differentOwnerPointer.h:24