Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ITimeHistoryMng.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/* ITimeHistoryMng.h (C) 2000-2025 */
9/* */
10/* Interface of the class managing a history of values. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ITIMEHISTORYMNG_H
13#define ARCANE_CORE_ITIMEHISTORYMNG_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
19#include "arcane/utils/FatalErrorException.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
34{
35 public:
36
44 TimeHistoryAddValueArg(const String& name, bool end_time, Integer subdomain_id)
45 : m_name(name)
46 , m_end_time(end_time)
47 , m_subdomain_id(subdomain_id)
48 {}
49
58 TimeHistoryAddValueArg(const String& name, bool end_time)
59 : TimeHistoryAddValueArg(name, end_time, NULL_SUB_DOMAIN_ID)
60 {}
61
70 explicit TimeHistoryAddValueArg(const String& name)
71 : TimeHistoryAddValueArg(name, true)
72 {}
73
74 public:
75
76 const String& name() const { return m_name; }
77 bool endTime() const { return m_end_time; }
78 bool isLocal() const { return m_subdomain_id != NULL_SUB_DOMAIN_ID; }
79 Integer localSubDomainId() const { return m_subdomain_id; }
80
81 private:
82
83 String m_name;
84 bool m_end_time;
85 Integer m_subdomain_id;
86};
87
88/*---------------------------------------------------------------------------*/
89/*---------------------------------------------------------------------------*/
90
96
97/*---------------------------------------------------------------------------*/
98/*---------------------------------------------------------------------------*/
130{
131 public:
132
133 virtual ~ITimeHistoryMng() = default;
134
135 public:
136
137 // TODO Deprecated
149 virtual void addValue(const String& name, Real value, bool end_time = true, bool is_local = false) = 0;
161 virtual void addValue(const String& name, Int32 value, bool end_time = true, bool is_local = false) = 0;
173 virtual void addValue(const String& name, Int64 value, bool end_time = true, bool is_local = false) = 0;
186 virtual void addValue(const String& name, RealConstArrayView value, bool end_time = true, bool is_local = false) = 0;
199 virtual void addValue(const String& name, Int32ConstArrayView value, bool end_time = true, bool is_local = false) = 0;
212 virtual void addValue(const String& name, Int64ConstArrayView value, bool end_time = true, bool is_local = false) = 0;
213
214 public:
215
216 virtual void timeHistoryBegin() = 0;
217 virtual void timeHistoryEnd() = 0;
218 virtual void timeHistoryInit() = 0;
219 virtual void timeHistoryStartInit() = 0;
220 virtual void timeHistoryContinueInit() = 0;
221 virtual void timeHistoryRestore() = 0;
222
223 public:
224
226 virtual ARCANE_DEPRECATED void addCurveWriter(ITimeHistoryCurveWriter* writer)
227 {
228 ARCANE_UNUSED(writer);
229 ARCANE_FATAL("No longer supported. Use 'ITimeHistoryCurveWriter2' interface");
230 }
231
233 virtual ARCANE_DEPRECATED void removeCurveWriter(ITimeHistoryCurveWriter* writer)
234 {
235 ARCANE_UNUSED(writer);
236 ARCANE_FATAL("No longer supported. Use 'ITimeHistoryCurveWriter2' interface");
237 }
238
240 virtual void addCurveWriter(ITimeHistoryCurveWriter2* writer) = 0;
241
244
246 virtual void removeCurveWriter(const String& name) = 0;
247
248 public:
249
256 virtual void dumpHistory(bool is_verbose) = 0;
257
263 virtual void dumpCurves(ITimeHistoryCurveWriter2* writer) = 0;
264
272 virtual bool active() const = 0;
273
278 virtual void setActive(bool is_active) = 0;
279
284
291 virtual bool isDumpActive() const = 0;
292
296 virtual void setDumpActive(bool is_active) = 0;
297
301 virtual bool isShrinkActive() const = 0;
302
306 virtual void setShrinkActive(bool is_active) = 0;
307
308 public:
309
311 virtual ITimeHistoryMngInternal* _internalApi() { ARCANE_FATAL("Invalid usage"); };
312};
313
314/*---------------------------------------------------------------------------*/
315/*---------------------------------------------------------------------------*/
316
317} // namespace Arcane
318
319/*---------------------------------------------------------------------------*/
320/*---------------------------------------------------------------------------*/
321
322#endif
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Declarations of Arcane's general types.
Declarations of types used in Arcane.
Class interface allowing the addition of one or more values to a value history.
Interface for the internal part of a value history manager.
Class managing a history of values.
virtual void removeCurveWriter(ITimeHistoryCurveWriter2 *writer)=0
Removes a writer.
virtual void dumpCurves(ITimeHistoryCurveWriter2 *writer)=0
Uses the writer writer to output all curves.
virtual bool isDumpActive() const =0
Indicates the output activation status.
virtual void setShrinkActive(bool is_active)=0
Sets the boolean indicating if the history is compressed.
virtual void addValue(const String &name, Real value, bool end_time=true, bool is_local=false)=0
Adds the value value to the history name.
virtual void addValue(const String &name, RealConstArrayView value, bool end_time=true, bool is_local=false)=0
Adds the value value to the history name.
virtual ARCANE_DEPRECATED void removeCurveWriter(ITimeHistoryCurveWriter *writer)
Removes a writer.
virtual void addValue(const String &name, Int64ConstArrayView value, bool end_time=true, bool is_local=false)=0
virtual void setDumpActive(bool is_active)=0
Sets the output activation status.
virtual bool isShrinkActive() const =0
Returns a boolean indicating if the history is compressed.
virtual ~ITimeHistoryMng()=default
Frees resources.
virtual void dumpHistory(bool is_verbose)=0
Saves the history.
virtual void setActive(bool is_active)=0
Sets the activation status.
virtual void addCurveWriter(ITimeHistoryCurveWriter2 *writer)=0
Adds a writer.
virtual void addValue(const String &name, Int64 value, bool end_time=true, bool is_local=false)=0
virtual void applyTransformation(ITimeHistoryTransformer *v)=0
Applies the transformation v to all curves.
virtual void removeCurveWriter(const String &name)=0
Removes the writer with name name.
virtual void addValue(const String &name, Int32ConstArrayView value, bool end_time=true, bool is_local=false)=0
Adds the value value to the history name.
virtual void addValue(const String &name, Int32 value, bool end_time=true, bool is_local=false)=0
Adds the value value to the history name.
virtual ARCANE_DEPRECATED void addCurveWriter(ITimeHistoryCurveWriter *writer)
Adds a writer.
virtual bool active() const =0
Indicates the activation status.
virtual ITimeHistoryMngInternal * _internalApi()
Internal Arcane API.
Interface of an object transforming history curves.
TimeHistoryAddValueArg(const String &name, bool end_time, Integer subdomain_id)
Constructor with three parameters.
TimeHistoryAddValueArg(const String &name)
Constructor with one parameter.
TimeHistoryAddValueArg(const String &name, bool end_time)
Constructor with two parameters.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:482
ConstArrayView< Int64 > Int64ConstArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:480
double Real
Type representing a real number.
std::int32_t Int32
Signed integer type of 32 bits.
ConstArrayView< Real > RealConstArrayView
C equivalent of a 1D array of reals.
Definition UtilsTypes.h:488