NeoPZ
TPZRestoredInstance.cpp
Go to the documentation of this file.
1 #include "TPZRestoredInstance.h"
2 #include <stddef.h> // for NULL
3 #include "pzerror.h" // for DebugStop
4 #include "TPZSavable.h"
5 
6 template <class T> class TPZVec;
7 
8 TPZRestoredInstance::TPZRestoredInstance() : mpInstance(NULL), is_already_read(false) {
9 }
10 
12 }
13 
15 
16 }
17 
19  mpInstance = obj;
20 }
21 
23  return mpInstance;
24 }
25 
27 #ifdef PZDEBUG
29  DebugStop();
30  }
31 #endif
34  }
36 }
37 
38 std::shared_ptr<TPZSavable> TPZRestoredInstance::GetSharedPtrToMyObj(){
39 #ifdef PZDEBUG
41  DebugStop();
42  }
43 #endif
45  mSharedPtrToInstance = std::shared_ptr<TPZSavable>(mpInstance);
46  }
47  return mSharedPtrToInstance;
48 }
49 
51  return mPointersVec;
52 }
53 
55  is_already_read = false;
56 }
57 
59  return is_already_read;
60 }
61 
63  is_already_read = true;
64 }
std::shared_ptr< TPZSavable > mSharedPtrToInstance
TPZAutoPointer< TPZSavable > mAutoPointerToInstance
Contains declaration of the TPZSavable class which defines the interface to save and restore objects ...
TPZVec< int > & MyPointersVec()
Defines PZError.
This class implements a simple vector storage scheme for a templated class T. Utility.
Definition: pzgeopoint.h:19
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
TPZAutoPointer< TPZSavable > GetAutoPointerToMyObj()
std::shared_ptr< TPZSavable > GetSharedPtrToMyObj()
TPZManVector< int, 3 > mPointersVec
TPZSavable * GetPointerToMyObj() const
This class defines the interface to save and restore objects from TPZStream objects. Persistency.
Definition: TPZSavable.h:67
void SetInstance(TPZSavable *)
obj
Definition: test.py:225