Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Hdf5VariableReader_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_HDF5VARIABLEREADER_H
9#define ARCANE_CASEOPTION_AXLSTAR_ARCANE_HDF5VARIABLEREADER_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 CaseOptionsHdf5VariableReader
31{
32public:
33
34 /*-------------------------------------------------------------------------*/
35 /*--------------------------- Complex Options -----------------------------*/
36 /*-------------------------------------------------------------------------*/
37 // Generation for option 'read'
38 // Generating multiple arity CaseOption for complex option value 'read'
39 class CaseOptionReadValue
41 {
42 public:
43
44 typedef CaseOptionReadValue ThatClass;
45
46 CaseOptionReadValue(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 CaseOptionsRead
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 'read'
97 class CaseOptionRead
99 , private Arcane::ArrayView< CaseOptionReadValue * >
100 {
101 public:
102
104
105 typedef CaseOptionReadValue value_type;
106
107 public:
108
109 CaseOptionRead(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("lecture"));
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 ~CaseOptionRead()
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 CaseOptionsHdf5VariableReader(Arcane::ICaseOptions* co)
167 : m_case_options(co)
168 , read(_configList(),
169 /* name */ "read", _element())
170 {
171
172read.addAlternativeNodeName(
173 /* language */ Arcane::String("fr"),
174 /* alternative name */ Arcane::String("lecture"));
175addAlternativeNodeName(
176 /* language */ Arcane::String("fr"),
177 /* alternative name */ Arcane::String("lecteur-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 CaseOptionRead read;
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_HDF5VARIABLEREADER_H
254#define ARCANE_MODULE_AXLSTAR_ARCANE_HDF5VARIABLEREADER_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 CaseOptionsHdf5VariableReader;
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("Hdf5VariableReader_arcane_hdf5");
300 si->setAxlVersion(1.0);
301 si->setDefaultTagName("hdf5-variable-reader");
302 si->setAxlContent(getAxlContent());
303 si->setTagName("lecteur-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_HDF5VARIABLEREADER(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 to declare an interface when registering a service.
CaseOptionsHdf5VariableReader * m_options
Options du jeu de données du service.
ArcaneHdf5VariableReaderObject(const Arcane::ServiceBuildInfo &sbi)
Constructeur.
CaseOptionsHdf5VariableReader * options() const
Options du jeu de données du service.
static Arcane::FileContent getAxlContent()
Variables du service.
Modifiable view of an array of type T.
Base class of a service linked to a subdomain.
Information for building a dataset option.
Base class for a complex option value.
Base class for an array of complex data set options.
void addAlternativeNodeName(const String &lang, const String &name) override
Adds a translation for the option name. Adds the option name name corresponding to language lang....
Description and content of a file.
Definition FileContent.h:33
Interface of a dataset function.
Interface for a data set options list.
Interface for a list of options that appears multiple times.
Interface for a list of data set options.
Interface managing a standard function.
Interface of a service operating during the time loop.
Information about a service.
Definition ServiceInfo.h:51
static void registerToServiceInfo(ServiceInfo *si, const Interfaces &... args)
Registers the factories for the Interfaces interfaces in the service.
ICaseOptions * caseOptions() const
Access to the associated ICaseOptions.
Structure containing the information to create a service.
View of an array of elements of type T.
Definition Span.h:635
List of nodes of a DOM tree.
Definition XmlNodeList.h:36
Node of a DOM tree.
Definition XmlNode.h:51
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
unsigned char Byte
Type of a byte.
Definition BaseTypes.h:43