Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
VariableFactoryRegisterer.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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.cc (C) 2000-2020 */
9/* */
10/* Singleton permettant d'enregister une fabrique de variable. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/ArcanePrecomp.h"
15
16#include "arcane/VariableFactoryRegisterer.h"
17#include "arcane/VariableFactory.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28VariableFactoryRegisterer* arcaneFirstVariableFactory = nullptr;
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
36: m_function(func)
37, m_variable_type_info(var_type_info)
38, m_previous(nullptr)
39, m_next(nullptr)
40{
41 if (!arcaneFirstVariableFactory){
42 arcaneFirstVariableFactory = this;
43 }
44 else{
45 VariableFactoryRegisterer* next = arcaneFirstVariableFactory->nextVariableFactory();
46 setNextVariableFactory(arcaneFirstVariableFactory);
47 arcaneFirstVariableFactory = this;
48 if (next)
49 next->setPreviousVariableFactory(this);
50 }
51}
52
53
54/*---------------------------------------------------------------------------*/
55/*---------------------------------------------------------------------------*/
56
62
63/*---------------------------------------------------------------------------*/
64/*---------------------------------------------------------------------------*/
65
66VariableFactoryRegisterer* VariableFactoryRegisterer::
67firstVariableFactory()
68{
69 return arcaneFirstVariableFactory;
70}
71
72/*---------------------------------------------------------------------------*/
73/*---------------------------------------------------------------------------*/
74
75} // End namespace Arcane
76
77/*---------------------------------------------------------------------------*/
78/*---------------------------------------------------------------------------*/
79
Interface d'une fabrique de variables.
VariableFactoryVariableRefCreateFunc VariableFactoryFunc
Type de la fonction créant la variable.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Enregistreur d'une fabrique de variables.
VariableFactoryFunc m_function
Fonction de création du IVariableFactoryFactory.
IVariableFactory * createFactory()
Créé une fabrique pour ce type de variable.
void setNextVariableFactory(VariableFactoryRegisterer *s)
Positionne le VariableFactory suivant.
VariableTypeInfo m_variable_type_info
Informations sur le type de la variable.
VariableFactoryRegisterer(VariableFactoryFunc func, const VariableTypeInfo &var_type_info)
Crée un enregistreur pour une VariableFactory pour le type var_type_info et pour fonction de création...
VariableFactoryRegisterer * nextVariableFactory() const
VariableFactory suivant (0 si le dernier)
Enregistreur d'une fabrique de variables.
Informations caractérisant le type d'une variable.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-