Arcane  v3.16.4.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
IFactoryService.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 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/* IFactoryService.h (C) 2000-2025 */
9/* */
10/* Interface d'un service de fabrique. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IFACTORYSERVICE_H
13#define ARCANE_CORE_IFACTORYSERVICE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/IService.h"
18#include "arcane/core/ServiceBuildInfo.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28/*!
29 * \internal
30 * \brief Interface d'une fabrique sur une classe implémentant \a InterfaceType.
31 */
32template <typename InterfaceType>
33class IFactoryServiceT
34: public IService
35{
36 protected:
37
38 IFactoryServiceT() = default;
39
40 public:
41
42 /*!
43 * \brief Créé une instance.
44 *
45 * L'objet retourné est garanti ne pas être nul.
46 */
47 virtual InterfaceType* createInstance() = 0;
48
49 /*!
50 * \brief Créé une instance pour le maillage \a mesh.
51 *
52 * Seuls les service de sous-domaine supporte ce type de création.
53 *
54 * L'objet retourné est garanti ne pas être nul.
55 */
56 virtual InterfaceType* createInstance(IMesh* mesh) = 0;
57
58 /*! \brief Créé une instance singleton.
59 *
60 * L'objet retourné est garanti ne pas être nul. L'instance retournée
61 * est toujours la même.
62 */
63 virtual InterfaceType* singletonInstance() = 0;
64};
65
66/*---------------------------------------------------------------------------*/
67/*---------------------------------------------------------------------------*/
68
69} // namespace Arcane
70
71/*---------------------------------------------------------------------------*/
72/*---------------------------------------------------------------------------*/
73
74#endif
75
virtual InterfaceType * singletonInstance()=0
Créé une instance singleton.
virtual InterfaceType * createInstance()=0
Créé une instance.
virtual InterfaceType * createInstance(IMesh *mesh)=0
Créé une instance pour le maillage mesh.
IService()
Constructeur.
Definition IService.h:43
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-