Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
DotNetRuntimeInitialisationInfo.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2023 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/* DotNetRuntimeInitialisationInfo.cc (C) 2000-2023 */
9/* */
10/* Informations pour l'initialisation du runtime '.Net'. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/DotNetRuntimeInitialisationInfo.h"
15
16#include "arcane/utils/String.h"
17#include "arcane/utils/Property.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
29{
30 public:
31 bool m_is_using_dotnet_runtime = false;
32 String m_main_assembly_name;
33 String m_execute_method_name;
34 String m_execute_class_name;
35 String m_embedded_runtime;
36};
37
38/*---------------------------------------------------------------------------*/
39/*---------------------------------------------------------------------------*/
40
41template<typename V> void DotNetRuntimeInitialisationInfo::
42_applyPropertyVisitor(V& p)
43{
44 auto b = p.builder();
45 p << b.addString("MainAssemblyName")
46 .addDescription("Name of the assembly to load at startup")
47 .addCommandLineArgument("DotNetMainAssemblyName")
48 .addGetter([](auto a) { return a.x.mainAssemblyName(); })
49 .addSetter([](auto a) { a.x.setMainAssemblyName(a.v); });
50
51 p << b.addString("ExecuteMethodName")
52 .addDescription("Name of the method to execute")
53 .addCommandLineArgument("DotNetExecuteMethodName")
54 .addGetter([](auto a) { return a.x.executeMethodName(); })
55 .addSetter([](auto a) { a.x.setExecuteMethodName(a.v); });
56
57 p << b.addString("ExecuteClassName")
58 .addDescription("Name of the class containing the methode to execute")
59 .addCommandLineArgument("DotNetExecuteClassName")
60 .addGetter([](auto a) { return a.x.executeClassName(); })
61 .addSetter([](auto a) { a.x.setExecuteClassName(a.v); });
62
63 p << b.addString("EmbeddedRuntime")
64 .addDescription("Name of the dotnet runtime ('coreclr', 'mono') to use")
65 .addCommandLineArgument("DotNetEmbeddedRuntime")
66 .addGetter([](auto a) { return a.x.embeddedRuntime(); })
67 .addSetter([](auto a) { a.x.setEmbeddedRuntime(a.v); });
68
69 p << b.addBool("UsingDotNet")
70 .addDescription("Set/Unset the loading of the '.Net' runtime with 'coreclr'")
71 .addCommandLineArgument("UsingDotNet")
72 .addGetter([](auto a) { return a.x.isUsingDotNetRuntime(); })
73 .addSetter([](auto a) {
74 a.x.setIsUsingDotNetRuntime(a.v);
75 a.x.setEmbeddedRuntime("coreclr");
76 });
77}
78
79/*---------------------------------------------------------------------------*/
80/*---------------------------------------------------------------------------*/
81
82DotNetRuntimeInitialisationInfo::
83DotNetRuntimeInitialisationInfo()
84: m_p(new Impl())
85{
86}
87
88/*---------------------------------------------------------------------------*/
89/*---------------------------------------------------------------------------*/
90
91DotNetRuntimeInitialisationInfo::
92DotNetRuntimeInitialisationInfo(const DotNetRuntimeInitialisationInfo& rhs)
93: m_p(new Impl(*rhs.m_p))
94{
95}
96
97/*---------------------------------------------------------------------------*/
98/*---------------------------------------------------------------------------*/
99
100DotNetRuntimeInitialisationInfo& DotNetRuntimeInitialisationInfo::
101operator=(const DotNetRuntimeInitialisationInfo& rhs)
102{
103 if (&rhs!=this){
104 delete m_p;
105 m_p = new Impl(*(rhs.m_p));
106 }
107 return (*this);
108}
109
110/*---------------------------------------------------------------------------*/
111/*---------------------------------------------------------------------------*/
112
113DotNetRuntimeInitialisationInfo::
114~DotNetRuntimeInitialisationInfo()
115{
116 delete m_p;
117}
118
119/*---------------------------------------------------------------------------*/
120/*---------------------------------------------------------------------------*/
121
122/*---------------------------------------------------------------------------*/
123/*---------------------------------------------------------------------------*/
124
125bool DotNetRuntimeInitialisationInfo::
126isUsingDotNetRuntime() const
127{
128 return m_p->m_is_using_dotnet_runtime;
129}
130
131void DotNetRuntimeInitialisationInfo::
132setIsUsingDotNetRuntime(bool v)
133{
134 m_p->m_is_using_dotnet_runtime = v;
135}
136
137/*---------------------------------------------------------------------------*/
138/*---------------------------------------------------------------------------*/
139
140String DotNetRuntimeInitialisationInfo::
141mainAssemblyName() const
142{
143 return m_p->m_main_assembly_name;
144}
145
146void DotNetRuntimeInitialisationInfo::
147setMainAssemblyName(StringView v)
148{
149 m_p->m_main_assembly_name = v;
150 if (!v.empty())
151 setIsUsingDotNetRuntime(true);
152}
153
154/*---------------------------------------------------------------------------*/
155/*---------------------------------------------------------------------------*/
156
157String DotNetRuntimeInitialisationInfo::
158executeClassName() const
159{
160 return m_p->m_execute_class_name;
161}
162
163void DotNetRuntimeInitialisationInfo::
164setExecuteClassName(StringView v)
165{
166 m_p->m_execute_class_name = v;
167}
168
169/*---------------------------------------------------------------------------*/
170/*---------------------------------------------------------------------------*/
171
172String DotNetRuntimeInitialisationInfo::
173executeMethodName() const
174{
175 return m_p->m_execute_method_name;
176}
177
178void DotNetRuntimeInitialisationInfo::
179setExecuteMethodName(StringView v)
180{
181 m_p->m_execute_method_name = v;
182}
183
184/*---------------------------------------------------------------------------*/
185/*---------------------------------------------------------------------------*/
186
187String DotNetRuntimeInitialisationInfo::
188embeddedRuntime() const
189{
190 return m_p->m_embedded_runtime;
191}
192
195{
196 m_p->m_embedded_runtime = v;
197}
198
199/*---------------------------------------------------------------------------*/
200/*---------------------------------------------------------------------------*/
201
202ARCANE_REGISTER_PROPERTY_CLASS(DotNetRuntimeInitialisationInfo,());
203
204/*---------------------------------------------------------------------------*/
205/*---------------------------------------------------------------------------*/
206
207} // End namespace Arcane
208
209/*---------------------------------------------------------------------------*/
210/*---------------------------------------------------------------------------*/
211
Informations pour l'initialisation du runtime '.Net'.
void setEmbeddedRuntime(StringView name)
Nom du runtime pour le mode embarqué ('mono' ou 'coreclr')
Vue sur une chaîne de caractères UTF-8.
Definition StringView.h:47
Chaîne de caractères unicode.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-