Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ISimpleTableOutput.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* ISimpleTableOutput.h (C) 2000-2025 */
9/* */
10/* Interface for simple table output services. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ISIMPLETABLEOUTPUT_H
13#define ARCANE_CORE_ISIMPLETABLEOUTPUT_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/ISimpleTableInternalMng.h"
18#include "arcane/core/ISimpleTableWriterHelper.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29/**
30 * \ingroup StandardService
31 * \brief Interface representing a simple table output.
32 */
33class ARCANE_CORE_EXPORT ISimpleTableOutput
34{
35 public:
36
37 virtual ~ISimpleTableOutput() = default;
38
39 public:
40
41 /**
42 * \brief Method to initialize the table.
43 */
44 virtual bool init() = 0;
45 /**
46 * \brief Method to initialize the table.
47 *
48 * \param table_name The name of the table (and the output file).
49 */
50 virtual bool init(const String& table_name) = 0;
51 /**
52 * \brief Method to initialize the table.
53 *
54 * \param table_name The name of the table (and the output file).
55 * \param directory_name The name of the directory where the tables should be saved.
56 */
57 virtual bool init(const String& table_name, const String& directory_name) = 0;
58
59 /*---------------------------------------------------------------------------*/
60 /*---------------------------------------------------------------------------*/
61
62 /**
63 * \brief Method to clear the tables
64 */
65 virtual void clear() = 0;
66
67 /*---------------------------------------------------------------------------*/
68 /*---------------------------------------------------------------------------*/
69
70 /**
71 * \brief Method to add a row.
72 *
73 * \param row_name The name of the row.
74 * \return Integer The position of the row in the table.
75 */
76 virtual Integer addRow(const String& row_name) = 0;
77 /**
78 * \brief Method to add a row.
79 *
80 * If the number of elements in 'elements' is greater than the
81 * number of columns, the addition still takes place (but the
82 * extra elements will not be added).
83 *
84 * \param row_name The name of the row.
85 * \param elements The elements to insert into the row.
86 * \return Integer The position of the row in the table.
87 */
88 virtual Integer addRow(const String& row_name, ConstArrayView<Real> elements) = 0;
89 /**
90 * \brief Method to add multiple rows.
91 *
92 * \param rows_names The names of the rows.
93 * \return true If all rows were created.
94 * \return false If not all rows were created.
95 */
96 virtual bool addRows(StringConstArrayView rows_names) = 0;
97
98 /*---------------------------------------------------------------------------*/
99 /*---------------------------------------------------------------------------*/
100
101 /**
102 * \brief Method to add a column.
103 *
104 * \param column_name The name of the column.
105 * \return Integer The position of the column in the table.
106 */
107 virtual Integer addColumn(const String& column_name) = 0;
108 /**
109 * \brief Method to add a column.
110 *
111 * If the number of elements in 'elements' is greater than the
112 * number of rows, the addition still takes place (but the
113 * extra elements will not be added).
114 *
115 * \param column_name The name of the column.
116 * \param elements The elements to add to the column.
117 * \return Integer The position of the column in the table.
118 */
119 virtual Integer addColumn(const String& column_name, ConstArrayView<Real> elements) = 0;
120 /**
121 * \brief Method to add multiple columns.
122 *
123 * \param rows_names The names of the columns.
124 * \return true If all columns were created.
125 * \return false If not all columns were created.
126 */
127 virtual bool addColumns(StringConstArrayView columns_names) = 0;
128
129 /*---------------------------------------------------------------------------*/
130 /*---------------------------------------------------------------------------*/
131
132 /**
133 * \brief Method to add an element to a row.
134 *
135 * \param position The position of the row.
136 * \param element The element to add.
137 * \return true If the element was successfully added.
138 * \return false If the element could not be added.
139 */
140 virtual bool addElementInRow(Integer position, Real element) = 0;
141 /**
142 * \brief Method to add an element to a row.
143 *
144 * \param row_name The name of the row.
145 * \param element The element to add.
146 * \param create_if_not_exist To determine whether the row should be created
147 * if it does not yet exist.
148 * \return true If the element was successfully added.
149 * \return false If the element could not be added.
150 */
151 virtual bool addElementInRow(const String& row_name, Real element, bool create_if_not_exist = true) = 0;
152 /**
153 * \brief Method to add an element to the last manipulated row.
154 *
155 * This method differs from 'editElementRight()' because here, an element is
156 * added to the end of the row, not necessarily after the last added element.
157 *
158 * \param element The element to add.
159 * \return true If the element was added.
160 * \return false If the element could not be added.
161 */
163
164 /*---------------------------------------------------------------------------*/
165 /*---------------------------------------------------------------------------*/
166
167 /**
168 * \brief Method to add multiple elements to a row.
169 *
170 * If the number of elements in 'elements' is greater than the
171 * number of available columns, the addition still takes place (but the
172 * extra elements will not be added) and a return false will be returned.
173 *
174 * \param position The position of the row.
175 * \param elements The array of elements to add.
176 * \return true If all elements were added.
177 * \return false If [0;len(elements)[ elements were added.
178 */
179 virtual bool addElementsInRow(Integer position, ConstArrayView<Real> elements) = 0;
180 /**
181 * \brief Method to add multiple elements to a row.
182 *
183 * If the number of elements in 'elements' is greater than the
184 * number of available columns, the addition still takes place (but the
185 * extra elements will not be added) and a return false will be returned.
186 *
187 * \param row_name The name of the row.
188 * \param elements The array of elements to add.
189 * \param create_if_not_exist To determine whether the row should be created
190 * if it does not yet exist.
191 * \return true If all elements were added.
192 * \return false If [0;len(elements)[ elements were added.
193 */
194 virtual bool addElementsInRow(const String& row_name, ConstArrayView<Real> elements, bool create_if_not_exist = true) = 0;
195 /**
196 * \brief Method to add multiple elements to the last manipulated row.
197 *
198 * If the number of elements in 'elements' is greater than the
199 * number of available columns, the addition still takes place (but the
200 * extra elements will not be added) and a return false will be returned.
201 *
202 * Aside from the fact that we are manipulating an array here, this method differs
203 * from 'editElementRight()' because here, elements are added to the end of the row,
204 * not necessarily after the last added element.
205 *
206 * \param elements The array of elements to add.
207 * \return true If all elements were added.
208 * \return false If [0;len(elements)[ elements were added.
209 */
210 virtual bool addElementsInSameRow(ConstArrayView<Real> elements) = 0;
211
212 /*---------------------------------------------------------------------------*/
213 /*---------------------------------------------------------------------------*/
214
215 /**
216 * \brief Method to add an element to a column.
217 *
218 * \param position The position of the column.
219 * \param element The element to add.
220 * \return true If the element was successfully added.
221 * \return false If the element could not be added.
222 */
223 virtual bool addElementInColumn(Integer position, Real element) = 0;
224 /**
225 * \brief Method to add an element to a column.
226 *
227 * \param column_name The name of the column.
228 * \param element The element to add.
229 * \param create_if_not_exist To determine whether the column should be created
230 * if it does not yet exist.
231 * \return true If the element was successfully added.
232 * \return false If the element could not be added.
233 */
234 virtual bool addElementInColumn(const String& column_name, Real element, bool create_if_not_exist = true) = 0;
235 /**
236 * \brief Method to add an element to the last manipulated column.
237 *
238 * This method differs from 'editElementDown()' because here, an element is
239 * added to the end of the column, not necessarily after the last added element.
240 *
241 * \param element The element to add.
242 * \return true If the element was added.
243 * \return false If the element could not be added.
244 */
246
247 /*---------------------------------------------------------------------------*/
248 /*---------------------------------------------------------------------------*/
249
250 /**
251 * \brief Method to add multiple elements to a column.
252 *
253 * If the number of elements in 'elements' is greater than the
254 * number of available rows, the addition still takes place (but the
255 * extra elements will not be added) and a return false will be returned.
256 *
257 * \param position The position of the column.
258 * \param elements The array of elements to add.
259 * \return true If all elements were added.
260 * \return false If [0;len(elements)[ elements were added.
261 */
262 virtual bool addElementsInColumn(Integer position, ConstArrayView<Real> elements) = 0;
263 /**
264 * \brief Method to add multiple elements to a column.
265 *
266 * If the number of elements in 'elements' is greater than the
267 * number of available rows, the addition still takes place (but the
268 * extra elements will not be added) and a return false will be returned.
269 *
270 * \param column_name The name of the column.
271 * \param elements The array of elements to add.
272 * \param create_if_not_exist To determine whether the column should be created if
273 * it does not yet exist.
274 * \return true If all elements were added.
275 * \return false If [0;len(elements)[ elements were added.
276 */
277 virtual bool addElementsInColumn(const String& column_name, ConstArrayView<Real> elements, bool create_if_not_exist = true) = 0;
278 /**
279 * \brief Method to add multiple elements to the last manipulated column.
280 *
281 * If the number of elements in 'elements' is greater than the
282 * number of available rows, the addition still takes place (but the
283 * extra elements will not be added) and a return false will be returned.
284 *
285 * Aside from the fact that we are manipulating an array here, this method differs
286 * from 'editElementDown()' because here, elements are added to the end of the column,
287 * not necessarily after the last added element.
288 *
289 * \param elements The array of elements to add.
290 * \return true If all elements were added.
291 * \return false If [0;len(elements)[ elements were added.
292 */
294
295 /*---------------------------------------------------------------------------*/
296 /*---------------------------------------------------------------------------*/
297
298 /**
299 * \brief Method to edit an element above the last
300 * element manipulated (row above/same column).
301 *
302 * The element being modified thus becomes the last modified element
303 * at the end of this method (if update_last_position = true).
304 *
305 * \param element The element to modify.
306 * \param update_last_position Should the "last modified element" cursor be moved?
307 * \return true If the element was modified.
308 * \return false If the element could not be modified.
309 */
310 virtual bool editElementUp(Real element, bool update_last_position = true) = 0;
311 /**
312 * \brief Method to edit an element below the last
313 * element manipulated (row below/same column).
314 *
315 * The element being modified thus becomes the last modified element
316 * at the end of this method (if update_last_position = true).
317 *
318 * This method differs from 'addElementInSameColumn()' because here, an element is added
319 * (or modified) below the last manipulated element, which is not necessarily at the end of the column.
320 *
321 * \param element The element to modify.
322 * \param update_last_position Should the "last modified element" cursor be moved?
323 * \return true If the element was modified.
324 * \return false If the element could not be modified.
325 */
326 virtual bool editElementDown(Real element, bool update_last_position = true) = 0;
327 /**
328 * \brief Method to edit an element to the left of the last
329 * element manipulated (same row/column to the left).
330 *
331 * The element being modified thus becomes the last modified element
332 * at the end of this method (if update_last_position = true).
333 *
334 * \param element The element to modify.
335 * \param update_last_position Should the "last modified element" cursor be moved?
336 * \return true If the element was modified.
337 * \return false If the element could not be modified.
338 */
339 virtual bool editElementLeft(Real element, bool update_last_position = true) = 0;
340 /**
341 * \brief Method to edit an element to the right of the last
342 * element manipulated (same row/column to the right).
343 *
344 * The element being modified thus becomes the last modified element
345 * at the end of this method (if update_last_position = true).
346 *
347 * This method differs from 'addElementInSameRow()' because here, an element is added
348 * (or modified) to the right of the last manipulated element, which is not necessarily at the end of the column.
349 *
350 * \param element The element to modify.
351 * \param update_last_position Should the "last modified element" cursor be moved?
352 * \return true If the element was modified.
353 * \return false If the element could not be modified.
354 */
355 virtual bool editElementRight(Real element, bool update_last_position = true) = 0;
356
357 /*---------------------------------------------------------------------------*/
358 /*---------------------------------------------------------------------------*/
359
360 /**
361 * \brief Method to retrieve an element above the last
362 * element manipulated (row above/same column).
363 *
364 * The element retrieved thus becomes the last "modified" element
365 * at the end of this method (if update_last_position = true).
366 *
367 * \param update_last_position Should the "last modified element" cursor be moved?
368 * \return Real The found element (0 if not found).
369 */
370 virtual Real elementUp(bool update_last_position = false) = 0;
371 /**
372 * \brief Method to retrieve an element below the last
373 * element manipulated (row below/same column).
374 *
375 * The element retrieved thus becomes the last "modified" element
376 * at the end of this method (if update_last_position = true).
377 *
378 * \param update_last_position Should the "last modified element" cursor be moved?
379 * \return Real The found element (0 if not found).
380 */
381 virtual Real elementDown(bool update_last_position = false) = 0;
382 /**
383 * \brief Method to retrieve an element to the left of the last
384 * element manipulated (same row/column to the left).
385 *
386 * The element retrieved thus becomes the last "modified" element
387 * at the end of this method (if update_last_position = true).
388 *
389 * \param update_last_position Should the "last modified element" cursor be moved?
390 * \return Real The found element (0 if not found).
391 */
392 virtual Real elementLeft(bool update_last_position = false) = 0;
393 /**
394 * \brief Method to retrieve an element to the right of the last
395 * element manipulated (same row/column to the right).
396 *
397 * The element retrieved thus becomes the last "modified" element
398 * at the end of this method (if update_last_position = true).
399 *
400 * \param update_last_position Should the "last modified element" cursor be moved?
401 * \return Real The found element (0 if not found).
402 */
403 virtual Real elementRight(bool update_last_position = false) = 0;
404
405 /*---------------------------------------------------------------------------*/
406 /*---------------------------------------------------------------------------*/
407
408 /**
409 * \brief Method to modify an element in the table.
410 *
411 * The x and y positions correspond to the location of the last
412 * manipulated element.
413 *
414 * This method is useful after using
415 * 'elemUDLR(true)' for example.
416 *
417 * \param element The replacement element.
418 * \return true If the element was successfully replaced.
419 * \return false If the element was not replaced.
420 */
421 virtual bool editElement(Real element) = 0;
422 /**
423 * \brief Method to modify an element in the table.
424 *
425 * \param position_x The position of the column to modify.
426 * \param position_y The position of the row to modify.
427 * \param element The replacement element.
428 * \return true If the element was successfully replaced.
429 * \return false If the element was not replaced.
430 */
431 virtual bool editElement(Integer position_x, Integer position_y, Real element) = 0;
432 /**
433 * \brief Method allowing modification of an element in the array.
434 *
435 * \param column_name The name of the column where the element is located.
436 * \param row_name The name of the row where the element is located.
437 * \param element The replacement element.
438 * \return true If the element was successfully replaced.
439 * \return false If the element could not be replaced.
440 */
441 virtual bool editElement(const String& column_name, const String& row_name, Real element) = 0;
442
443 /*---------------------------------------------------------------------------*/
444 /*---------------------------------------------------------------------------*/
445
446 /**
447 * \brief Method allowing retrieval of a copy of an element.
448 *
449 * The x and y positions correspond to the location of the last manipulated element.
450 *
451 * \return Real The found element (0 if not found).
452 */
453 virtual Real element() = 0;
454 /**
455 * \brief Method allowing retrieval of a copy of an element.
456 *
457 * \param position_x The position of the column where the element is located.
458 * \param position_y The position of the row where the element is located.
459 * \param update_last_position Should the "last modified element" cursor be moved?
460 * \return Real The found element (0 if not found).
461 */
462 virtual Real element(Integer position_x, Integer position_y, bool update_last_position = false) = 0;
463 /**
464 * \brief Method allowing retrieval of a copy of an element.
465 *
466 * \param column_name The name of the column where the element is located.
467 * \param row_name The name of the row where the element is located.
468 * \param update_last_position Should the "last modified element" cursor be moved?
469 * \return Real The found element (0 if not found).
470 */
471 virtual Real element(const String& column_name, const String& row_name, bool update_last_position = false) = 0;
472
473 /*---------------------------------------------------------------------------*/
474 /*---------------------------------------------------------------------------*/
475
476 /**
477 * \brief Method allowing retrieval of a copy of a row.
478 *
479 * \param position The position of the row.
480 * \return RealUniqueArray The copy of the row (empty array if not found).
481 */
482 virtual RealUniqueArray row(Integer position) = 0;
483 /**
484 * \brief Method allowing retrieval of a copy of a row.
485 *
486 * \param row_name The name of the row.
487 * \return RealUniqueArray The copy of the row (empty array if not found).
488 */
489 virtual RealUniqueArray row(const String& row_name) = 0;
490
491 /**
492 * \brief Method allowing retrieval of a copy of a column.
493 *
494 * \param position The position of the column.
495 * \return RealUniqueArray The copy of the column (empty array if not found).
496 */
497 virtual RealUniqueArray column(Integer position) = 0;
498 /**
499 * \brief Method allowing retrieval of a copy of a column.
500 *
501 * \param column_name The name of the column.
502 * \return RealUniqueArray The copy of the column (empty array if not found).
503 */
504 virtual RealUniqueArray column(const String& column_name) = 0;
505
506 /*---------------------------------------------------------------------------*/
507 /*---------------------------------------------------------------------------*/
508
509 /**
510 * \brief Method allowing retrieval of the size of a row.
511 * Including hypothetical 'gaps' in the row.
512 *
513 * \param position The position of the row.
514 * \return Integer The size of the row (0 if not found).
515 */
516 virtual Integer rowSize(Integer position) = 0;
517 /**
518 * \brief Method allowing retrieval of the size of a row.
519 * Including hypothetical 'gaps' in the row.
520 *
521 * \param position The name of the row.
522 * \return Integer The size of the row (0 if not found).
523 */
524 virtual Integer rowSize(const String& row_name) = 0;
525
526 /**
527 * \brief Method allowing retrieval of the size of a column.
528 * Including hypothetical 'gaps' in the column.
529 *
530 * \param position The position of the column.
531 * \return Integer The size of the column (0 if not found).
532 */
533 virtual Integer columnSize(Integer position) = 0;
534 /**
535 * \brief Method allowing retrieval of the size of a column.
536 * Including hypothetical 'gaps' in the column.
537 *
538 * \param position The name of the column.
539 * \return Integer The size of the column (0 if not found).
540 */
541 virtual Integer columnSize(const String& column_name) = 0;
542
543 /*---------------------------------------------------------------------------*/
544 /*---------------------------------------------------------------------------*/
545
546 /**
547 * \brief Method allowing retrieval of the position of a row.
548 *
549 * \param row_name The name of the row.
550 * \return Integer The position of the row (-1 if not found).
551 */
552 virtual Integer rowPosition(const String& row_name) = 0;
553 /**
554 * \brief Method allowing retrieval of the position of a column.
555 *
556 * \param row_name The name of the column.
557 * \return Integer The position of the column (-1 if not found).
558 */
559 virtual Integer columnPosition(const String& column_name) = 0;
560
561 /*---------------------------------------------------------------------------*/
562 /*---------------------------------------------------------------------------*/
563
564 /**
565 * \brief Method allowing retrieval of the number of rows in the array.
566 * This is, in a way, the maximum number of elements a column can contain.
567 *
568 * \return Integer The number of rows in the array.
569 */
570 virtual Integer numberOfRows() = 0;
571 /**
572 * \brief Method allowing retrieval of the number of columns in the array.
573 * This is, in a way, the maximum number of elements a row can contain.
574 *
575 * \return Integer The number of columns in the array.
576 */
578
579 /*---------------------------------------------------------------------------*/
580 /*---------------------------------------------------------------------------*/
581
582 virtual String rowName(Integer position) = 0;
583 virtual String columnName(Integer position) = 0;
584
585 /*---------------------------------------------------------------------------*/
586 /*---------------------------------------------------------------------------*/
587
588 /**
589 * \brief Method allowing changing the name of a row.
590 *
591 * \param position The position of the row.
592 * \param new_name The new name of the row.
593 * \return true If the change occurred.
594 * \return false If the change did not occur.
595 */
596 virtual bool editRowName(Integer position, const String& new_name) = 0;
597 /**
598 * \brief Method allowing changing the name of a row.
599 *
600 * \param row_name The current name of the row.
601 * \param new_name The new name of the row.
602 * \return true If the change occurred.
603 * \return false If the change did not occur.
604 */
605 virtual bool editRowName(const String& row_name, const String& new_name) = 0;
606
607 /**
608 * \brief Method allowing changing the name of a column.
609 *
610 * \param position The position of the column.
611 * \param new_name The new name of the column.
612 * \return true If the change occurred.
613 * \return false If the change did not occur.
614 */
615 virtual bool editColumnName(Integer position, const String& new_name) = 0;
616 /**
617 * \brief Method allowing changing the name of a column.
618 *
619 * \param column_name The current name of the column.
620 * \param new_name The new name of the column.
621 * \return true If the change occurred.
622 * \return false If the change did not occur.
623 */
624 virtual bool editColumnName(const String& column_name, const String& new_name) = 0;
625
626 /**
627 * \brief Method allowing creation of a column containing the average of the
628 * elements of each row.
629 *
630 * \param column_name The name of the new column.
631 * \return Integer The position of the column.
632 */
633 virtual Integer addAverageColumn(const String& column_name) = 0;
634
635 /*---------------------------------------------------------------------------*/
636 /*---------------------------------------------------------------------------*/
637 /**
638 * \brief Method allowing display of the array.
639 * Method performing collective operations.
640 *
641 * \param rank The ID of the process that should display the array
642 * (-1 to signify "all processes").
643 */
644 virtual void print(Integer rank = 0) = 0;
645
646 virtual bool writeFile(const Directory& root_directory, Integer rank) = 0;
647
648 /**
649 * \brief Method allowing writing the array to a file.
650 * Method performing collective operations.
651 * If rank != -1, processes other than P0 return true.
652 *
653 * \param rank The ID of the process that should write the array to a file
654 * (-1 to signify "all processes").
655 * \return true If the file was written correctly.
656 * \return false If the file was not written correctly.
657 */
658 virtual bool writeFile(Integer rank = -1) = 0;
659 /**
660 * \brief Method allowing writing the array to a file.
661 * Method performing collective operations.
662 * If rank != -1, processes other than P0 return true.
663 *
664 * \param directory The directory where the file will be written. The final
665 * path will be "./[output_dir]/csv/[directory]/".
666 * \param rank The ID of the process that should write the array to a file
667 * (-1 to signify "all processes").
668 * \return true If the file was written correctly.
669 * \return false If the file was not written correctly.
670 *
671 * \deprecated Use setOutputDirectory() then writeFile() instead.
672 */
673 virtual bool writeFile(const String& directory, Integer rank = -1) = 0;
674
675 /*---------------------------------------------------------------------------*/
676 /*---------------------------------------------------------------------------*/
677
678 /**
679 * \brief Method allowing retrieval of the precision currently
680 * used for writing values.
681 *
682 * \return Integer The precision.
683 */
684 virtual Integer precision() = 0;
685 /**
686 * \brief Method allowing modification of the print precision.
687 *
688 * For both the 'print()' method and the 'writeFile()' methods.
689 *
690 * \warning The "std::fixed" flag modifies the behavior of "setPrecision()".
691 * If the "std::fixed" flag is disabled, precision defines the total number
692 * of digits (before and after the comma); if the "std::fixed" flag is enabled,
693 * precision defines the number of digits after the comma. Therefore, be
694 * careful when using "std::numeric_limits<Real>::max_digits10" (for writing)
695 * or "std::numeric_limits<Real>::digits10" (for reading), which should be used
696 * without the "std::fixed" flag.
697 *
698 * \param precision The new precision.
699 */
700 virtual void setPrecision(Integer precision) = 0;
701
702 /**
703 * \brief Method allowing knowledge of whether the 'std::fixed' flag is
704 * active or not for writing values.
705 *
706 * \return true If yes.
707 * \return false If no.
708 */
709 virtual bool isFixed() = 0;
710 /**
711 * \brief Method allowing setting the 'std::fixed' flag or not.
712 *
713 * For both the 'print()' method and the 'writetable()' method.
714 *
715 * This flag allows 'forcing' the number of digits after the comma
716 * to the desired precision. For example, if 'setPrecision(4)' is
717 * called, and 'setFixed(true)' is called, the print of '6.1' will
718 * yield '6.1000'.
719 *
720 * \warning The "std::fixed" flag modifies the behavior of
721 * "setPrecision()". If the "std::fixed" flag is disabled, precision
722 * defines the total number of digits (before and after the comma);
723 * if the "std::fixed" flag is enabled, precision defines the number
724 * of digits after the comma. Therefore, be careful when using
725 * "std::numeric_limits<Real>::max_digits10" (for writing) or
726 * "std::numeric_limits<Real>::digits10" (for reading), which should
727 * be used without the "std::fixed" flag.
728 *
729 * \param fixed Whether the 'std::fixed' flag should be set or not.
730 */
731 virtual void setFixed(bool fixed) = 0;
732
733 /**
734 * \brief Method allowing knowledge of whether the 'std::scientific' flag is
735 * active or not for writing values.
736 *
737 * \return true If yes.
738 * \return false If no.
739 */
741 /**
742 * \brief Method allowing setting the 'std::scientific' flag or not.
743 *
744 * For both the 'print()' method and the 'writetable()' method.
745 *
746 * This flag allows 'forcing' the display of values in scientific notation.
747 *
748 * \param use_scientific Whether the 'std::scientific' flag should be set or not.
749 */
750 virtual void setForcedToUseScientificNotation(bool use_scientific) = 0;
751
752 /**
753 * \brief Accessor allowing retrieval of the name of the directory
754 * where the arrays will be placed.
755 *
756 * May be different for each process (depending on the implementation).
757 *
758 * \return String The directory.
759 */
760 virtual String outputDirectory() = 0;
761 /**
762 * \brief Accessor allowing definition of the directory
763 * in which the arrays will be saved.
764 *
765 * May be different for each process (depending on the implementation).
766 *
767 * \param directory The directory.
768 */
769 virtual void setOutputDirectory(const String& directory) = 0;
770
771 /**
772 * \brief Accessor allowing retrieval of the name of the arrays.
773 *
774 * May be different for each process (depending on the implementation).
775 *
776 * \return String The name.
777 */
778 virtual String tableName() = 0;
779 /**
780 * \brief Accessor allowing definition of the array name.
781 *
782 * May be different for each process (depending on the implementation).
783 *
784 * \param name The name.
785 */
786 virtual void setTableName(const String& name) = 0;
787
788 /**
789 * \brief Accessor allowing retrieval of the file name.
790 *
791 * May be different for each process (depending on the implementation).
792 *
793 * \return String The name.
794 */
795 virtual String fileName() = 0;
796
797 /**
798 * \brief Accessor allowing retrieval of the path where the arrays
799 * will be saved.
800 *
801 * Compared to rootPathOutput(), the return value may differ
802 * depending on the "directory" and the "name".
803 *
804 * \return String The path.
805 */
806 virtual Directory outputPath() = 0;
807
808 /**
809 * \brief Accessor allowing retrieval of the path where the
810 * implementation saves these arrays.
811 *
812 * Compared to pathOutput(), the return value does not depend on
813 * "directory" or "name".
814 *
815 * \return String The path.
816 */
817 virtual Directory rootPath() = 0;
818
819 /**
820 * \brief Method allowing knowledge of whether the parameters
821 * currently held by the implementation allow it to write one
822 * file per process.
823 *
824 * \return true If yes, the implementation can write one file per process.
825 * \return false Otherwise, only one file can be written.
826 */
827 virtual bool isOneFileByRanksPermited() = 0;
828
829 /**
830 * \brief Method allowing knowledge of the service's file type.
831 *
832 * \return String The file type.
833 */
834 virtual String fileType() = 0;
835
836 /**
837 * \brief Method allowing retrieval of a reference to the
838 * SimpleTableInternal object used.
839 *
840 * \return Ref<SimpleTableInternal> A copy of the reference.
841 */
843
844 /**
845 * \brief Method allowing retrieval of a reference to the
846 * ISimpleTableReaderWriter object used.
847 *
848 * \return Ref<ISimpleTableReaderWriter> A copy of the reference.
849 */
851};
852
853/*---------------------------------------------------------------------------*/
854/*---------------------------------------------------------------------------*/
855
856} // End namespace Arcane
857
858/*---------------------------------------------------------------------------*/
859/*---------------------------------------------------------------------------*/
860
861#endif
Constant view of an array of type T.
Class managing a directory.
Definition Directory.h:36
Interface representing a simple table output.
virtual bool addElementsInColumn(Integer position, ConstArrayView< Real > elements)=0
Method to add multiple elements to a column.
virtual bool addElementsInRow(Integer position, ConstArrayView< Real > elements)=0
Method to add multiple elements to a row.
virtual void setTableName(const String &name)=0
Accessor allowing definition of the array name.
virtual Real elementDown(bool update_last_position=false)=0
Method to retrieve an element below the last element manipulated (row below/same column).
virtual bool init(const String &table_name)=0
Method to initialize the table.
virtual bool editElementDown(Real element, bool update_last_position=true)=0
Method to edit an element below the last element manipulated (row below/same column).
virtual void setPrecision(Integer precision)=0
Method allowing modification of the print precision.
virtual bool addElementInRow(Integer position, Real element)=0
Method to add an element to a row.
virtual Ref< SimpleTableInternal > internal()=0
Method allowing retrieval of a reference to the SimpleTableInternal object used.
virtual String fileType()=0
Method allowing knowledge of the service's file type.
virtual bool init(const String &table_name, const String &directory_name)=0
Method to initialize the table.
virtual Integer rowSize(Integer position)=0
Method allowing retrieval of the size of a row. Including hypothetical 'gaps' in the row.
virtual String fileName()=0
Accessor allowing retrieval of the file name.
virtual bool addElementInColumn(const String &column_name, Real element, bool create_if_not_exist=true)=0
Method to add an element to a column.
virtual Integer columnSize(const String &column_name)=0
Method allowing retrieval of the size of a column. Including hypothetical 'gaps' in the column.
virtual Integer numberOfRows()=0
Method allowing retrieval of the number of rows in the array. This is, in a way, the maximum number o...
virtual bool editColumnName(Integer position, const String &new_name)=0
Method allowing changing the name of a column.
virtual bool addElementInColumn(Integer position, Real element)=0
Method to add an element to a column.
virtual bool editElementRight(Real element, bool update_last_position=true)=0
Method to edit an element to the right of the last element manipulated (same row/column to the right)...
virtual bool writeFile(Integer rank=-1)=0
Method allowing writing the array to a file. Method performing collective operations....
virtual void setOutputDirectory(const String &directory)=0
Accessor allowing definition of the directory in which the arrays will be saved.
virtual bool editElementUp(Real element, bool update_last_position=true)=0
Method to edit an element above the last element manipulated (row above/same column).
virtual RealUniqueArray column(Integer position)=0
Method allowing retrieval of a copy of a column.
virtual Integer rowPosition(const String &row_name)=0
Method allowing retrieval of the position of a row.
virtual bool addElementsInRow(const String &row_name, ConstArrayView< Real > elements, bool create_if_not_exist=true)=0
Method to add multiple elements to a row.
virtual String outputDirectory()=0
Accessor allowing retrieval of the name of the directory where the arrays will be placed.
virtual bool addElementInSameRow(Real element)=0
Method to add an element to the last manipulated row.
virtual Real elementRight(bool update_last_position=false)=0
Method to retrieve an element to the right of the last element manipulated (same row/column to the ri...
virtual Integer addRow(const String &row_name)=0
Method to add a row.
virtual Integer addColumn(const String &column_name)=0
Method to add a column.
virtual bool editColumnName(const String &column_name, const String &new_name)=0
Method allowing changing the name of a column.
virtual bool editElement(Integer position_x, Integer position_y, Real element)=0
Method to modify an element in the table.
virtual Real elementLeft(bool update_last_position=false)=0
Method to retrieve an element to the left of the last element manipulated (same row/column to the lef...
virtual bool addColumns(StringConstArrayView columns_names)=0
Method to add multiple columns.
virtual bool editRowName(const String &row_name, const String &new_name)=0
Method allowing changing the name of a row.
virtual RealUniqueArray row(const String &row_name)=0
Method allowing retrieval of a copy of a row.
virtual bool addElementInSameColumn(Real element)=0
Method to add an element to the last manipulated column.
virtual Integer addRow(const String &row_name, ConstArrayView< Real > elements)=0
Method to add a row.
virtual Ref< ISimpleTableReaderWriter > readerWriter()=0
Method allowing retrieval of a reference to the ISimpleTableReaderWriter object used.
virtual RealUniqueArray row(Integer position)=0
Method allowing retrieval of a copy of a row.
virtual Integer columnPosition(const String &column_name)=0
Method allowing retrieval of the position of a column.
virtual Integer precision()=0
Method allowing retrieval of the precision currently used for writing values.
virtual String tableName()=0
Accessor allowing retrieval of the name of the arrays.
virtual void print(Integer rank=0)=0
Method allowing display of the array. Method performing collective operations.
virtual Integer numberOfColumns()=0
Method allowing retrieval of the number of columns in the array. This is, in a way,...
virtual bool addElementsInSameRow(ConstArrayView< Real > elements)=0
Method to add multiple elements to the last manipulated row.
virtual RealUniqueArray column(const String &column_name)=0
Method allowing retrieval of a copy of a column.
virtual Integer addAverageColumn(const String &column_name)=0
Method allowing creation of a column containing the average of the elements of each row.
virtual Real elementUp(bool update_last_position=false)=0
Method to retrieve an element above the last element manipulated (row above/same column).
virtual bool isForcedToUseScientificNotation()=0
Method allowing knowledge of whether the 'std::scientific' flag is active or not for writing values.
virtual bool writeFile(const String &directory, Integer rank=-1)=0
Method allowing writing the array to a file. Method performing collective operations....
virtual bool addElementsInColumn(const String &column_name, ConstArrayView< Real > elements, bool create_if_not_exist=true)=0
Method to add multiple elements to a column.
virtual Real element(Integer position_x, Integer position_y, bool update_last_position=false)=0
Method allowing retrieval of a copy of an element.
virtual Real element(const String &column_name, const String &row_name, bool update_last_position=false)=0
Method allowing retrieval of a copy of an element.
virtual Real element()=0
Method allowing retrieval of a copy of an element.
virtual bool init()=0
Method to initialize the table.
virtual bool editElement(Real element)=0
Method to modify an element in the table.
virtual bool isFixed()=0
Method allowing knowledge of whether the 'std::fixed' flag is active or not for writing values.
virtual Integer rowSize(const String &row_name)=0
Method allowing retrieval of the size of a row. Including hypothetical 'gaps' in the row.
virtual bool addElementInRow(const String &row_name, Real element, bool create_if_not_exist=true)=0
Method to add an element to a row.
virtual void clear()=0
Method to clear the tables.
virtual void setFixed(bool fixed)=0
Method allowing setting the 'std::fixed' flag or not.
virtual bool addElementsInSameColumn(ConstArrayView< Real > elements)=0
Method to add multiple elements to the last manipulated column.
virtual bool addRows(StringConstArrayView rows_names)=0
Method to add multiple rows.
virtual bool editRowName(Integer position, const String &new_name)=0
Method allowing changing the name of a row.
virtual Directory rootPath()=0
Accessor allowing retrieval of the path where the implementation saves these arrays.
virtual bool isOneFileByRanksPermited()=0
Method allowing knowledge of whether the parameters currently held by the implementation allow it to ...
virtual Directory outputPath()=0
Accessor allowing retrieval of the path where the arrays will be saved.
virtual bool editElement(const String &column_name, const String &row_name, Real element)=0
Method allowing modification of an element in the array.
virtual Integer columnSize(Integer position)=0
Method allowing retrieval of the size of a column. Including hypothetical 'gaps' in the column.
virtual Integer addColumn(const String &column_name, ConstArrayView< Real > elements)=0
Method to add a column.
virtual void setForcedToUseScientificNotation(bool use_scientific)=0
Method allowing setting the 'std::scientific' flag or not.
virtual bool editElementLeft(Real element, bool update_last_position=true)=0
Method to edit an element to the left of the last element manipulated (same row/column to the left).
Reference to an instance.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
ConstArrayView< String > StringConstArrayView
C equivalent of a 1D array of strings.
Definition UtilsTypes.h:492
Int32 Integer
Type representing an integer.
UniqueArray< Real > RealUniqueArray
Dynamic 1D array of reals.
Definition UtilsTypes.h:349
double Real
Type representing a real number.