SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
11 #ifndef smtk_task_Manager_h
12 #define smtk_task_Manager_h
14 #include "smtk/CoreExports.h"
18 #include "smtk/common/Managers.h"
20 #include "smtk/operation/Manager.h"
21 #include "smtk/string/Token.h"
23 #include "smtk/task/Active.h"
24 #include "smtk/task/Adaptor.h"
25 #include "smtk/task/Gallery.h"
27 #include "smtk/task/Task.h"
30 #include "nlohmann/json.hpp"
35 #include <type_traits>
78 void operator=(
const Manager&) =
delete;
87 const TaskInstances& taskInstances()
const {
return m_taskInstances; }
91 const Active& active()
const {
return m_active; }
100 const AdaptorInstances& adaptorInstances()
const {
return m_adaptorInstances; }
103 smtk::common::Managers::Ptr
managers()
const {
return m_managers.lock(); }
104 void setManagers(
const smtk::common::Managers::Ptr& managers);
108 nlohmann::json getStyles()
const {
return m_styles; };
109 void setStyles(
const nlohmann::json& styles) { m_styles = styles; }
116 const Gallery& gallery()
const {
return m_gallery; }
139 smtk::operation::Operation::Result result);
141 TaskInstances m_taskInstances;
142 AdaptorInstances m_adaptorInstances;
144 std::weak_ptr<smtk::common::Managers> m_managers;
146 nlohmann::json m_styles;
150 smtk::operation::Observers::Key m_taskEventObserver;
161 #endif // smtk_task_Manager_h
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
Gallery represents a map of tasks worklets.
Definition: Gallery.h:34
TaskManagerWorkflowObservers & workflowObservers()
Return the set of observers of workflow events (so you can insert/remove an observer).
Definition: Manager.h:123
std::function< void(const std::set< Task * > &, WorkflowEvent, Task *)> TaskManagerWorkflowObserver
Indicate that a workflow is undergoing creation, destruction, or a topology change.
Definition: Manager.h:61
TaskManagerAdaptorObservers & adaptorObservers()
Return the set of observers of adaptor events (so you can insert/remove an observer).
Definition: Manager.h:121
TaskManagerTaskObservers & taskObservers()
Return the set of observers of task events (so you can insert/remove an observer).
Definition: Manager.h:119
AdaptorInstances & adaptorInstances()
Return the set of managed adaptor instances.
Definition: Manager.h:99
std::function< void(smtk::common::InstanceEvent, const std::shared_ptr< Task > &)> TaskManagerTaskObserver
Indicate that a task is being managed or unmanaged.
Definition: Manager.h:47
Active & active()
Return a tracker for the active task.
Definition: Manager.h:90
The Instances class is used to manage instances of objects which share an inherited base type (the Ba...
Definition: Instances.h:43
A task manager is responsible for creating new tasks.
Definition: Manager.h:68
Track smtk::task::Task objects with smtk::common::Instances.
Definition: Instances.h:57
WorkflowEvent
An enum for events in the lifecycle of a workflow (tree of tasks).
Definition: Instances.h:29
std::vector< smtk::model::Instance > Instances
Definition: PublicPointerDefs.h:189
#define smtkCreateMacro(...)
Add static create() methods to a class.
Definition: SharedFromThis.h:173
#define smtkEnableSharedPtr(...)
An abbreviation for enabling shared pointers.
Definition: SharedFromThis.h:214
static constexpr smtk::operation::Observers::Priority operationObserverPriority()
Use an elevated priority for the task-manager's observation of operations.
Definition: Manager.h:129
Operation is a base class for all SMTK operations.
Definition: Operation.h:61
InstanceEvent
Events that an instance-manager can observe.
Definition: Instances.h:23
An abstract base class for SMTK resources.
Definition: Resource.h:72
Task is a base class for all SMTK tasks.
Definition: Task.h:73
int Priority
A value to indicate the relative order in which an observer should be called.
Definition: Observers.h:73
A string token identified by an integer.
Definition: Token.h:29
smtk::common::Instances< smtk::task::Adaptor, void, std::tuple< smtk::task::Adaptor::Configuration & >, std::tuple< smtk::task::Adaptor::Configuration &, smtk::task::Task *, smtk::task::Task * > > Instances
Track smtk::task::Adaptor objects with smtk::common::Instances.
Definition: Instances.h:39
smtk::common::Managers::Ptr managers() const
Return the managers instance that contains this manager, if it exists.
Definition: Manager.h:103
TaskInstances & taskInstances()
Return the set of managed task instances.
Definition: Manager.h:86
Macros for dealing with shared-pointer classes.
#define smtkTypeMacroBase(...)
Add typedefs to a class for identifcation.
Definition: SharedFromThis.h:131
EventType
Enumerate events that an operation may encounter.
Definition: Observer.h:30
Gallery & gallery()
Return a gallery of Task Worklets.
Definition: Manager.h:115
This object provides applications a way to change and observe the active task.
Definition: Active.h:37
std::function< void(smtk::common::InstanceEvent, const std::shared_ptr< Adaptor > &)> TaskManagerAdaptorObserver
Indicate that an adaptor is being managed or unmanaged.
Definition: Manager.h:54