Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
VariableDataInfo.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/* VariableDataInfo.h (C) 2000-2024 */
9/* */
10/* Informations sur les données d'une variable. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13#ifndef ARCANE_STD_INTERNAL_VARIABLEDATAINFO_H
14#define ARCANE_STD_INTERNAL_VARIABLEDATAINFO_H
15/*---------------------------------------------------------------------------*/
16/*---------------------------------------------------------------------------*/
17
18#include "arcane/utils/String.h"
19#include "arcane/utils/ArrayShape.h"
20
22#include "arcane/core/XmlNode.h"
23
24#include <map>
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29namespace Arcane::impl
30{
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
38{
39 friend class VariableDataInfoMap;
40
41 private:
42
43 static constexpr const char* V_NB_DIMENSION = "nb-dimension";
44 static constexpr const char* V_DIM1_SIZE = "dim1-size";
45 static constexpr const char* V_DIM2_SIZE = "dim2-size";
46 static constexpr const char* V_NB_ELEMENT = "nb-element";
47 static constexpr const char* V_NB_BASE_ELEMENT = "nb-base-element";
48 static constexpr const char* V_DIMENSION_ARRAY_SIZE = "dimension-array-size";
49 static constexpr const char* V_IS_MULTI_SIZE = "is-multi-size";
50 static constexpr const char* V_BASE_DATA_TYPE = "base-data-type";
51 static constexpr const char* V_MEMORY_SIZE = "memory-size";
52 static constexpr const char* V_FILE_OFFSET = "file-offset";
53 static constexpr const char* V_SHAPE_SIZE = "shape-size";
54 static constexpr const char* V_SHAPE = "shape";
55 static constexpr const char* V_COMPARISON_HASH = "comparison-hash";
56
57 private:
58
60 VariableDataInfo(const String& full_name, const XmlNode& element);
62
63 public:
64
65 const String& fullName() const { return m_full_name; }
66 Integer nbDimension() const { return m_nb_dimension; }
67 Int64 dim1Size() const { return m_dim1_size; }
68 Int64 dim2Size() const { return m_dim2_size; }
69 Int64 nbElement() const { return m_nb_element; }
70 Int64 nbBaseElement() const { return m_nb_base_element; }
71 Integer dimensionArraySize() const { return m_dimension_array_size; }
72 bool isMultiSize() const { return m_is_multi_size; }
73 eDataType baseDataType() const { return m_base_data_type; }
74 Int64 memorySize() const { return m_memory_size; }
75 const ArrayShape& shape() const { return m_shape; }
76 void setFileOffset(Int64 v) { m_file_offset = v; }
77 Int64 fileOffset() const { return m_file_offset; }
78 void setComparisonHashValue(const String& v) { m_comparison_hash_value = v; }
79 const String& comparisonHashValue() const { return m_comparison_hash_value; }
80
81 public:
82
83 void write(XmlNode element,JSONWriter& writer) const;
84
85 private:
86
87 String m_full_name;
88 Integer m_nb_dimension = 0;
89 Int64 m_dim1_size = 0;
90 Int64 m_dim2_size = 0;
91 Int64 m_nb_element = 0;
92 Int64 m_nb_base_element = 0;
93 Integer m_dimension_array_size = 0;
94 bool m_is_multi_size = false;
95 eDataType m_base_data_type = DT_Unknown;
96 Int64 m_memory_size = 0;
97 Int64 m_file_offset = 0;
98 ArrayShape m_shape;
99 String m_comparison_hash_value;
100
101 private:
102
103 void _write(XmlNode element) const;
104 void _write(JSONWriter& writer) const;
105};
106
107/*---------------------------------------------------------------------------*/
108/*---------------------------------------------------------------------------*/
113{
114 using MapType = std::map<String, Ref<VariableDataInfo>>;
115
116 public:
117
118 using const_iterator = MapType::const_iterator;
119
120 public:
121
125 Ref<VariableDataInfo> add(const String& full_name, const XmlNode& node);
128
131
133 const_iterator begin() const { return m_data_info_map.begin(); }
134 const_iterator end() const { return m_data_info_map.end(); }
136
137 private:
138
139 MapType m_data_info_map;
140
141 private:
142
144};
145
146/*---------------------------------------------------------------------------*/
147/*---------------------------------------------------------------------------*/
148
149} // namespace Arcane::impl
150
151/*---------------------------------------------------------------------------*/
152/*---------------------------------------------------------------------------*/
153
154#endif
Déclarations des types généraux de Arcane.
Forme d'un tableau.
Definition ArrayShape.h:40
Interface d'une donnée sérialisée.
Représente une valeur JSON.
Definition JSONReader.h:43
Ecrivain au format JSON.
Definition JSONWriter.h:33
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Noeud d'un arbre DOM.
Definition XmlNode.h:51
Tableau associatif des données des variables.
Ref< VariableDataInfo > add(const String &full_name, const ISerializedData *sdata)
Ajoute une variable.
Ref< VariableDataInfo > find(const String &full_name) const
Retourne la variable de nom full_name. Retourne null si non trouvé.
Informations sur les données d'une variable.
Chaîne de caractères unicode.
eDataType
Type d'une donnée.
Definition DataTypes.h:39
@ DT_Unknown
Donnée de type inconnue ou non initialisée.
Definition DataTypes.h:54