matio-cpp
v0.2.5
A C++ wrapper of the matio library, with memory ownership handling, to read and write .mat files.
|
#include <matioCpp/WeakMatvar.h>
Public Member Functions | |
WeakMatvar () | |
Default constructor. More... | |
WeakMatvar (const WeakMatvar &other) | |
Copy constructor. More... | |
WeakMatvar (WeakMatvar &&other) | |
Move constructor. More... | |
WeakMatvar (const SharedMatvar &other) | |
Construct a WeakMatvar from a SharedMatvar. More... | |
WeakMatvar (matvar_t *inputPtr, const SharedMatvar &owner, DeleteMode mode=DeleteMode::DoNotDelete) | |
Import an already existing matvar_t pointer which is owned by owner. More... | |
WeakMatvar (matvar_t *inputPtr, const MatvarHandler *owner, DeleteMode mode=DeleteMode::DoNotDelete) | |
Import an already existing matvar_t pointer which is owned by owner. More... | |
~WeakMatvar () | |
Destructor. More... | |
virtual matvar_t * | get () const final |
Docs inherited. More... | |
virtual bool | isShared () const final |
Docs inherited. More... | |
virtual bool | duplicateMatvar (const matvar_t *) final |
Docs inherited. More... | |
virtual bool | importMatvar (matvar_t *) final |
Docs inherited. More... | |
virtual MatvarHandler * | pointerToDuplicate () const final |
Docs inherited. More... | |
virtual WeakMatvar | weakOwnership () const final |
Docs inherited. More... | |
virtual void | dropOwnedPointer (matvar_t *previouslyOwnedPointer) final |
Docs inherited. More... | |
WeakMatvar & | operator= (const WeakMatvar &other) |
Copy assignement. More... | |
WeakMatvar & | operator= (WeakMatvar &&other) |
Move assignement. More... | |
WeakMatvar & | operator= (const SharedMatvar &other) |
Assignement operator from a SharedMatvar. More... | |
Public Member Functions inherited from matioCpp::MatvarHandler | |
MatvarHandler () | |
Default constructor. More... | |
MatvarHandler (matvar_t *inputPtr, matioCpp::DeleteMode deleteMode=matioCpp::DeleteMode::Delete) | |
Constructor from an already existing matvar_t pointer. More... | |
MatvarHandler (const MatvarHandler &other) | |
Copy constructor. More... | |
MatvarHandler (MatvarHandler &&other) | |
Move constructor. More... | |
virtual | ~MatvarHandler () |
Default destructor. More... | |
ValueType | valueType () const |
Get the value type of the pointer. More... | |
VariableType | variableType () const |
Get the variable type of the pointer. More... | |
Friends | |
class | matioCpp::SharedMatvar |
Additional Inherited Members | |
Static Public Member Functions inherited from matioCpp::MatvarHandler | |
static matvar_t * | GetMatvarDuplicate (const matvar_t *inputPtr) |
Get a duplicate of the input matvar pointer/. More... | |
static void | DeleteMatvar (matvar_t *pointerToDelete, DeleteMode mode=DeleteMode::Delete) |
Delete the specified Matvar. More... | |
Protected Attributes inherited from matioCpp::MatvarHandler | |
std::shared_ptr< PointerInfo > | m_ptr |
Shared pointer to a PointerInfo. More... | |
Definition at line 15 of file WeakMatvar.h.
matioCpp::WeakMatvar::WeakMatvar | ( | ) |
Default constructor.
This objects points to no matvar_t.
Definition at line 10 of file WeakMatvar.cpp.
matioCpp::WeakMatvar::WeakMatvar | ( | const WeakMatvar & | other | ) |
Copy constructor.
other | The other object from which to copy. |
Definition at line 15 of file WeakMatvar.cpp.
matioCpp::WeakMatvar::WeakMatvar | ( | matioCpp::WeakMatvar && | other | ) |
Move constructor.
other | The other object from which to get the context. |
Definition at line 22 of file WeakMatvar.cpp.
matioCpp::WeakMatvar::WeakMatvar | ( | const SharedMatvar & | other | ) |
Construct a WeakMatvar from a SharedMatvar.
The WeakMatvar object will have a weak_ptr to the same Ownership object of SharedMatvar. This object will point (in a shared way) to the same matvar_t pointer. The content of matvar_t may be deallocated if all the SharedMatvar objects are deallocated.
other | The input SharedMatvar object. |
Definition at line 29 of file WeakMatvar.cpp.
References matioCpp::MatvarHandler::m_ptr, and matioCpp::SharedMatvar::weakOwnership().
matioCpp::WeakMatvar::WeakMatvar | ( | matvar_t * | inputPtr, |
const SharedMatvar & | owner, | ||
DeleteMode | mode = DeleteMode::DoNotDelete |
||
) |
Import an already existing matvar_t pointer which is owned by owner.
owner needs to make sure that inputPtr is deallocated.
inputPtr | The matvar_t pointer to import |
owner | The owner of inputPtr (the one that takes care of deallocating it) |
mode | Specifies if owner has to deallocate the inputPtr or not |
Definition at line 36 of file WeakMatvar.cpp.
matioCpp::WeakMatvar::WeakMatvar | ( | matvar_t * | inputPtr, |
const MatvarHandler * | owner, | ||
DeleteMode | mode = DeleteMode::DoNotDelete |
||
) |
Import an already existing matvar_t pointer which is owned by owner.
owner needs to make sure that inputPtr is deallocated.
inputPtr | The matvar_t pointer to import |
owner | The owner of inputPtr (the one that takes care of deallocating it) |
mode | Specifies if owner has to deallocate the inputPtr or not |
Definition at line 48 of file WeakMatvar.cpp.
References matioCpp::MatvarHandler::weakOwnership().
matioCpp::WeakMatvar::~WeakMatvar | ( | ) |
Destructor.
Definition at line 60 of file WeakMatvar.cpp.
|
finalvirtual |
|
finalvirtual |
Docs inherited.
This always returns false.
Implements matioCpp::MatvarHandler.
Definition at line 85 of file WeakMatvar.cpp.
References std::endl().
|
finalvirtual |
|
finalvirtual |
Docs inherited.
This always returns false.
Implements matioCpp::MatvarHandler.
Definition at line 92 of file WeakMatvar.cpp.
References std::endl().
|
finalvirtual |
matioCpp::WeakMatvar & matioCpp::WeakMatvar::operator= | ( | const SharedMatvar & | other | ) |
Assignement operator from a SharedMatvar.
other | The SharedMatvar from which to share the ownership and import the matvar_t pointer. |
Definition at line 132 of file WeakMatvar.cpp.
References matioCpp::SharedMatvar::weakOwnership().
matioCpp::WeakMatvar & matioCpp::WeakMatvar::operator= | ( | const WeakMatvar & | other | ) |
Copy assignement.
other | The other object to copy. |
Definition at line 118 of file WeakMatvar.cpp.
References matioCpp::MatvarHandler::m_ptr.
matioCpp::WeakMatvar & matioCpp::WeakMatvar::operator= | ( | matioCpp::WeakMatvar && | other | ) |
Move assignement.
other | The other object to get the context. |
Definition at line 125 of file WeakMatvar.cpp.
|
finalvirtual |
|
finalvirtual |
|
friend |
Definition at line 22 of file WeakMatvar.h.