matio-cpp
v0.3.0
A C++ wrapper of the matio library, with memory ownership handling, to read and write .mat files.
Loading...
Searching...
No Matches
WeakMatvar.h
Go to the documentation of this file.
1
#ifndef MATIOCPP_WEAKMATVAR_H
2
#define MATIOCPP_WEAKMATVAR_H
3
4
/*
5
* Copyright (C) 2020 Fondazione Istituto Italiano di Tecnologia
6
*
7
* This software may be modified and distributed under the terms of the
8
* BSD-2-Clause license (https://opensource.org/licenses/BSD-2-Clause).
9
*/
10
11
#include <
matioCpp/ForwardDeclarations.h
>
12
#include <
matioCpp/MatvarHandler.h
>
13
#include <
matioCpp/SharedMatvar.h
>
14
15
class
matioCpp::WeakMatvar
:
public
matioCpp::MatvarHandler
16
{
20
std::weak_ptr<MatvarHandler::Ownership>
m_ownership;
21
22
friend
class
matioCpp::SharedMatvar
;
23
24
public
:
25
31
WeakMatvar
();
32
37
WeakMatvar
(
const
WeakMatvar
&
other
);
38
43
WeakMatvar
(
WeakMatvar
&&
other
);
44
55
WeakMatvar
(
const
SharedMatvar
&
other
);
56
65
WeakMatvar
(
matvar_t
*
inputPtr
,
const
SharedMatvar
&
owner
,
DeleteMode
mode =
DeleteMode::DoNotDelete
);
66
76
WeakMatvar
(
matvar_t
*
inputPtr
,
const
MatvarHandler
*
owner
,
DeleteMode
mode =
DeleteMode::DoNotDelete
);
77
81
~WeakMatvar
();
82
86
virtual
matvar_t
*
get
()
const
final
;
87
91
virtual
bool
isShared
()
const
final
;
92
98
virtual
bool
duplicateMatvar
(
const
matvar_t
*)
final
;
99
105
virtual
bool
importMatvar
(
matvar_t
*)
final
;
106
110
virtual
MatvarHandler
*
pointerToDuplicate
()
const
final
;
111
115
virtual
WeakMatvar
weakOwnership
()
const
final
;
116
120
virtual
void
dropOwnedPointer
(
matvar_t
*
previouslyOwnedPointer
)
final
;
121
127
WeakMatvar
&
operator
=(
const
WeakMatvar
&
other
);
128
134
WeakMatvar
&
operator
=(
WeakMatvar
&&
other
);
135
141
WeakMatvar
&
operator
=(
const
SharedMatvar
&
other
);
142
143
};
144
145
#endif
// MATIOCPP_WEAKMATVAR_H
ForwardDeclarations.h
MatvarHandler.h
SharedMatvar.h
matioCpp::MatvarHandler
Definition
MatvarHandler.h:14
matioCpp::MultiDimensionalArray
MultiDimensionalArray is a particular type of Variable specialized for multidimensional arrays of a g...
Definition
MultiDimensionalArray.h:22
matioCpp::SharedMatvar
Definition
SharedMatvar.h:16
matioCpp::WeakMatvar
Definition
WeakMatvar.h:16
matioCpp::WeakMatvar::get
virtual matvar_t * get() const final
Docs inherited.
Definition
WeakMatvar.cpp:65
matioCpp::WeakMatvar::WeakMatvar
WeakMatvar()
Default constructor.
Definition
WeakMatvar.cpp:10
matioCpp::WeakMatvar::isShared
virtual bool isShared() const final
Docs inherited.
Definition
WeakMatvar.cpp:80
matioCpp::WeakMatvar::~WeakMatvar
~WeakMatvar()
Destructor.
Definition
WeakMatvar.cpp:60
matioCpp::WeakMatvar::pointerToDuplicate
virtual MatvarHandler * pointerToDuplicate() const final
Docs inherited.
Definition
WeakMatvar.cpp:99
matioCpp::WeakMatvar::importMatvar
virtual bool importMatvar(matvar_t *) final
Docs inherited.
Definition
WeakMatvar.cpp:92
matioCpp::WeakMatvar::weakOwnership
virtual WeakMatvar weakOwnership() const final
Docs inherited.
Definition
WeakMatvar.cpp:104
matioCpp::WeakMatvar::duplicateMatvar
virtual bool duplicateMatvar(const matvar_t *) final
Docs inherited.
Definition
WeakMatvar.cpp:85
matioCpp::WeakMatvar::dropOwnedPointer
virtual void dropOwnedPointer(matvar_t *previouslyOwnedPointer) final
Docs inherited.
Definition
WeakMatvar.cpp:109
matioCpp::DeleteMode
DeleteMode
The delete mode of matvar_t pointers.
Definition
ForwardDeclarations.h:157
matioCpp::DeleteMode::DoNotDelete
@ DoNotDelete
std::weak_ptr
include
matioCpp
WeakMatvar.h
Generated on Thu Feb 27 2025 15:51:20 for matio-cpp by
1.9.8