Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IDataWriter.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/* IDataWriter.h (C) 2000-2025 */
9/* */
10/* Interface for writing variable data. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IDATAWRITER_H
13#define ARCANE_CORE_IDATAWRITER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28/*!
29 * \ingroup IO
30 \brief Interface for writing variable data.
31
32 During a write operation, the order of calls is as follows:
33 \code
34 * IDataWriter* writer = ...;
35 * writer->beginWrite(vars)
36 * writer->setMetaData()
37 * foreach(var in vars)
38 * writer->write(var,var_data)
39 * writer->endWriter()
40 \endcode
41 \a vars contains the list of variables that will be saved
42 \sa IDataReader
43 */
44class ARCANE_CORE_EXPORT IDataWriter
45{
46 public:
47
48 //! Frees resources
49 virtual ~IDataWriter() = default;
50
51 public:
52
53 virtual void beginWrite(const VariableCollection& vars) = 0;
54 virtual void endWrite() = 0;
55
56 public:
57
58 //! Sets the metadata information
59 virtual void setMetaData(const String& meta_data) = 0;
60
61 public:
62
63 //! Writes the data \a data of the variable \a var
64 virtual void write(IVariable* var, IData* data) = 0;
65};
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
69
70} // namespace Arcane
71
72/*---------------------------------------------------------------------------*/
73/*---------------------------------------------------------------------------*/
74
75#endif
Declarations of Arcane's general types.
Interface for writing variable data.
Definition IDataWriter.h:45
virtual void setMetaData(const String &meta_data)=0
Sets the metadata information.
virtual ~IDataWriter()=default
Frees resources.
virtual void write(IVariable *var, IData *data)=0
Writes the data data of the variable var.
Interface of a data item.
Definition IData.h:34
Interface of a variable.
Definition IVariable.h:40
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --