21 #ifndef __ANTARES_LIBS_STUDY_ACTION_ACTION_H__
22 #define __ANTARES_LIBS_STUDY_ACTION_ACTION_H__
24 #include <yuni/yuni.h>
25 #include <yuni/core/tree/treeN.h>
26 #include <yuni/core/string.h>
28 #include <antares/study/study.h>
31 namespace Antares::Action
35 class IAction:
public Yuni::Core::TreeN<IAction>
41 using Ptr = AncestorType::Ptr;
82 void datagridCaption(Yuni::String& title);
102 virtual bool bold()
const;
112 virtual bool canDoSomething()
const;
114 virtual bool allowUpdate()
const;
115 virtual bool allowSkip()
const;
116 virtual bool allowOverwrite()
const;
117 virtual bool shouldPrepareRootNode()
const;
127 void behavior(Behavior newBehavior);
140 virtual void behaviorToText(Behavior
behavior, Yuni::String& out);
173 void internalDump(Yuni::String& tmp, uint level)
const;
179 #include "action.hxx"
virtual void createPostActionsWL(const IAction::Ptr &node)
Create post actions (if any)
Definition: action.hxx:82
std::vector< Ptr > Vector
Vector.
Definition: action.h:46
bool perform(Context &ctx, bool recursive=true)
Perform the action.
Definition: action.cpp:144
virtual bool bold() const
Get if the action should be represented with a bold font.
Definition: action.hxx:26
IAction()
Default constructor.
Definition: action.cpp:29
AncestorType::Ptr Ptr
The most suitable smart ptr for the class.
Definition: action.h:41
bool prepare(Context &ctx)
Make preparations for the execution.
Definition: action.cpp:101
Behavior behavior() const
Get the behavior.
Definition: action.hxx:36
AncestorType::iterator iterator
iterator
Definition: action.h:49
virtual void prepareSkipWL(Context &)
Prepare the execution (when the behavior says that the action should be skipped)
Definition: action.h:153
virtual void registerViewsWL(Context &)
Register all views.
Definition: action.h:161
virtual ~IAction()
Destructor.
Definition: action.cpp:34
bool prepareRootNode(Context &ctx)
Look for the root node and make preparations for the execution.
Definition: action.cpp:134
void dump() const
Dump the tree from this node to the stdcout.
Definition: action.cpp:56
Yuni::Core::TreeN< IAction > AncestorType
The ancestor.
Definition: action.h:39
ActionInformations pInfos
All data related to the action.
Definition: action.h:170
virtual bool autoExpand() const
Auto-expand.
Definition: action.hxx:31
void registerViews(Context &ctx)
Register if possible the action into the appropriate view.
Definition: action.cpp:124
bool prepareStack(Vector &vector)
Prepare the whole list of actions to execute in the given order.
Definition: action.cpp:179
virtual bool prepareWL(Context &ctx)=0
Prepare the execution.
virtual bool visible() const
Get if the action should be visible to the user.
Definition: action.hxx:77
Yuni::String message() const
Get the message of the action.
Definition: action.cpp:44
virtual bool performWL(Context &ctx)=0
Perform the action.
AncestorType::ThreadingPolicy ThreadingPolicy
The threading policy.
Definition: action.h:43
Yuni::String caption() const
Get the caption of the action.
Definition: action.cpp:38
void createPostActions(const IAction::Ptr &node)
Create post actions if required.
Definition: action.cpp:207