14#include "arcane/utils/NotImplementedException.h"
16#include "arcane/AbstractCaseDocumentVisitor.h"
18#include "arcane/CaseOptions.h"
19#include "arcane/CaseOptionService.h"
20#include "arcane/ICaseFunction.h"
44 : m_trace_mng(
tm), m_lang(
lang)
53 void applyVisitor(
const CaseOptionMultiSimple* opt)
override
57 void applyVisitor(
const CaseOptionExtended* opt)
override
61 void applyVisitor(
const CaseOptionMultiExtended* opt)
override
65 void applyVisitor(
const CaseOptionEnum* opt)
override
69 void applyVisitor(
const CaseOptionMultiEnum* opt)
override
73 void beginVisit(
const CaseOptionServiceImpl* opt)
override
78 m_current_service_name = opt->serviceName();
80 void endVisit(
const CaseOptionServiceImpl* opt)
override
85 void beginVisit(
const CaseOptionMultiServiceImpl* opt,Integer index)
override
88 m_current_service_name = opt->serviceName(index);
91 void endVisit(
const CaseOptionMultiServiceImpl* opt,Integer index)
override
99 void _printOption(
const CaseOptionBase* co)
101 m_stream = std::ostringstream();
102 std::ostream& o = m_stream;
104 m_trace_mng->
info() << m_stream.str();
106 void _printOption(
const CaseOptionBase* co,std::ostream& o);
108 ITraceMng* m_trace_mng;
110 std::ostringstream m_stream;
112 String m_current_service_name;
119operator<< (std::ostream& o,
const PrintCaseDocumentVisitor::Indent& indent)
121 for(
int i=0; i<indent.m_n; ++i )
129void PrintCaseDocumentVisitor::
130beginVisit(
const ICaseOptions* opt)
133 if (!m_current_service_name.
null()){
134 service_name =
" name=\""+ m_current_service_name +
"\"";
137 IServiceInfo* service = opt->caseServiceInfo();
139 m_trace_mng->
info() <<
"WARNING: service_name not handled name=\""+ service->localName() +
"\"";
141 m_current_service_name = String();
142 m_trace_mng->
info() << Indent(m_indent) <<
"<" << opt->translatedName(m_lang) << service_name <<
">";
149void PrintCaseDocumentVisitor::
150endVisit(
const ICaseOptions* opt)
153 m_trace_mng->
info() << Indent(m_indent) <<
"</" << opt->translatedName(m_lang) <<
">";
159void PrintCaseDocumentVisitor::
160_printOption(
const CaseOptionBase* co,std::ostream& o)
162 std::ios_base::fmtflags f = o.flags(std::ios::left);
164 o << Indent(m_indent);
165 o.width(40-m_indent);
166 o << co->translatedName(m_lang);
168 ICaseFunction* func = co->function();
170 o <<
" (fonction: " << func->name() <<
")";
178extern "C++" std::unique_ptr<ICaseDocumentVisitor>
179createPrintCaseDocumentVisitor(ITraceMng* tm,
const String& lang)
181 return std::make_unique<PrintCaseDocumentVisitor>(tm,lang);
Visiteur abstrait pour une donnée scalaire.
Classe de base des options simples (uniquement une valeur).
Interface d'une liste d'options du jeu de données.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Visiteur pour afficher les valeurs du jeu de données.
Interface du gestionnaire de traces.
virtual TraceMessage info()=0
Flot pour un message d'information.
Chaîne de caractères unicode.
bool null() const
Retourne true si la chaîne est nulle.
std::ostream & operator<<(std::ostream &o, eExecutionPolicy exec_policy)
Affiche le nom de la politique d'exécution.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-