-// Copyright (C) 2016 CEA/DEN, EDF R&D
+// Copyright (C) 2016-2024 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// Author : Anthony Geay (EDF R&D)
-#ifndef __MEDCOUPLINGTRAITS_HXX__
-#define __MEDCOUPLINGTRAITS_HXX__
+#pragma once
#include "MEDCoupling.hxx"
+#include "MCType.hxx"
+#include <vector>
namespace MEDCoupling
{
template<class T>
struct MEDCOUPLING_EXPORT Traits
{
- typedef T EltType;
+ using EltType = T;
};
- class DataArrayInt;
+ class DataArrayInt32;
class DataArrayFloat;
class DataArrayDouble;
class DataArrayChar;
class DataArrayByte;
+ class DataArrayInt64;
class MEDCouplingFieldDouble;
class MEDCouplingFieldFloat;
- class MEDCouplingFieldInt;
- class DataArrayIntTuple;
+ class MEDCouplingFieldInt32;
+ class MEDCouplingFieldInt64;
+ class DataArrayInt32Tuple;
+ class DataArrayInt64Tuple;
class DataArrayFloatTuple;
class DataArrayDoubleTuple;
+ class DataArrayByteTuple;
+ class DataArrayInt32Iterator;
+ class DataArrayInt64Iterator;
+ class DataArrayByteIterator;
template<>
struct MEDCOUPLING_EXPORT Traits<double>
static const char ArrayTypeName[];
static const char FieldTypeName[];
static const char NPYStr[];
- typedef DataArrayDouble ArrayType;
- typedef DataArrayDouble ArrayTypeCh;
- typedef MEDCouplingFieldDouble FieldType;
- typedef DataArrayDoubleTuple ArrayTuple;
+ static const char ReprStr[];
+ using ArrayType = DataArrayDouble;
+ using ArrayTypeCh = DataArrayDouble;
+ using FieldType = MEDCouplingFieldDouble;
+ using ArrayTuple = DataArrayDoubleTuple;
};
template<>
static const char ArrayTypeName[];
static const char FieldTypeName[];
static const char NPYStr[];
- typedef DataArrayFloat ArrayType;
- typedef DataArrayFloat ArrayTypeCh;
- typedef MEDCouplingFieldFloat FieldType;
- typedef DataArrayFloatTuple ArrayTuple;
+ static const char ReprStr[];
+ using ArrayType = DataArrayFloat;
+ using ArrayTypeCh = DataArrayFloat;
+ using FieldType = MEDCouplingFieldFloat;
+ using ArrayTuple = DataArrayFloatTuple;
};
template<>
- struct MEDCOUPLING_EXPORT Traits<int>
+ struct MEDCOUPLING_EXPORT Traits<Int32>
{
static const char ArrayTypeName[];
static const char FieldTypeName[];
- typedef DataArrayInt ArrayType;
- typedef DataArrayInt ArrayTypeCh;
- typedef MEDCouplingFieldInt FieldType;
- typedef DataArrayIntTuple ArrayTuple;
+ static const char NPYStr[];
+ static const char ReprStr[];
+ static const char VTKReprStr[];
+ using ArrayType = DataArrayInt32;
+ using ArrayTypeCh = DataArrayInt32;
+ using FieldType = MEDCouplingFieldInt32;
+ using ArrayTuple = DataArrayInt32Tuple;
+ using IteratorType = DataArrayInt32Iterator;
+ };
+
+ template<>
+ struct MEDCOUPLING_EXPORT Traits<Int64>
+ {
+ static const char ArrayTypeName[];
+ static const char FieldTypeName[];
+ static const char NPYStr[];
+ static const char ReprStr[];
+ static const char VTKReprStr[];
+ using ArrayType = DataArrayInt64;
+ using ArrayTypeCh = DataArrayInt64;
+ using FieldType = MEDCouplingFieldInt64;
+ using ArrayTuple = DataArrayInt64Tuple;
+ using IteratorType = DataArrayInt64Iterator;
};
template<>
struct MEDCOUPLING_EXPORT Traits<char>
{
static const char ArrayTypeName[];
- typedef DataArrayByte ArrayTypeCh;
- typedef DataArrayChar ArrayType;
+ using ArrayTypeCh = DataArrayByte;
+ using ArrayType = DataArrayChar;
+ using ArrayTuple = DataArrayByteTuple;
+ using IteratorType = DataArrayByteIterator;
};
}
-
-#endif