14#ifndef ARCANE_STD_SIMPLETABLEWRITERHELPER_H
15#define ARCANE_STD_SIMPLETABLEWRITERHELPER_H
19#include "arcane/core/ISimpleTableInternalMng.h"
20#include "arcane/core/ISimpleTableReaderWriter.h"
21#include "arcane/core/ISimpleTableWriterHelper.h"
23#include "arcane/core/Directory.h"
24#include "arcane/utils/FatalErrorException.h"
35class SimpleTableWriterHelper
41 : m_simple_table_internal(simple_table_reader_writer->internal())
42 , m_simple_table_reader_writer(simple_table_reader_writer)
43 , m_name_output_directory(
"")
44 , m_name_table_without_computation(
"")
46 , m_name_table_computed(
false)
47 , m_name_output_directory_computed(
false)
48 , m_name_table_one_file_by_ranks_permited(
false)
49 , m_name_output_directory_one_file_by_ranks_permited(
false)
51 if (simple_table_reader_writer.
isNull())
52 ARCANE_FATAL(
"The reference passed as a parameter is Null.");
55 SimpleTableWriterHelper()
56 : m_simple_table_internal()
57 , m_simple_table_reader_writer()
58 , m_name_output_directory(
"")
59 , m_name_table_without_computation(
"")
61 , m_name_table_computed(
false)
62 , m_name_output_directory_computed(
false)
63 , m_name_table_one_file_by_ranks_permited(
false)
64 , m_name_output_directory_one_file_by_ranks_permited(
false)
68 virtual ~SimpleTableWriterHelper() =
default;
111 void _computeTableName();
112 void _computeOutputDirectory();
120 String m_name_output_directory;
121 String m_name_output_directory_without_computation;
122 String m_name_table_without_computation;
126 bool m_name_table_computed;
127 bool m_name_output_directory_computed;
132 bool m_name_table_one_file_by_ranks_permited;
133 bool m_name_output_directory_one_file_by_ranks_permited;
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Class managing a directory.
Class interface for writing a file using ISimpleTableReaderWriter. Provides methods for managing para...
bool isNull() const
Indicates if the counter references a non-null instance.
Reference to an instance.
bool init(const Directory &root_directory, const String &table_name, const String &directory_name) override
Method to initialize the object. Specifically, the table name and the directory name that will contai...
String fileType() override
Method to know the file type that will be used.
void setPrecision(Integer precision) override
Method to modify the print precision.
String outputDirectory() override
Method to retrieve the directory name where the tables will be placed.
void setTableName(const String &name) override
Method to set the table name.
void setFixed(bool fixed) override
Method to set or unset the 'std::fixed' flag.
void print(Integer rank) override
Method to display the table.
void setForcedToUseScientificNotation(bool use_scientific) override
Method to set or unset the 'std::scientific' flag.
Ref< SimpleTableInternal > internal() override
Method to retrieve a reference to the SimpleTableInternal object used.
bool isForcedToUseScientificNotation() override
Method to check if the 'std::scientific' flag is active for writing values.
String fileName() override
Method to retrieve the file name.
String outputDirectoryWithoutComputation() override
Method to retrieve the directory name as it was previously provided.
Ref< ISimpleTableReaderWriter > readerWriter() override
Method to retrieve a reference to the ISimpleTableReaderWriter object used.
void setOutputDirectory(const String &directory) override
Method to set the directory where the tables should be saved.
bool writeFile(Integer rank) override
String tableName() override
Method to retrieve the table name.
String tableNameWithoutComputation() override
Method to retrieve the table name as it was previously provided.
void setReaderWriter(const Ref< ISimpleTableReaderWriter > &simple_table_reader_writer) override
Method to set a reference to an ISimpleTableReaderWriter.
Integer precision() override
Method to retrieve the precision currently used for writing values.
Directory rootPath() override
Method to retrieve the path where the implementation saves these tables.
bool isFixed() override
Method to check if the 'std::fixed' flag is active for writing values.
Directory outputPath() override
Method to retrieve the path where the tables will be saved.
String _computeName(String name, bool &one_file_by_ranks_permited)
Method allowing replacement of name symbols by their value.
bool isOneFileByRanksPermited() override
Method to check if the parameters currently held by the implementation allow it to write a file per p...
Unicode character string.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.