Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
VariableFactory.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/* VariableFactory.h C) 2000-2025 */
9/* */
10/* Factory for a variable of a given type. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_VARIABLEFACTORY_H
13#define ARCANE_CORE_VARIABLEFACTORY_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/String.h"
18
19#include "arcane/core/IVariableFactory.h"
20#include "arcane/core/VariableTypeInfo.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
36: public IVariableFactory
37{
38 public:
39
50 ARCCORE_DEPRECATED_2020("Use overload with 'VariableTypeInfo' argument")
52 eItemKind item_kind, Integer dimension, Integer multi_tag, bool is_partial);
53 VariableFactory(VariableFactoryFunc func, const VariableTypeInfo& var_type_info);
54
55 public:
56
57 VariableRef* createVariable(const VariableBuildInfo& name) override;
58 eItemKind itemKind() const override { return m_variable_type_info.itemKind(); }
59 eDataType dataType() const override { return m_variable_type_info.dataType(); }
60 Integer dimension() const override { return m_variable_type_info.dimension(); }
61 Integer multiTag() const override { return m_variable_type_info.multiTag(); }
62 bool isPartial() const { return m_variable_type_info.isPartial(); }
63 const String& fullTypeName() const override { return m_full_type_name; }
65
66 private:
67
70
73
76};
77
78/*---------------------------------------------------------------------------*/
79/*---------------------------------------------------------------------------*/
80
81} // End namespace Arcane
82
83/*---------------------------------------------------------------------------*/
84/*---------------------------------------------------------------------------*/
85
86#endif
Interface for a variable factory.
VariableFactoryVariableRefCreateFunc VariableFactoryFunc
Type of the function that creates the variable.
Parameters necessary for building a variable.
VariableTypeInfo variableTypeInfo() const override
Information about the variable type.
VariableTypeInfo m_variable_type_info
Information about the variable type.
Integer multiTag() const override
Multi tag.
eItemKind itemKind() const override
Kind of the data variables created by this factory.
VariableFactoryFunc m_function
Creation function for IVariableFactoryFactory.
VariableFactory(VariableFactoryFunc func, eDataType data_type, eItemKind item_kind, Integer dimension, Integer multi_tag, bool is_partial)
Creates a variable factory.
VariableRef * createVariable(const VariableBuildInfo &name) override
Creates a variable with the build_info and returns its reference.
Integer dimension() const override
Dimension of the variable created by this factory.
eDataType dataType() const override
Data type of the variable created by this factory.
const String & fullTypeName() const override
Full name of the variable type.
String m_full_type_name
Full name of the variable type.
Reference to a variable.
Definition VariableRef.h:56
Information characterizing the type of a variable.
constexpr bool isPartial() const
Indicates if the variable is partial.
-- 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