Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IVariableFactory.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/* IVariableFactory.h C) 2000-2025 */
9/* */
10/* Interface for a factory of a variable of a given type. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IVARIABLEFACTORY_H
13#define ARCANE_CORE_IVARIABLEFACTORY_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28/*!
29 * \internal
30 * \brief Interface for a variable factory.
31 *
32 The instance allows creating a variable based on its data type (dataType()),
33 its entity kind (itemKind()), its dimension (dimension()), and its tag if it
34 is a multi-array (multiTag()).
35
36 The fullTypeName() operation contains the complete type name, obtained in the
37 following way: dataType().itemKind().dimension().multiTag. For example, for a
38 real scalar variable on the cells, the complete type is: \a "Real.Cell.0.0".
39 */
41{
42 public:
43
44 //! Type of the function that creates the variable
45 using VariableFactoryFunc = VariableFactoryVariableRefCreateFunc;
46
47 public:
48
49 virtual ~IVariableFactory() = default;
50
51 public:
52
53 //! Creates a variable with the \a build_info and returns its reference.
54 virtual VariableRef* createVariable(const VariableBuildInfo& build_info) = 0;
55
56 public:
57
58 //! Kind of the data variables created by this factory
59 virtual eItemKind itemKind() const = 0;
60
61 //! Data type of the variable created by this factory
62 virtual eDataType dataType() const = 0;
63
64 //! Dimension of the variable created by this factory
65 virtual Integer dimension() const = 0;
66
67 //! Multi tag.
68 virtual Integer multiTag() const = 0;
69
70 //! Full name of the variable type
71 virtual const String& fullTypeName() const = 0;
72
73 public:
74
75 //! Information about the variable type
77};
78
79/*---------------------------------------------------------------------------*/
80/*---------------------------------------------------------------------------*/
81
82} // End namespace Arcane
83
84/*---------------------------------------------------------------------------*/
85/*---------------------------------------------------------------------------*/
86
87#endif
Declarations of Arcane's general types.
virtual eItemKind itemKind() const =0
Kind of the data variables created by this factory.
VariableFactoryVariableRefCreateFunc VariableFactoryFunc
Type of the function that creates the variable.
virtual Integer multiTag() const =0
Multi tag.
virtual VariableRef * createVariable(const VariableBuildInfo &build_info)=0
Creates a variable with the build_info and returns its reference.
virtual VariableTypeInfo variableTypeInfo() const =0
Information about the variable type.
virtual eDataType dataType() const =0
Data type of the variable created by this factory.
virtual const String & fullTypeName() const =0
Full name of the variable type.
virtual Integer dimension() const =0
Dimension of the variable created by this factory.
Parameters necessary for building a variable.
Reference to a variable.
Definition VariableRef.h:56
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