39 MEDIDTHoder(
bool *isClosedStatus =
nullptr):_isClosedStatus(isClosedStatus) { }
47 *_isClosedStatus =
true;
51 const TIdt& Id()
const override;
53 void Close()
override { this->UnRefFid(); }
57 bool myIsClosed =
false;
58 bool *_isClosedStatus =
nullptr;
65 void Open(
EModeAcces theMode,
TErr* theErr =
nullptr)
override {
if(_effective) _effective->Open(theMode,theErr); }
66 void Close()
override {
if(_effective) _effective->Close(); }
67 const TIdt&
Id()
const override {
if(_effective)
return _effective->Id();
EXCEPTION(std::runtime_error,
"TFileDecorator - GetFid() : no effective TFile !"); }
76 TMemFile(
void **data, std::size_t *sz,
bool* isClosedStatus):
MEDIDTHoder(isClosedStatus),_data(data),_sz(sz) { memfile.app_image_ptr=*data; memfile.app_image_size=*sz; }
77 ~TMemFile() { UnRefFid();
if(myIsClosed) { *_data = memfile.app_image_ptr; *_sz = memfile.app_image_size; } }
79 void *
getData()
const {
return memfile.app_image_ptr; }
80 std::size_t
getSize()
const {
return memfile.app_image_size; }
82 void **_data =
nullptr;
83 std::size_t * _sz =
nullptr;
84 med_memfile memfile = MED_MEMFILE_INIT;
90 TFile(
const std::string& theFileName,
TInt theMajor=-1,
TInt theMinor=-1);
#define MEDWRAPPER_EXPORT
Definition: MED_WrapperDef.hxx:33
#define EXCEPTION(TYPE, MSG)
Definition: UNV_Utilities.hxx:160
Definition: MED_TFile.hxx:37
void Close() override
Definition: MED_TFile.hxx:53
void UnRefFid()
Definition: MED_TFile.hxx:40
~MEDIDTHoder()
Definition: MED_TFile.hxx:52
MEDIDTHoder(bool *isClosedStatus=nullptr)
Definition: MED_TFile.hxx:39
Definition: MED_TFile.hxx:62
~TFileDecorator()
Definition: MED_TFile.hxx:68
TFileDecorator(TFileInternal *effective)
Definition: MED_TFile.hxx:64
void Close() override
Definition: MED_TFile.hxx:66
const TIdt & Id() const override
Definition: MED_TFile.hxx:67
void Open(EModeAcces theMode, TErr *theErr=nullptr) override
Definition: MED_TFile.hxx:65
Definition: MED_TFile.hxx:28
virtual void Open(EModeAcces theMode, TErr *theErr=nullptr)=0
virtual ~TFileInternal()=default
virtual const TIdt & Id() const =0
Definition: MED_TFile.hxx:88
TInt myMinor
Definition: MED_TFile.hxx:95
std::string myFileName
Definition: MED_TFile.hxx:93
TInt myMajor
Definition: MED_TFile.hxx:94
Definition: MED_TFile.hxx:74
TMemFile(void **data, std::size_t *sz, bool *isClosedStatus)
Definition: MED_TFile.hxx:76
std::size_t getSize() const
Definition: MED_TFile.hxx:80
void * getData() const
Definition: MED_TFile.hxx:79
~TMemFile()
Definition: MED_TFile.hxx:77
Definition: MED_Algorithm.cxx:28
herr_t TErr
Definition: MED_Common.hxx:52
med_int TInt
Definition: MED_Common.hxx:50
hid_t TIdt
Definition: MED_Common.hxx:51
EModeAcces
Definition: MED_Wrapper.hxx:38