Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
impl/ArcaneCodeService.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/* ArcaneCodeService.cc (C) 2000-2019 */
9/* */
10/* Service de code générique Arcane. */
11/* Ce service est une recopie locale de celui de tests pour le driver */
12/*---------------------------------------------------------------------------*/
13/*---------------------------------------------------------------------------*/
14
15#include "arcane/CodeService.h"
16#include "arcane/utils/ArcanePrecomp.h"
17
18#include "arcane/ISession.h"
19#include "arcane/ISubDomain.h"
20#include "arcane/IParallelMng.h"
21#include "arcane/Service.h"
22
23#include "arcane/impl/TimeLoopReader.h"
24#include "arcane/impl/ArcaneSession.h"
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29ARCANE_BEGIN_NAMESPACE
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34class ArcaneCodeService
35: public CodeService
36{
37 public:
38
39 ArcaneCodeService(const ServiceBuildInfo& sbi);
40 virtual ~ArcaneCodeService();
41
42 public:
43
44 virtual bool parseArgs(StringList& args);
47
48 public:
49
50 void build() {}
51
52 protected:
53
54 virtual void _preInitializeSubDomain(ISubDomain* sd);
55
56 public:
57
58 static Internal::ServiceInfo service_info;
59};
60
61/*---------------------------------------------------------------------------*/
62/*---------------------------------------------------------------------------*/
63
64Internal::ServiceInfo
65ArcaneCodeService::service_info("ArcaneCodeService",VersionInfo(1,0,1),
66 IServiceInfo::Dim1|IServiceInfo::Dim2|IServiceInfo::Dim3);
67
68/*---------------------------------------------------------------------------*/
69/*---------------------------------------------------------------------------*/
70
71extern "C++" ARCANE_IMPL_EXPORT Ref<ICodeService>
72createArcaneCodeService(IApplication* app)
73{
74 ServiceBuildInfoBase s(app);
75 auto x = new ArcaneCodeService(ServiceBuildInfo(&ArcaneCodeService::service_info,s));
76 x->build();
77 return makeRef<ICodeService>(x);
78}
79
80/*---------------------------------------------------------------------------*/
81/*---------------------------------------------------------------------------*/
82
83ArcaneCodeService::
84ArcaneCodeService(const ServiceBuildInfo& sbi)
85: CodeService(sbi)
86{
87 _addExtension(String("arc"));
88}
89
90/*---------------------------------------------------------------------------*/
91/*---------------------------------------------------------------------------*/
92
93ArcaneCodeService::
94~ArcaneCodeService()
95{
96}
97
98/*---------------------------------------------------------------------------*/
99/*---------------------------------------------------------------------------*/
100
101void ArcaneCodeService::
102_preInitializeSubDomain(ISubDomain*)
103{
104}
105
106/*---------------------------------------------------------------------------*/
107/*---------------------------------------------------------------------------*/
108
110initCase(ISubDomain* sub_domain,bool is_continue)
111{
112 {
113 TimeLoopReader stl(_application());
114 stl.readTimeLoops();
115 stl.registerTimeLoops(sub_domain);
116 stl.setUsedTimeLoop(sub_domain);
117 }
118 CodeService::initCase(sub_domain,is_continue);
119 if (sub_domain->parallelMng()->isMasterIO())
120 sub_domain->session()->writeExecInfoFile();
121}
122
123/*---------------------------------------------------------------------------*/
124/*---------------------------------------------------------------------------*/
125
126ISession* ArcaneCodeService::
128{
129 ArcaneSession* session = new ArcaneSession(_application());
130 session->build();
131 _application()->addSession(session);
132 return session;
133}
134
135/*---------------------------------------------------------------------------*/
136/*---------------------------------------------------------------------------*/
137
140{
141 ARCANE_UNUSED(args);
142 return false;
143}
144
145/*---------------------------------------------------------------------------*/
146/*---------------------------------------------------------------------------*/
147
148ARCANE_END_NAMESPACE
149
150/*---------------------------------------------------------------------------*/
151/*---------------------------------------------------------------------------*/
virtual void initCase(ISubDomain *sub_domain, bool is_continue)
Initialise la session session.
virtual bool parseArgs(StringList &args)
Analyse les arguments de la ligne de commandes.
virtual bool parseArgs(StringList &args)
Analyse les arguments de la ligne de commandes.
virtual ISession * createSession()
Crée une session.
virtual ISession * createSession()
Crée une session.
virtual void initCase(ISubDomain *sub_domain, bool is_continue)
Initialise la session session.
virtual void initCase(ISubDomain *sub_domain, bool is_continue)
Initialise la session session.
virtual void addSession(ISession *session)=0
Ajoute la session session.
Interface d'une session d'exécution d'un cas.
Definition ISession.h:44
Interface du gestionnaire d'un sous-domaine.
Definition ISubDomain.h:74
Informations d'un service.
Definition ServiceInfo.h:46
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
List< String > StringList
Tableau de chaînes de caractères unicode.
Definition UtilsTypes.h:667