Arcane  v3.16.0.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
Hdf5VariableWriter_axl.h
1/*---------------------------------------------------------------------------*/
2/*---------------------------------------------------------------------------*/
3// #WARNING#: This file has been generated automatically. Do not edit.
4// Axlstar version 1.0
5/*---------------------------------------------------------------------------*/
6/*---------------------------------------------------------------------------*/
7
8#ifndef ARCANE_CASEOPTION_AXLSTAR_ARCANE_HDF5VARIABLEWRITER_H
9#define ARCANE_CASEOPTION_AXLSTAR_ARCANE_HDF5VARIABLEWRITER_H
10
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/String.h"
15
16#include "arcane/CaseOptions.h"
17#include "arcane/CaseOptionsMulti.h"
18#include "arcane/CaseOptionBuildInfo.h"
19#include "arcane/XmlNodeList.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24ARCANE_BEGIN_NAMESPACE
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
30class CaseOptionsHdf5VariableWriter
31{
32public:
33
34 /*-------------------------------------------------------------------------*/
35 /*--------------------------- Complex Options -----------------------------*/
36 /*-------------------------------------------------------------------------*/
37 // Generation for option 'write'
38 // Generating multiple arity CaseOption for complex option value 'write'
39 class CaseOptionWriteValue
41 {
42 public:
43
44 typedef CaseOptionWriteValue ThatClass;
45
46 CaseOptionWriteValue(Arcane::ICaseOptionsMulti* opt,Arcane::ICaseOptionList* icl, const Arcane::XmlNode& element)
47 : Arcane::CaseOptionComplexValue(opt,icl,element)
48 , meshName(Arcane::CaseOptionBuildInfo(_configList(),
49 /* name */ "mesh-name", _element(),
50 /* default */ "Mesh0",
51 /* min-occurs */ 1,
52 /* max-occurs */ 1,
53 /* optional */ false))
54 , fileName(Arcane::CaseOptionBuildInfo(_configList(),
55 /* name */ "file-name", _element(),
56 /* default */ Arcane::String(),
57 /* min-occurs */ 1,
58 /* max-occurs */ 1,
59 /* optional */ false))
60
61 {
62
63meshName.addAlternativeNodeName(
64 /* language */ Arcane::String("fr"),
65 /* alternative name */ Arcane::String("nom-maillage"));
66fileName.addAlternativeNodeName(
67 /* language */ Arcane::String("fr"),
68 /* alternative name */ Arcane::String("nom-fichier"));
69
70 }
71 public:
72 // Interfaces for multi-arity class CaseOptionsWrite
73
74 Arcane::String getMeshName() { return meshName(); }
75 Arcane::ICaseFunction* getMeshNameFunction() { return meshName.function(); }
76 Arcane::IStandardFunction* getMeshNameStandardFunction() { return meshName.standardFunction(); }
77 Arcane::String getFileName() { return fileName(); }
78 Arcane::ICaseFunction* getFileNameFunction() { return fileName.function(); }
79 Arcane::IStandardFunction* getFileNameStandardFunction() { return fileName.standardFunction(); }
80
81
82
83 // Interfaces for complex options
84
85
86 public:
87
88 const ThatClass* operator->() const { return this; }
89
90 public:
91
92 Arcane::CaseOptionString meshName;
93 Arcane::CaseOptionString fileName;
94 };
95
96 // Generation for sub-option 'write'
97 class CaseOptionWrite
99 , private Arcane::ArrayView< CaseOptionWriteValue * >
100 {
101 public:
102
104
105 typedef CaseOptionWriteValue value_type;
106
107 public:
108
109 CaseOptionWrite(Arcane::ICaseOptionList* icl,
110 const Arcane::String& s, const Arcane::XmlNode& element)
111 : Arcane::CaseOptionsMulti(icl,s,element,0,-1)
112 {
113 // Generating translations and default values.
115 /* language */ Arcane::String("fr"),
116 /* alternative name */ Arcane::String("ecriture"));
117 }
118
119 BaseClass operator()() { return (*this); }
120
121 protected:
122 void multiAllocate(const Arcane::XmlNodeList& elist)
123 {
124 Arcane::Integer s = elist.size();
125 value_type** v = 0;
126 if (s!=0)
127 v = new value_type*[s];
128 _setArray(v,s);
129 v = _ptr();
130 for( Arcane::Integer i=0; i<s; ++i ){
131 v[i] = new value_type(this,configList(),elist[i]);
132 }
133 }
134
135 public:
136
137 ~CaseOptionWrite()
138 {
139 Arcane::Integer s = count();
140 if (s==0) return;
141 value_type** v = _ptr();
142 for( Arcane::Integer i=0; i<s; ++i ){
143 delete v[i];
144 }
145 delete[] v;
146 }
147
148 public:
149
150 const value_type& operator[](Arcane::Integer i) const
151 { return *(BaseClass::operator[](i)); }
152 value_type& operator[](Arcane::Integer i)
153 { return *(BaseClass::operator[](i)); }
154 Arcane::Integer count() const
155 { return BaseClass::size(); }
156 Arcane::Integer size() const
157 { return BaseClass::size(); }
158
159 };
160
161
162 /*-------------------------------------------------------------------------*/
163 /*--------------------------- Non Complex Options -------------------------*/
164 /*-------------------------------------------------------------------------*/
165
166 CaseOptionsHdf5VariableWriter(Arcane::ICaseOptions* co)
167 : m_case_options(co)
168 , write(_configList(),
169 /* name */ "write", _element())
170 {
171
172write.addAlternativeNodeName(
173 /* language */ Arcane::String("fr"),
174 /* alternative name */ Arcane::String("ecriture"));
175addAlternativeNodeName(
176 /* language */ Arcane::String("fr"),
177 /* alternative name */ Arcane::String("ecrivain-variable-hdf5"));
178 }
179
180public:
181 // Interfaces for main CaseOptions
182
183
184
185
186 // Interfaces for complex options
187
188
189public:
190
191 Arcane::ICaseOptions* caseOptions() const
192 {
193 return m_case_options.get();
194 }
195
196 Arcane::ICaseOptionList* configList() const
197 {
198 return m_case_options->configList();
199 }
200
201 void setCaseModule(Arcane::IModule* m)
202 {
203 m_case_options->setCaseModule(m);
204 }
205
206 void setCaseServiceInfo(Arcane::IServiceInfo* si)
207 {
208 m_case_options->setCaseServiceInfo(si);
209 }
210
211 void addAlternativeNodeName(const Arcane::String& lang,
212 const Arcane::String& name)
213 {
214 m_case_options->addAlternativeNodeName(lang,name);
215 }
216
217private:
218
219 Arcane::ICaseOptionList* _configList() const { return configList(); }
220 Arcane::XmlNode _element() const { return Arcane::XmlNode(); }
221
222private:
223
224 static Arcane::ICaseOptions* _createCaseOption(Arcane::ICaseMng* cm,Arcane::ICaseOptions* co);
225
226 Arcane::ReferenceCounter<Arcane::ICaseOptions> m_case_options;
227
228public:
229
230
231 CaseOptionWrite write;
232};
233
234/*---------------------------------------------------------------------------*/
235/*---------------------------------------------------------------------------*/
236
237ARCANE_END_NAMESPACE
238
239/*---------------------------------------------------------------------------*/
240/*---------------------------------------------------------------------------*/
241
242#endif
243
244
245
246/*---------------------------------------------------------------------------*/
247/*---------------------------------------------------------------------------*/
248// #WARNING#: This file has been generated automatically. Do not edit.
249// Axlstar version 1.0
250/*---------------------------------------------------------------------------*/
251/*---------------------------------------------------------------------------*/
252
253#ifndef ARCANE_MODULE_AXLSTAR_ARCANE_HDF5VARIABLEWRITER_H
254#define ARCANE_MODULE_AXLSTAR_ARCANE_HDF5VARIABLEWRITER_H
255
256/*---------------------------------------------------------------------------*/
257/*---------------------------------------------------------------------------*/
258
259#include "arcane/VariableTypes.h"
260#include "arcane/ServiceInfo.h"
261#include "arcane/ISubDomain.h"
262#include "arcane/ServiceBuildInfo.h"
263#include "arcane/ServiceFactory.h"
264#include "arcane/ServiceRegisterer.h"
265#include "arcane/BasicService.h"
266
267#ifndef ARCANE_HAS_SPECIFIC_BASIC_SERVICE
268// Code pour les versions de Arcane avant la 3.8 qui ne possèdent pas les
269// classes de base spécifiques pour les services
270namespace Arcane
271{
272using BasicCaseOptionService = BasicService;
273using BasicSubDomainService = BasicService;
274using BasicMeshService = BasicService;
275}
276#endif
277
278/*---------------------------------------------------------------------------*/
279/*---------------------------------------------------------------------------*/
280
281ARCANE_BEGIN_NAMESPACE
282
283/*---------------------------------------------------------------------------*/
284/*---------------------------------------------------------------------------*/
285
286class CaseOptionsHdf5VariableWriter;
287
288/*---------------------------------------------------------------------------*/
289/*---------------------------------------------------------------------------*/
290
293 : public BasicTimeLoopService
294{
295public:
296 // NOTE GG: attention code dupliqué avec 'ServiceT4CaseAndStrong'. Bien reporter les modifications
297 template <typename ServiceClassType> static void fillServiceInfo(Arcane::ServiceInfo* si)
298 {
299 si->setCaseOptionsFileName("Hdf5VariableWriter_arcane_hdf5");
300 si->setAxlVersion(1.0);
301 si->setDefaultTagName("hdf5-variable-writer");
302 si->setAxlContent(getAxlContent());
303 si->setTagName("ecrivain-variable-hdf5","fr");
306);
307 }
308
309public:
310
313 : BasicTimeLoopService(sbi)
314 , m_options(nullptr)
315 {
317 if (co) {
319 }
320
321 }
322
325 {
326 delete m_options;
327 }
328
329
330public:
331
334
335private:
336
339
340protected:
341
343private:
345 {
346 const Arcane::Byte* content = (const Arcane::Byte*)"";
347 Arcane::Span<const Arcane::Byte> bytes(content,0);
348 int file_version = 1;
349 return Arcane::FileContent(bytes,file_version,"");
350 }
351};
352
353/*---------------------------------------------------------------------------*/
354/*---------------------------------------------------------------------------*/
355
356#define ARCANE_REGISTER_SERVICE_HDF5VARIABLEWRITER(service_name,class_name) \
357 ARCANE_REGISTER_AXL_SERVICE(class_name,Arcane::ServiceProperty(#service_name,Arcane::ST_CaseOption,\
358 Arcane::SFP_None ))
359
360/*---------------------------------------------------------------------------*/
361/*---------------------------------------------------------------------------*/
362
363ARCANE_END_NAMESPACE
364
365/*---------------------------------------------------------------------------*/
366/*---------------------------------------------------------------------------*/
367
368#endif
369
#define ARCANE_SERVICE_INTERFACE(ainterface)
Macro pour déclarer une interface lors de l'enregistrement d'un service.
static Arcane::FileContent getAxlContent()
Variables du service.
CaseOptionsHdf5VariableWriter * options() const
Options du jeu de données du service.
CaseOptionsHdf5VariableWriter * m_options
Options du jeu de données du service.
ArcaneHdf5VariableWriterObject(const Arcane::ServiceBuildInfo &sbi)
Constructeur.
Vue modifiable d'un tableau d'un type T.
Classe de base de service lié à un sous-domaine.
Informations pour construire une option de jeu de données.
Classe de base d'une valeur d'une option complexe.
Classe de base d'un tableau d'options complexes du jeu de données.
void addAlternativeNodeName(const String &lang, const String &name) override
Ajoute une traduction pour le nom de l'option. Ajoute le nom name de l'option correspondant au langag...
Description et contenu d'un fichier.
Definition FileContent.h:32
Interface d'une fonction du jeu de données.
Interface d'une liste d'options du jeu de données.
Interface d'une liste d'options présente plusieurs fois.
Interface d'une liste d'options du jeu de données.
Interface gérant une fonction standard.
Interface d'un service opérant lors de la boucle en temps.
Informations d'un service.
Definition ServiceInfo.h:46
static void registerToServiceInfo(ServiceInfo *si, const Interfaces &... args)
Enregistre dans le service les fabriques pour les interfacs Interfaces.
ICaseOptions * caseOptions() const
Accès au ICaseOptions associé.
Structure contenant les informations pour créer un service.
Vue d'un tableau d'éléments de type T.
Definition Span.h:513
Chaîne de caractères unicode.
Liste de noeuds d'un arbre DOM.
Definition XmlNodeList.h:33
Noeud d'un arbre DOM.
Definition XmlNode.h:51
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.
unsigned char Byte
Type d'un octet.
Definition BaseTypes.h:43