Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
DefaultBackwardMng.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/* DefaultBackwardMng.h (C) 2000-2016 */
9/* */
10/* Default implementation of a backward strategy. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MAIN_DEFAULTBACKWARDMNG_H
13#define ARCANE_MAIN_DEFAULTBACKWARDMNG_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/IBackwardMng.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28class IVariableFilter;
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
37class ARCANE_IMPL_EXPORT DefaultBackwardMng
38: public IBackwardMng
39{
40 private:
41
55
56 public:
57
58 DefaultBackwardMng(ITraceMng* trace, ISubDomain* sub_domain);
60
61 void init() override {}
62
63 void beginAction() override;
64
65 void endAction() override;
66
67 void setSavePeriod(Integer n) override { m_period = n; }
68 Integer savePeriod() const override { return m_period; }
69
70 void goBackward() override;
71
72 bool isLocked() const override { return m_sequence == SEQLock; }
73
74 bool isBackwardEnabled() const override { return m_sequence == SEQRestore; }
75
76 void clear() override;
77
78 virtual bool checkAndApplyRestore() override;
79 virtual bool checkAndApplySave(bool is_forced) override;
80
81 private:
82
83 void _restore();
84
85 void _save();
86
87 private:
88
89 ITraceMng* m_trace;
90 ISubDomain* m_sub_domain;
91 IVariableFilter* m_filter;
92 IDataReaderWriter* m_data_io;
93
96
99
102
105
108
109 private:
110
111 void _checkValidAction();
112 void _checkSave(bool is_forced);
113};
114
115/*---------------------------------------------------------------------------*/
116/*---------------------------------------------------------------------------*/
117
118} // namespace Arcane
119
120/*---------------------------------------------------------------------------*/
121/*---------------------------------------------------------------------------*/
122
123#endif
bool isBackwardEnabled() const override
Indicates if a backward rollback is scheduled.
void init() override
Initialization of the backward manager.
Integer m_period
Period between two saves for backward tracking.
bool isLocked() const override
Indicates if the backward rollback saves are locked.
bool m_action_refused
Actions allowed?
Real m_backward_time
Time of the last requested backward action.
Interface managing backward strategies.
Interface for reading/writing variable data.
Interface of the subdomain manager.
Definition ISubDomain.h:75
Functor of a filter applicable to variables.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
double Real
Type representing a real number.