matio-cpp  v0.2.5
A C++ wrapper of the matio library, with memory ownership handling, to read and write .mat files.
SharedMatvar.h
Go to the documentation of this file.
1 #ifndef MATIOCPP_SHAREDMATVAR_H
2 #define MATIOCPP_SHAREDMATVAR_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 
14 
16 {
17 
22 
23 public:
24 
30  SharedMatvar();
31 
36  SharedMatvar(const SharedMatvar& other);
37 
42  SharedMatvar(SharedMatvar&& other);
43 
48  SharedMatvar(matvar_t* inputPtr);
49 
53  ~SharedMatvar();
54 
58  virtual matvar_t* get() const final;
59 
63  virtual bool isShared() const final;
64 
68  virtual bool duplicateMatvar(const matvar_t *inputPtr) final;
69 
73  virtual bool importMatvar(matvar_t *inputPtr) final;
74 
78  virtual MatvarHandler* pointerToDuplicate() const final;
79 
83  virtual WeakMatvar weakOwnership() const final;
84 
88  virtual void dropOwnedPointer(matvar_t* previouslyOwnedPointer) final;
89 
95  SharedMatvar& operator=(const SharedMatvar& other);
96 
103 
109 
116  static SharedMatvar GetMatvarShallowDuplicate(const matvar_t *inputPtr);
117 
118 };
119 
120 #endif // MATIOCPP_SHAREDMATVAR_H
~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.