1 // Copyright (C) 2020-2024 CEA, EDF
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (EDF R&D)
23 #include "MEDCouplingMemArray.hxx"
28 * Parallel representation of a DataArray
30 * This class is very specific to the requirement of parallel code computations.
32 class ParaDataArray : public RefCountObject
37 class ParaDataArrayTemplate : public ParaDataArray
40 ParaDataArrayTemplate(typename Traits<T>::ArrayType *seqDa);
42 std::size_t getHeapMemorySizeWithoutChildren() const override;
43 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const override;
44 void checkOKOneComponent(const std::string& msg) const;
46 MCAuto<typename Traits<T>::ArrayType> _seq_da;
50 class ParaDataArrayDiscrete : public ParaDataArrayTemplate<T>
53 DataArrayIdType *buildComplement(T nbOfElems) const;
55 ParaDataArrayDiscrete(typename Traits<T>::ArrayType *seqDa):ParaDataArrayTemplate<T>(seqDa) { }
58 class ParaDataArrayInt32 : public ParaDataArrayDiscrete<Int32>
61 static ParaDataArrayInt32 *New(DataArrayInt32 *seqDa);
63 ParaDataArrayInt32(DataArrayInt32 *seqDa):ParaDataArrayDiscrete<Int32>(seqDa) { }
64 std::string getClassName() const override { return "ParaDataArrayInt32"; }
67 class ParaDataArrayInt64 : public ParaDataArrayDiscrete<Int64>
70 static ParaDataArrayInt64 *New(DataArrayInt64 *seqDa);
72 ParaDataArrayInt64(DataArrayInt64 *seqDa):ParaDataArrayDiscrete<Int64>(seqDa) { }
73 std::string getClassName() const override { return "ParaDataArrayInt64"; }
76 #ifndef MEDCOUPLING_USE_64BIT_IDS
77 using ParaDataArrayIdType = ParaDataArrayInt32;
79 using ParaDataArrayIdType = ParaDataArrayInt64;