Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
VariableMetaData.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/* VariableMetaData.h C) 2000-2023 */
9/* */
10/* Metadata on a variable. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_VARIABLEMETADATA_H
13#define ARCANE_CORE_VARIABLEMETADATA_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/String.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28/*!
29 * \brief Metadata on a variable.
30 *
31 * The information in this class allows for the reconstruction of a
32 * variable.
33 *
34 * If hash2() is not null, it is used. Otherwise, hash() is used.
35 */
36class ARCANE_CORE_EXPORT VariableMetaData
37{
38 public:
39
40 /*!
41 * \brief Constructor.
42 *
43 * Constructs the instance for a variable with name \a base_name,
44 * from family \a item_family_name and group \a item_group_name.
45 * If the variable is not on a mesh, then \a mesh_name,
46 * \a item_family_name and \a item_group_name are null.
47 */
48 VariableMetaData(const String& base_name, const String& mesh_name,
49 const String& item_family_name, const String& item_group_name,
50 bool is_partial);
51
52 public:
53
54 //! Full name of the variable
55 String fullName() const { return m_full_name; }
56 //! Base name of the variable
57 String baseName() const { return m_base_name; }
58 String meshName() const { return m_mesh_name; }
59 String itemFamilyName() const { return m_item_family_name; }
60 String itemGroupName() const { return m_item_group_name; }
61 bool isPartial() const { return m_is_partial; }
62
63 String fullType() const { return m_full_type; }
64 void setFullType(const String& v) { m_full_type = v; }
65
66 //! Hash of the variable in hexadecimal format
67 String hash() const { return m_hash_str; }
68 void setHash(const String& v) { m_hash_str = v; }
69
70 //! Hash of the variable in hexadecimal format
71 String hash2() const { return m_hash2_str; }
72 void setHash2(const String& v) { m_hash2_str = v; }
73
74 //! Hash version (associated with hash2())
75 Int32 hashVersion() const { return m_hash_version; }
76 void setHashVersion(Int32 v) { m_hash_version = v; }
77
78 Integer property() const { return m_property; }
79 void setProperty(Integer v) { m_property = v; }
80
81 String multiTag() const { return m_multi_tag; }
82 void setMultiTag(const String& v) { m_multi_tag = v; }
83
84 private:
85
86 String m_base_name;
87 String m_mesh_name;
88 String m_item_family_name;
89 String m_item_group_name;
90 String m_full_type;
91 String m_hash_str;
92 Integer m_property;
93 String m_multi_tag;
94 String m_full_name;
95 bool m_is_partial;
96 String m_hash2_str;
97 Int32 m_hash_version = 0;
98
99 private:
100
101 void _buildFullName();
102};
103
104/*---------------------------------------------------------------------------*/
105/*---------------------------------------------------------------------------*/
106
107} // End namespace Arcane
108
109/*---------------------------------------------------------------------------*/
110/*---------------------------------------------------------------------------*/
111
112#endif
VariableMetaData(const String &base_name, const String &mesh_name, const String &item_family_name, const String &item_group_name, bool is_partial)
Constructor.
String hash() const
Hash of the variable in hexadecimal format.
String hash2() const
Hash of the variable in hexadecimal format.
Int32 hashVersion() const
Hash version (associated with hash2()).
String fullName() const
Full name of the variable.
String baseName() const
Base name of the variable.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
std::int32_t Int32
Signed integer type of 32 bits.