X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingTraits.hxx;h=313e2db710d1440284229ac621ef21de1ec86b33;hb=e7a9d4f59978fd384ee98db1dfdd5ec2118331ca;hp=ff5debe4c33f3aa38ad9f9268b8a933850f9c5ed;hpb=3531e8f47b047f0176ec094e51ab2474284f3cd9;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingTraits.hxx b/src/MEDCoupling/MEDCouplingTraits.hxx index ff5debe4c..313e2db71 100644 --- a/src/MEDCoupling/MEDCouplingTraits.hxx +++ b/src/MEDCoupling/MEDCouplingTraits.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2016 CEA/DEN, EDF R&D +// Copyright (C) 2016-2020 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 @@ -18,18 +18,18 @@ // // Author : Anthony Geay (EDF R&D) -#ifndef __MEDCOUPLINGTRAITS_HXX__ -#define __MEDCOUPLINGTRAITS_HXX__ +#pragma once #include "MEDCoupling.hxx" #include "MCType.hxx" +#include namespace MEDCoupling { template struct MEDCOUPLING_EXPORT Traits { - typedef T EltType; + using EltType = T; }; class DataArrayInt32; @@ -40,10 +40,16 @@ namespace MEDCoupling class DataArrayInt64; class MEDCouplingFieldDouble; class MEDCouplingFieldFloat; - class MEDCouplingFieldInt; + 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 @@ -51,10 +57,11 @@ namespace MEDCoupling 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<> @@ -63,10 +70,11 @@ namespace MEDCoupling 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<> @@ -74,10 +82,14 @@ namespace MEDCoupling { static const char ArrayTypeName[]; static const char FieldTypeName[]; - typedef DataArrayInt32 ArrayType; - typedef DataArrayInt32 ArrayTypeCh; - typedef MEDCouplingFieldInt FieldType; - typedef DataArrayInt32Tuple 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<> @@ -86,19 +98,22 @@ namespace MEDCoupling static const char ArrayTypeName[]; static const char FieldTypeName[]; static const char NPYStr[]; - typedef DataArrayInt64 ArrayType; - typedef DataArrayInt64 ArrayTypeCh; - //typedef MEDCouplingFieldInt64 FieldType; - //typedef DataArrayInt64Tuple ArrayTuple; + 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 { static const char ArrayTypeName[]; - typedef DataArrayByte ArrayTypeCh; - typedef DataArrayChar ArrayType; + using ArrayTypeCh = DataArrayByte; + using ArrayType = DataArrayChar; + using ArrayTuple = DataArrayByteTuple; + using IteratorType = DataArrayByteIterator; }; } - -#endif