matio-cpp  v0.2.5
A C++ wrapper of the matio library, with memory ownership handling, to read and write .mat files.
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 
12 #include <matioCpp/MatvarHandler.h>
13 #include <matioCpp/SharedMatvar.h>
14 
16 {
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
virtual matvar_t * get() const final
Docs inherited.
Definition: WeakMatvar.cpp:65
WeakMatvar()
Default constructor.
Definition: WeakMatvar.cpp:10
virtual bool isShared() const final
Docs inherited.
Definition: WeakMatvar.cpp:80
~WeakMatvar()
Destructor.
Definition: WeakMatvar.cpp:60
virtual MatvarHandler * pointerToDuplicate() const final
Docs inherited.
Definition: WeakMatvar.cpp:99
virtual bool importMatvar(matvar_t *) final
Docs inherited.
Definition: WeakMatvar.cpp:92
virtual WeakMatvar weakOwnership() const final
Docs inherited.
Definition: WeakMatvar.cpp:104
virtual bool duplicateMatvar(const matvar_t *) final
Docs inherited.
Definition: WeakMatvar.cpp:85
virtual void dropOwnedPointer(matvar_t *previouslyOwnedPointer) final
Docs inherited.
Definition: WeakMatvar.cpp:109
DeleteMode
The delete mode of matvar_t pointers.