17 , m_ownership(other.m_ownership)
24 , m_ownership(other.m_ownership)
32 m_ownership = otherWeak.m_ownership;
33 m_ptr = otherWeak.
m_ptr;
38 , m_ownership(owner.ownership())
41 auto locked = m_ownership.lock();
44 locked->own(inputPtr, &owner, mode);
51 m_ptr = std::make_shared<PointerInfo>(inputPtr, mode);
53 auto locked = m_ownership.lock();
56 locked->own(inputPtr, owner, mode);
68 auto locked = m_ownership.lock();
70 if (locked && locked->isOwning(m_ptr->pointer()))
72 return m_ptr->pointer();
87 std::cerr <<
"[ERROR][matioCpp::WeakMatvar::duplicateFromMatio] Cannot duplicate from inputPtr. A WeakMatvar cannot modify the matvar pointer." <<
std::endl;
94 std::cerr <<
"[ERROR][matioCpp::WeakMatvar::importMatvar] Cannot import inputPtr. A WeakMatvar cannot modify the matvar pointer." <<
std::endl;
111 auto locked = m_ownership.lock();
114 locked->drop(previouslyOwnedPointer);
120 m_ownership = other.m_ownership;
127 m_ownership = other.m_ownership;
std::shared_ptr< PointerInfo > m_ptr
Shared pointer to a PointerInfo.
virtual WeakMatvar weakOwnership() const =0
Get a WeakMatvar version of the current MatvarHandler.
virtual WeakMatvar weakOwnership() const final
Docs inherited.
virtual matvar_t * get() const final
Docs inherited.
WeakMatvar()
Default constructor.
virtual bool isShared() const final
Docs inherited.
WeakMatvar & operator=(const WeakMatvar &other)
Copy assignement.
virtual MatvarHandler * pointerToDuplicate() const final
Docs inherited.
virtual bool importMatvar(matvar_t *) final
Docs inherited.
virtual WeakMatvar weakOwnership() const final
Docs inherited.
virtual bool duplicateMatvar(const matvar_t *) final
Docs inherited.
virtual void dropOwnedPointer(matvar_t *previouslyOwnedPointer) final
Docs inherited.
DeleteMode
The delete mode of matvar_t pointers.