Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ICheckpointWriter.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/* ICheckpointWriter.h (C) 2000-2025 */
9/* */
10/* Checkpoint/Recovery write service interface. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ICHECKPOINTWRITER_H
13#define ARCANE_CORE_ICHECKPOINTWRITER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28/*!
29 * \ingroup StandardService
30 * \brief Interface of the checkpoint/recovery write service.
31 *
32 * The instance must return an IDataWriter (via dataWriter()) to
33 * handle the writing.
34 *
35 * The sequence of functions is as follows:
36 * \code
37 * ICheckpointWriter* checkpoint_writer = ...;
38 * checkpoint_writer->setCheckpointTimes();
39 * checkpoint_writer->notifyBeginWrite();
40 * checkpoint_writer->dataWriter();
41 * // ...
42 * // Writing with the IDataWriter
43 * // ...
44 * checkpoint_writer->notifyBeginWrite();
45 * checkpoint_writer->readerServiceName();
46 * checkpoint_writer->readerMetaData();
47 * \endcode
48 */
49class ARCANE_CORE_EXPORT ICheckpointWriter
50{
51 public:
52
53 //! Releases resources
54 virtual ~ICheckpointWriter() = default;
55
56 public:
57
58 /*!
59 * \brief Returns the associated writer.
60 */
61 virtual IDataWriter* dataWriter() = 0;
62
63 //! Notifies that a checkpoint is going to be written with the current parameters
64 virtual void notifyBeginWrite() = 0;
65
66 //! Notifies that a checkpoint has just been written
67 virtual void notifyEndWrite() = 0;
68
69 //! Sets the name of the checkpoint file
70 virtual void setFileName(const String& file_name) = 0;
71
72 //! Name of the checkpoint file
73 virtual String fileName() const = 0;
74
75 //! Sets the name of the checkpoint base directory
76 virtual void setBaseDirectoryName(const String& dirname) = 0;
77
78 //! Name of the checkpoint base directory
79 virtual String baseDirectoryName() const = 0;
80
81 /*! \brief Sets the checkpoint times.
82 *
83 * The time of the current checkpoint is the last element of the array
84 */
85 virtual void setCheckpointTimes(RealConstArrayView times) = 0;
86
87 //! Checkpoint times
89
90 //! Closes the checkpoints
91 virtual void close() = 0;
92
93 //! Name of the reader service associated with this writer
94 virtual String readerServiceName() const = 0;
95
96 //! Metadata for the reader associated with this writer
97 virtual String readerMetaData() const = 0;
98};
99
100/*---------------------------------------------------------------------------*/
101/*---------------------------------------------------------------------------*/
102
103} // namespace Arcane
104
105/*---------------------------------------------------------------------------*/
106/*---------------------------------------------------------------------------*/
107
108#endif
Declarations of Arcane's general types.
Constant view of an array of type T.
Interface of the checkpoint/recovery write service.
virtual ConstArrayView< Real > checkpointTimes() const =0
Checkpoint times.
virtual void setBaseDirectoryName(const String &dirname)=0
Sets the name of the checkpoint base directory.
virtual String readerServiceName() const =0
Name of the reader service associated with this writer.
virtual void close()=0
Closes the checkpoints.
virtual String readerMetaData() const =0
Metadata for the reader associated with this writer.
virtual void setCheckpointTimes(RealConstArrayView times)=0
Sets the checkpoint times.
virtual String baseDirectoryName() const =0
Name of the checkpoint base directory.
virtual String fileName() const =0
Name of the checkpoint file.
virtual void notifyEndWrite()=0
Notifies that a checkpoint has just been written.
virtual ~ICheckpointWriter()=default
Releases resources.
virtual void notifyBeginWrite()=0
Notifies that a checkpoint is going to be written with the current parameters.
virtual IDataWriter * dataWriter()=0
Returns the associated writer.
virtual void setFileName(const String &file_name)=0
Sets the name of the checkpoint file.
Interface for writing variable data.
Definition IDataWriter.h:45
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
ConstArrayView< Real > RealConstArrayView
C equivalent of a 1D array of reals.
Definition UtilsTypes.h:488