Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
VariableFactoryRegisterer.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/* VariableFactoryRegisterer.h (C) 2000-2025 */
9/* */
10/* Singleton allowing registration of a variable factory. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_VARIABLEFACTORYREGISTERER_H
13#define ARCANE_CORE_VARIABLEFACTORYREGISTERER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/VariableTypeInfo.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
41class ARCANE_CORE_EXPORT VariableFactoryRegisterer
42{
43 public:
44
45 using VariableFactoryFunc = VariableFactoryVariableRefCreateFunc;
46
47 public:
48
51 VariableFactoryRegisterer(VariableFactoryFunc func, const VariableTypeInfo& var_type_info);
52
53 public:
54
62
65
68
70 eItemKind itemKind() const { return m_variable_type_info.itemKind(); }
71
73 eDataType dataType() const { return m_variable_type_info.dataType(); }
74
76 Integer dimension() const { return m_variable_type_info.dimension(); }
77
79 Integer multiTag() const { return m_variable_type_info.multiTag(); }
80
82 bool isPartial() const { return m_variable_type_info.isPartial(); }
83
86
93
100
101 public:
102
103 static VariableFactoryRegisterer* firstVariableFactory();
104
105 private:
106
108 VariableFactoryFunc m_function;
109
112
115
118};
119
120/*---------------------------------------------------------------------------*/
121/*---------------------------------------------------------------------------*/
122
123} // End namespace Arcane
124
125/*---------------------------------------------------------------------------*/
126/*---------------------------------------------------------------------------*/
127
128#endif
Interface for a variable factory.
VariableFactoryFunc m_function
Creation function for IVariableFactoryFactory.
Integer dimension() const
Dimension of the variable created by this factory.
VariableFactoryRegisterer * m_previous
Previous VariableFactory.
IVariableFactory * createFactory()
Creates a factory for this variable type.
VariableFactoryRegisterer * previousVariableFactory() const
Previous VariableFactory (0 if the first).
VariableFactoryRegisterer * m_next
Next VariableFactory.
void setNextVariableFactory(VariableFactoryRegisterer *s)
Positions the next VariableFactory.
Integer multiTag() const
Tag indicating the multiple type (0 if not multiple, 1 if multiple, 2 if multiple deprecated).
VariableTypeInfo m_variable_type_info
Information about the variable type.
eDataType dataType() const
Data type of the variable created by this factory.
VariableFactoryRegisterer(VariableFactoryFunc func, const VariableTypeInfo &var_type_info)
bool isPartial() const
Indicates if the factory is for a partial variable.
eItemKind itemKind() const
Kind of data variables of the variable created by this factory.
const VariableTypeInfo & variableTypeInfo() const
Information about the variable type.
void setPreviousVariableFactory(VariableFactoryRegisterer *s)
Positions the previous VariableFactory.
VariableFactoryRegisterer * nextVariableFactory() const
Next VariableFactory (0 if the last).
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