Skip to content

Commit

Permalink
[axlstar] Converti explicitement le type de retour des 'CaseOptionMul…
Browse files Browse the repository at this point in the history
…tiSimpleT' via la méthode 'value()'.

Utilise aussi le mot clé 'auto' pour laisser le compilateur détecter le
type de retour. Cela permet de faire évoluer Arcane sans avoir à modifier
le générateur des 'axl' si on change le type de retour de la méthode
'CaseOptionMultiSimpleT::values()'.
  • Loading branch information
grospelliergilles committed Nov 9, 2021
1 parent 33b23ba commit 0627b83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
16 changes: 4 additions & 12 deletions axlstar/Arcane.Axl.T4/Arcane.Axl/T4.CaseOptions/CaseOptionsT4.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:3.0.0
// Runtime Version:3.1.8
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
Expand Down Expand Up @@ -29,13 +29,7 @@ void GenerateInterfaces(OptionHandler opt) {

foreach(var e in opt.Simple.Where(p => p.IsMulti)) {

this.Write(" Arcane::ConstArrayView< ");


this.Write(this.ToStringHelper.ToStringWithCulture( e.type.QualifiedName () ));


this.Write(" > get");
this.Write(" auto get");


this.Write(this.ToStringHelper.ToStringWithCulture( e.Name.ToClassName () ));
Expand All @@ -47,7 +41,7 @@ void GenerateInterfaces(OptionHandler opt) {
this.Write(this.ToStringHelper.ToStringWithCulture( e.Name.ToFuncName () ));


this.Write("; }\n ");
this.Write(".values(); }\n ");

}
foreach(var e in opt.Simple.Where(p => p.IsSingle)) {
Expand Down Expand Up @@ -1213,9 +1207,7 @@ void multiAllocate(const Arcane::XmlNodeList& elist)
this.Write(" {\n");
GenerateTranslationCalls(Xml);
GenerateTranslationAndDefaultValues(Base,String.Empty);
this.Write(" }\n\n virtual ~CaseOptions");
this.Write(this.ToStringHelper.ToStringWithCulture( Xml.ClassName ));
this.Write("()\n {\n }\n\npublic:\n // Interfaces for main CaseOptions\n ");
this.Write(" }\n\npublic:\n // Interfaces for main CaseOptions\n ");
GenerateInterfaces(Xml);
this.Write(@"
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ ARCANE_END_NAMESPACE
#>

<#+ foreach(var e in opt.Simple.Where(p => p.IsMulti)) { #>
Arcane::ConstArrayView< <#= e.type.QualifiedName () #> > get<#= e.Name.ToClassName () #>() { return <#= e.Name.ToFuncName () #>; }
auto get<#= e.Name.ToClassName () #>() { return <#= e.Name.ToFuncName () #>.values(); }
<#+ }
foreach(var e in opt.Simple.Where(p => p.IsSingle)) { #>
<#= e.type.QualifiedReturnName (true) #> get<#= e.Name.ToClassName () #>() { return <#= e.Name.ToFuncName () #>(); }
Expand Down

0 comments on commit 0627b83

Please sign in to comment.