Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
VariableInfo.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 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/* VariableInfo.h (C) 2000-2025 */
9/* */
10/* Information characterizing a variable. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_VARIABLEINFO_H
13#define ARCANE_CORE_VARIABLEINFO_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/String.h"
18
19#include "arcane/core/datatype/DataStorageTypeInfo.h"
20
22#include "arcane/core/IVariable.h"
23#include "arcane/core/VariableTypeInfo.h"
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28namespace Arcane
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34/*!
35 * \brief Information characterizing a variable.
36 */
37class ARCANE_CORE_EXPORT VariableInfo
38{
39 public:
40
41 ARCCORE_DEPRECATED_2020("Use overload with 'DataStorageTypeInfo' argument")
42 VariableInfo(const String& local_name, const String& item_family_name,
43 const String& item_group_name,
44 const String& mesh_name, eItemKind item_kind,
45 Integer dimension, Integer multi_tag, eDataType type);
46
47 VariableInfo(const String& local_name, const String& item_family_name,
48 const String& item_group_name,
49 const String& mesh_name,
50 const VariableTypeInfo& var_type_info,
51 const DataStorageTypeInfo& storage_info);
52
53 public:
54
55 //! Name of the variable
56 const String& localName() const { return m_local_name; }
57 //! Name of the entity family to which the variable is associated
58 const String& itemFamilyName() const { return m_item_family_name; }
59 //! Name of the entity group to which the variable is associated
60 const String& itemGroupName() const { return m_item_group_name; }
61 //! Name of the mesh to which the variable is associated
62 const String& meshName() const { return m_mesh_name; }
63 //! Full name of the variable (associated with the family)
64 const String& fullName() const
65 {
66 if (m_full_name.null())
67 _computeFullName();
68 return m_full_name;
69 }
70 //! Mesh entity type
71 eItemKind itemKind() const { return m_variable_type_info.itemKind(); }
72 //! Dimension
73 Integer dimension() const { return m_variable_type_info.dimension(); }
74 //! Multi-tag
75 Integer multiTag() const { return m_variable_type_info.multiTag(); }
76 //! Element type
77 eDataType dataType() const { return m_variable_type_info.dataType(); }
78 //! Indicates if the variable is partial
79 bool isPartial() const { return m_variable_type_info.isPartial(); }
80
81 /*!
82 * \brief If null, changes itemGroupName() to the name of the group of all
83 * entities in the family.
84 */
85 void setDefaultItemGroupName();
86
87 //! Information about the variable type.
88 VariableTypeInfo variableTypeInfo() const { return m_variable_type_info; }
89 //! Information about the variable container type
90 DataStorageTypeInfo storageTypeInfo() const { return m_storage_type_info; }
91
92 public:
93
95 _internalGetStorageTypeInfo(eDataType data_type, Integer dimension, Integer multi_tag);
96
97 private:
98
99 //! Name of the variable
100 String m_local_name;
101 //! Name of the entity family to which the variable is associated
102 String m_item_family_name;
103 //! Name of the entity group to which the variable is associated
104 String m_item_group_name;
105 //! Name of the mesh to which the variable is associated
106 String m_mesh_name;
107 //! Full name of the variable (associated with the family)
108 mutable String m_full_name;
109 //! Information about the variable type.
110 VariableTypeInfo m_variable_type_info;
111 //! Information about the variable data container
112 DataStorageTypeInfo m_storage_type_info;
113
114 private:
115
116 String _defaultFamilyName();
117 void _computeFullName() const;
118};
119
120/*---------------------------------------------------------------------------*/
121/*---------------------------------------------------------------------------*/
122
123} // End namespace Arcane
124
125/*---------------------------------------------------------------------------*/
126/*---------------------------------------------------------------------------*/
127
128#endif
Declarations of Arcane's general types.
Type information for a data container.
bool isPartial() const
Indicates if the variable is partial.
const String & itemFamilyName() const
Name of the entity family to which the variable is associated.
const String & localName() const
Name of the variable.
VariableTypeInfo variableTypeInfo() const
Information about the variable type.
Integer multiTag() const
Multi-tag.
eItemKind itemKind() const
Mesh entity type.
const String & itemGroupName() const
Name of the entity group to which the variable is associated.
DataStorageTypeInfo storageTypeInfo() const
Information about the variable container type.
Integer dimension() const
Dimension.
eDataType dataType() const
Element type.
const String & meshName() const
Name of the mesh to which the variable is associated.
const String & fullName() const
Full name of the variable (associated with the family).
Information characterizing the type of a variable.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
eItemKind
Mesh entity type.
eDataType
Data type.
Definition DataTypes.h:41