23 , m_ownership(other.m_ownership)
30 , m_ownership(other.m_ownership)
50 return m_ptr->pointer();
67 m_ownership->dropAll();
82 weak.m_ownership = m_ownership;
89 m_ownership->drop(previouslyOwnedPointer);
94 m_ownership = other.m_ownership;
101 m_ownership = other.m_ownership;
115 output.m_ownership = std::make_shared<MatvarHandler::Ownership>(output.
m_ptr);
The Ownership class is used to define the ownership of a matvar.
static matvar_t * GetMatvarDuplicate(const matvar_t *inputPtr)
Get a duplicate of the input matvar pointer/.
std::shared_ptr< PointerInfo > m_ptr
Shared pointer to a PointerInfo.
~SharedMatvar()
Destructor.
virtual WeakMatvar weakOwnership() const final
Docs inherited.
virtual bool isShared() const final
Docs inherited.
virtual bool importMatvar(matvar_t *inputPtr) final
Docs inherited.
static SharedMatvar GetMatvarShallowDuplicate(const matvar_t *inputPtr)
Get the shallow duplicate of an input Matvar.
SharedMatvar()
Default constructor.
virtual void dropOwnedPointer(matvar_t *previouslyOwnedPointer) final
Docs inherited.
std::weak_ptr< MatvarHandler::Ownership > ownership() const
Get a weak_ptr to the ownership.
virtual matvar_t * get() const final
Docs inherited.
virtual MatvarHandler * pointerToDuplicate() const final
Docs inherited.
virtual bool duplicateMatvar(const matvar_t *inputPtr) final
Docs inherited.
SharedMatvar & operator=(const SharedMatvar &other)
Copy assignement.
@ ShallowDelete
The handler does not delete the pointer.
@ Delete
The handler deletes the pointer but not the data.