#pragma once
#include "MED_Wrapper.hxx"
+#include "MED_WrapperDef.hxx"
namespace MED
{
virtual const TIdt& Id() const = 0;
};
- class MEDIDTHoder : public TFileInternal
+ class MEDWRAPPER_EXPORT MEDIDTHoder : public TFileInternal
{
protected:
MEDIDTHoder(bool *isClosedStatus = nullptr):_isClosedStatus(isClosedStatus) { }
bool *_isClosedStatus = nullptr;
};
- class TFileDecorator : public TFileInternal
+ class MEDWRAPPER_EXPORT TFileDecorator : public TFileInternal
{
public:
TFileDecorator(TFileInternal *effective):_effective(effective) { }
TFileInternal *_effective = nullptr;
};
- class TMemFile : public MEDIDTHoder
+ class MEDWRAPPER_EXPORT TMemFile : public MEDIDTHoder
{
public:
- TMemFile(bool* isClosedStatus = nullptr):MEDIDTHoder(isClosedStatus) { }
+ 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; }
+ ~TMemFile() { UnRefFid(); if(myIsClosed) { *_data = memfile.app_image_ptr; *_sz = memfile.app_image_size; } }
void Open(EModeAcces theMode, TErr* theErr = nullptr) override;
void *getData() const { return memfile.app_image_ptr; }
std::size_t getSize() const { return memfile.app_image_size; }
private:
+ void **_data = nullptr;
+ std::size_t * _sz = nullptr;
med_memfile memfile = MED_MEMFILE_INIT;
};
- class TFile : public MEDIDTHoder
+ class MEDWRAPPER_EXPORT TFile : public MEDIDTHoder
{
public:
TFile(const std::string& theFileName, TInt theMajor=-1, TInt theMinor=-1);