Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
VariableFactory.cc
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.cc (C) 2000-2020 */
9/* */
10/* Factory for a variable of a given type. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/ArcanePrecomp.h"
15
16#include "arcane/utils/String.h"
17#include "arcane/utils/OStringStream.h"
18
20#include "arcane/core/VariableFactory.h"
21
22#include <iostream>
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane
28{
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
35 eItemKind item_kind, Integer dimension, Integer multi_tag,
36 bool is_partial)
37: VariableFactory(func, VariableTypeInfo(item_kind, data_type, dimension, multi_tag, is_partial))
38{
39}
40
41/*---------------------------------------------------------------------------*/
42/*---------------------------------------------------------------------------*/
43
45VariableFactory(VariableFactoryFunc func, const VariableTypeInfo& var_type_info)
46: m_function(func)
47, m_variable_type_info(var_type_info)
48{
50}
51
52/*---------------------------------------------------------------------------*/
53/*---------------------------------------------------------------------------*/
54
57{
58 VariableRef* var = (*m_function)(vbi);
59 return var;
60}
61
62/*---------------------------------------------------------------------------*/
63/*---------------------------------------------------------------------------*/
64
65} // End namespace Arcane
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
Declarations of Arcane's general types.
VariableFactoryVariableRefCreateFunc VariableFactoryFunc
Type of the function that creates the variable.
Parameters necessary for building a variable.
VariableTypeInfo m_variable_type_info
Information about the variable type.
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.
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.
String fullName() const
Full name of the variable type.
-- 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