SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
Go to the documentation of this file.
11 #ifndef smtk_task_Instances_h
12 #define smtk_task_Instances_h
14 #include "smtk/common/Instances.h"
15 #include "smtk/common/Managers.h"
18 #include "smtk/string/Token.h"
20 #include "smtk/task/Task.h"
46 std::shared_ptr<smtk::common::Managers>>,
51 std::shared_ptr<smtk::common::Managers>>>;
78 void operator=(
const Instances&) =
delete;
83 WorkflowObservers& workflowObservers() {
return m_workflowObservers; }
90 bool pauseWorkflowNotifications(
bool doPause);
96 bool workflowEvent(
const std::set<Task*>& workflows,
WorkflowEvent event, Task* subject);
102 Task::Ptr createFromName(
const std::string& taskType);
103 Task::Ptr createFromName(
104 const std::string& taskType,
106 std::shared_ptr<smtk::common::Managers> managers);
107 Task::Ptr createFromName(
108 const std::string& taskType,
111 std::shared_ptr<smtk::common::Managers> managers);
115 std::set<smtk::task::Task::Ptr> findByTitle(
const std::string& title)
const;
121 Manager& m_taskManager;
122 WorkflowObservers m_workflowObservers;
123 bool m_workflowNotificationsPaused =
false;
124 bool m_needNotification =
false;
130 #endif // smtk_task_Instances_h
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
std::function< void(const std::set< Task * > &, WorkflowEvent, Task *)> WorkflowObserver
The signature for observing workflow construction/destruction/modification.
Definition: Instances.h:72
nlohmann::json Configuration
Tasks are configured with arbitrary JSON objects, though this may change.
Definition: Task.h:85
std::set< Ptr > PassedDependencies
A task's dependencies are other tasks passed as shared pointers.
Definition: Task.h:83
@ Resuming
Notifications had been paused and now are not.
@ Created
A workflow has been created.
The Instances class is used to manage instances of objects which share an inherited base type (the Ba...
Definition: Instances.h:42
A task manager is responsible for creating new tasks.
Definition: Manager.h:46
Track smtk::task::Task objects with smtk::common::Instances.
Definition: Instances.h:58
WorkflowEvent
An enum for events in the lifecycle of a workflow (tree of tasks).
Definition: Instances.h:29
@ TaskRemoved
A task has been removed from the workflow.
const WorkflowObservers & workflowObservers() const
Return the set of workflow-event observers (so you can add yourself to it).
Definition: Instances.h:82
smtk::common::Singleton< detail::Manager > Manager
The Manager is a singleton interface for registering available plugins to manager instances.
Definition: Manager.h:92
#define smtkSuperclassMacro(...)
Add a typedef to the superclass of this class.
Definition: SharedFromThis.h:87
Task is a base class for all SMTK tasks.
Definition: Task.h:70
@ Destroyed
The tasks in the workflow have become unmanaged or dependent on another workflow.
A string token identified by an integer.
Definition: Token.h:30
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
#define smtkTypeMacroBase(...)
Add typedefs to a class for identifcation.
Definition: SharedFromThis.h:55
@ TaskAdded
A task has been added to the workflow.