X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FMEDFileData.hxx;h=9f7427af23d24e8b9d5d0b2078ab0e31cce7d3f5;hb=844b1a4785909ad42206965838a6d0f826dfb5c1;hp=64b946ec0d1ef3b33c1165d0ccf4b48dd4141692;hpb=293a6104470482e450701aa8061d9b244f2057d5;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/MEDFileData.hxx b/src/MEDLoader/MEDFileData.hxx index 64b946ec0..9f7427af2 100644 --- a/src/MEDLoader/MEDFileData.hxx +++ b/src/MEDLoader/MEDFileData.hxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D +// Copyright (C) 2007-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -21,39 +21,62 @@ #ifndef __MEDFILEDATA_HXX__ #define __MEDFILEDATA_HXX__ -#include "MEDCouplingAutoRefCountObjectPtr.hxx" +#include "MCAuto.hxx" +#include "MEDFileParameter.hxx" #include "MEDFileField.hxx" #include "MEDFileMesh.hxx" +#include "MEDFileMeshSupport.hxx" +#include "MEDFileStructureElement.hxx" -namespace ParaMEDMEM +namespace MEDCoupling { /*! * User class. */ - class MEDLOADER_EXPORT MEDFileData : public RefCountObject, public MEDFileWritable + class MEDFileData : public RefCountObject, public MEDFileWritableStandAlone { public: - static MEDFileData *New(const char *fileName) throw(INTERP_KERNEL::Exception); - static MEDFileData *New(); - MEDFileFields *getFields() const; - MEDFileMeshes *getMeshes() const; - void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception); - void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception); - int getNumberOfFields() const throw(INTERP_KERNEL::Exception); - int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception); - std::string simpleRepr() const; + MEDLOADER_EXPORT static MEDFileData *New(const std::string& fileName); + MEDLOADER_EXPORT static MEDFileData *New(med_idt fid); + MEDLOADER_EXPORT static MEDFileData *New(); + MEDLOADER_EXPORT static MEDFileData *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } + MEDLOADER_EXPORT MEDFileData *deepCopy() const; + MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; + MEDLOADER_EXPORT MEDFileFields *getFields() const; + MEDLOADER_EXPORT MEDFileMeshes *getMeshes() const; + MEDLOADER_EXPORT MEDFileParameters *getParams() const; + MEDLOADER_EXPORT void setFields(MEDFileFields *fields); + MEDLOADER_EXPORT void setMeshes(MEDFileMeshes *meshes); + MEDLOADER_EXPORT void setParams(MEDFileParameters *params); + MEDLOADER_EXPORT int getNumberOfFields() const; + MEDLOADER_EXPORT int getNumberOfMeshes() const; + MEDLOADER_EXPORT int getNumberOfParams() const; + MEDLOADER_EXPORT std::string simpleRepr() const; // - bool changeMeshNames(const std::vector< std::pair >& modifTab) throw(INTERP_KERNEL::Exception); - bool changeMeshName(const char *oldMeshName, const char *newMeshName) throw(INTERP_KERNEL::Exception); - bool unPolyzeMeshes() throw(INTERP_KERNEL::Exception); + MEDLOADER_EXPORT std::string getHeader() const; + MEDLOADER_EXPORT void setHeader(const std::string& header); // - void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception); + MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair >& modifTab); + MEDLOADER_EXPORT bool changeMeshName(const std::string& oldMeshName, const std::string& newMeshName); + MEDLOADER_EXPORT bool unPolyzeMeshes(); + MEDLOADER_EXPORT void dealWithStructureElements(); + MEDLOADER_EXPORT static MCAuto Aggregate(const std::vector& mfds); + // + MEDLOADER_EXPORT void writeLL(med_idt fid) const; private: MEDFileData(); - MEDFileData(const char *fileName) throw(INTERP_KERNEL::Exception); + MEDFileData(med_idt fid); + void readHeader(med_idt fid); + void writeHeader(med_idt fid) const; + void readMeshSupports(med_idt fid); private: - MEDCouplingAutoRefCountObjectPtr _fields; - MEDCouplingAutoRefCountObjectPtr _meshes; + MCAuto _fields; + MCAuto _meshes; + MCAuto _params; + MCAuto _mesh_supports; + MCAuto _struct_elems; + std::string _header; }; }