Antares Simulator
Power System Simulator
action.hxx
1 /*
2  * Copyright 2007-2025, RTE (https://www.rte-france.com)
3  * See AUTHORS.txt
4  * SPDX-License-Identifier: MPL-2.0
5  * This file is part of Antares-Simulator,
6  * Adequacy and Performance assessment for interconnected energy networks.
7  *
8  * Antares_Simulator is free software: you can redistribute it and/or modify
9  * it under the terms of the Mozilla Public Licence 2.0 as published by
10  * the Mozilla Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * Antares_Simulator is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * Mozilla Public Licence 2.0 for more details.
17  *
18  * You should have received a copy of the Mozilla Public Licence 2.0
19  * along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20  */
21 #ifndef __ANTARES_LIBS_STUDY_ACTION_ACTION_HXX__
22 #define __ANTARES_LIBS_STUDY_ACTION_ACTION_HXX__
23 
24 namespace Antares::Action
25 {
26 inline bool IAction::bold() const
27 {
28  return false;
29 }
30 
31 inline bool IAction::autoExpand() const
32 {
33  return false;
34 }
35 
36 inline Behavior IAction::behavior() const
37 {
38  ThreadingPolicy::MutexLocker locker(*this);
39  return pInfos.behavior;
40 }
41 
42 inline State IAction::state() const
43 {
44  ThreadingPolicy::MutexLocker locker(*this);
45  return pInfos.state;
46 }
47 
48 inline bool IAction::canDoSomething() const
49 {
50  return true;
51 }
52 
53 inline bool IAction::allowUpdate() const
54 {
55  return false;
56 }
57 
58 inline bool IAction::allowSkip() const
59 {
60  return true;
61 }
62 
63 inline bool IAction::allowOverwrite() const
64 {
65  return true;
66 }
67 
68 inline bool IAction::shouldPrepareRootNode() const
69 {
70  return false;
71 }
72 
73 inline void IAction::datagridCaption(Yuni::String&)
74 {
75 }
76 
77 inline bool IAction::visible() const
78 {
79  return true;
80 }
81 
83 {
84  // do nothing
85 }
86 
87 } // namespace Antares::Action
88 
89 #endif // __ANTARES_LIBS_STUDY_ACTION_ACTION_HXX__
State state
State of the action.
Definition: fwd.h:58
Behavior behavior
Behavior of the action.
Definition: fwd.h:56
virtual void createPostActionsWL(const IAction::Ptr &node)
Create post actions (if any)
Definition: action.hxx:82
virtual bool bold() const
Get if the action should be represented with a bold font.
Definition: action.hxx:26
AncestorType::Ptr Ptr
The most suitable smart ptr for the class.
Definition: action.h:41
Behavior behavior() const
Get the behavior.
Definition: action.hxx:36
ActionInformations pInfos
All data related to the action.
Definition: action.h:170
virtual bool autoExpand() const
Auto-expand.
Definition: action.hxx:31
virtual bool visible() const
Get if the action should be visible to the user.
Definition: action.hxx:77