Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ArrayTraits.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* ArrayTraits.h (C) 2000-2024 */
9/* */
10/* Caractéristiques d'un tableau 1D. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_COLLECTIONS_ARRAYTRAITS_H
13#define ARCCORE_COLLECTIONS_ARRAYTRAITS_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/collections/CollectionsGlobal.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arccore
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
40template <typename T>
42{
43 public:
44
45 typedef const T& ConstReferenceType;
46 typedef FalseType IsPODType;
47};
48
49/*---------------------------------------------------------------------------*/
50/*---------------------------------------------------------------------------*/
51
59#define ARCCORE_DEFINE_ARRAY_PODTYPE(datatype) \
60 template <> \
61 class ArrayTraits<datatype> \
62 { \
63 public: \
64\
65 typedef datatype ConstReferenceType; \
66 typedef TrueType IsPODType; \
67 }
68
69/*---------------------------------------------------------------------------*/
70/*---------------------------------------------------------------------------*/
72template <typename T>
73class ArrayTraits<T*>
74{
75 public:
76
77 typedef T* Ptr;
78 typedef const Ptr& ConstReferenceType;
79 typedef FalseType IsPODType;
80};
81
83template <typename T>
84class ArrayTraits<const T*>
85{
86 public:
87
88 typedef T* Ptr;
89 typedef const T* ConstReferenceType;
90 typedef FalseType IsPODType;
91};
92
93/*---------------------------------------------------------------------------*/
94/*---------------------------------------------------------------------------*/
95
96ARCCORE_DEFINE_ARRAY_PODTYPE(char);
97ARCCORE_DEFINE_ARRAY_PODTYPE(signed char);
98ARCCORE_DEFINE_ARRAY_PODTYPE(unsigned char);
99ARCCORE_DEFINE_ARRAY_PODTYPE(short);
100ARCCORE_DEFINE_ARRAY_PODTYPE(int);
101ARCCORE_DEFINE_ARRAY_PODTYPE(long);
102ARCCORE_DEFINE_ARRAY_PODTYPE(unsigned short);
103ARCCORE_DEFINE_ARRAY_PODTYPE(unsigned int);
104ARCCORE_DEFINE_ARRAY_PODTYPE(unsigned long);
105ARCCORE_DEFINE_ARRAY_PODTYPE(float);
106ARCCORE_DEFINE_ARRAY_PODTYPE(double);
107ARCCORE_DEFINE_ARRAY_PODTYPE(long double);
108ARCCORE_DEFINE_ARRAY_PODTYPE(std::byte);
109ARCCORE_DEFINE_ARRAY_PODTYPE(Float16);
110ARCCORE_DEFINE_ARRAY_PODTYPE(BFloat16);
111
112/*---------------------------------------------------------------------------*/
113/*---------------------------------------------------------------------------*/
114
115} // namespace Arccore
116
117/*---------------------------------------------------------------------------*/
118/*---------------------------------------------------------------------------*/
119
120#endif
Caractéristiques pour un tableau.
Definition ArrayTraits.h:42
Type flottant demi-précision.
Espace de nom de Arccore.
Definition ArcaneTypes.h:24
Structure équivalente à la valeur booléenne vrai.