SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Namespaces | Classes | Typedefs | Enumerations | Functions
smtk::task Namespace Reference

User-interface tasks. More...

Namespaces

 adaptor
 Adaptors that configure downstream tasks.
 
 json
 JSON serialization and deserialization of tasks.
 

Classes

class  Active
 This object provides applications a way to change and observe the active task. More...
 
class  Adaptor
 This object provides applications a way to configure a task using information adapted from its dependencies. More...
 
class  FillOutAttributes
 FillOutAttributes is a task that is incomplete until specified attributes are valid. More...
 
class  GatherResources
 GatherResources is a task that requires resources from a resource manager. More...
 
class  Group
 Group is a task that owns children and draws its state from them. More...
 
class  Instances
 Track smtk::task::Task objects with smtk::common::Instances. More...
 
class  Manager
 A task manager is responsible for creating new tasks. More...
 
class  Registrar
 
class  Task
 Task is a base class for all SMTK tasks. More...
 
class  UIState
 Stores UI state data for task UI classes. More...
 
class  UIStateGenerator
 Pure virtual class for read/write UI state data. More...
 

Typedefs

using TaskInstancesBase = smtk::common::Instances< smtk::task::Task, void, std::tuple< smtk::task::Task::Configuration &, smtk::task::Manager &, std::shared_ptr< smtk::common::Managers > >, std::tuple< smtk::task::Task::Configuration &, smtk::task::Task::PassedDependencies, smtk::task::Manager &, std::shared_ptr< smtk::common::Managers > >>
 
using TaskList = std::tuple< Task, FillOutAttributes, GatherResources, Group >
 
using TaskJSON = std::tuple< json::jsonTask, json::jsonFillOutAttributes, json::jsonGatherResources, json::jsonGroup >
 
using AdaptorList = std::tuple< adaptor::ResourceAndRole >
 
using AdaptorJSON = std::tuple< json::jsonResourceAndRole >
 

Enumerations

enum  WorkflowEvent {
  WorkflowEvent::Created, WorkflowEvent::TaskAdded, WorkflowEvent::TaskRemoved, WorkflowEvent::Destroyed,
  WorkflowEvent::Resuming
}
 An enum for events in the lifecycle of a workflow (tree of tasks). More...
 
enum  State {
  State::Irrelevant, State::Unavailable, State::Incomplete, State::Completable,
  State::Completed
}
 The set of states that a task may take on. More...
 

Functions

std::string stateName (const State &s)
 A type-conversion operation to cast enumerants to strings.
 
State stateEnum (const std::string &s, bool *valid=nullptr)
 A type-conversion operation to cast strings to enumerants.
 
std::ostream & operator<< (std::ostream &os, const State &s)
 States may be appended to streams.
 
void workflowsOfTask (Task *task, std::set< smtk::task::Task * > &workflows, std::set< smtk::task::Task * > &visited)
 Free functions that populate a set of workflow "head" tasks for an input task (this is the set of tasks that task ultimately depends on but are not themselves dependent on any task). More...
 
std::set< smtk::task::Task * > workflowsOfTask (Task &task)
 
SMTKCORE_EXPORT std::set< smtk::task::Task * > workflowsOfTask (const Task &task)
 
void to_json (nlohmann::json &j, const smtk::task::Adaptor::Ptr &adaptor)
 
void from_json (const nlohmann::json &j, smtk::task::Adaptor::Ptr &adaptor)
 
void from_json (const nlohmann::json &j, FillOutAttributes::AttributeSet &attributeSet)
 
void to_json (nlohmann::json &j, const FillOutAttributes::AttributeSet &attributeSet)
 
void from_json (const nlohmann::json &j, FillOutAttributes::ResourceAttributes &resourceAttributes)
 
void to_json (nlohmann::json &j, const FillOutAttributes::ResourceAttributes &resourceAttributes)
 
void from_json (const nlohmann::json &j, GatherResources::ResourceSet &resourceSet)
 
void to_json (nlohmann::json &j, const GatherResources::ResourceSet &resourceSet)
 
void to_json (nlohmann::json &jj, const smtk::task::Task::Ptr &task)
 
void from_json (const nlohmann::json &jj, smtk::task::Task::Ptr &task)
 

Detailed Description

User-interface tasks.

Enumeration Type Documentation

◆ State

enum smtk::task::State
strong

The set of states that a task may take on.

Enumerator
Irrelevant 

The user's work in prior tasks mean this task needs no user input.

Unavailable 

The task's dependencies are unmet.

Incomplete 

The task is available but its objective is not accomplished.

Completable 

The task is available and accomplished but has not been marked complete.

Completed 

The task has been marked completed by the user.

◆ WorkflowEvent

An enum for events in the lifecycle of a workflow (tree of tasks).

Enumerator
Created 

A workflow has been created.

TaskAdded 

A task has been added to the workflow.

TaskRemoved 

A task has been removed from the workflow.

Destroyed 

The tasks in the workflow have become unmanaged or dependent on another workflow.

Resuming 

Notifications had been paused and now are not.

The reported workflow heads are all extant workflows current. This event is also used to initialize observers added after tasks have been created.

Function Documentation

◆ from_json()

void SMTKCORE_EXPORT smtk::task::from_json ( const nlohmann::json &  j,
Manager taskManager 
)

Serialize/deserialize a task manager.

Note that the caller must push a smtk::task::json::Helper onto the stack before calling these methods and the helper must have its smtk::common::Managers set in order for these methods to work.

◆ to_json()

void SMTKCORE_EXPORT smtk::task::to_json ( nlohmann::json &  jj,
const Manager manager 
)

Serialize/deserialize a task manager.

Note that the caller must push a smtk::task::json::Helper onto the stack before calling these methods and the helper must have its smtk::common::Managers set in order for these methods to work.

◆ workflowsOfTask()

SMTKCORE_EXPORT void smtk::task::workflowsOfTask ( Task task,
std::set< smtk::task::Task * > &  workflows,
std::set< smtk::task::Task * > &  visited 
)

Free functions that populate a set of workflow "head" tasks for an input task (this is the set of tasks that task ultimately depends on but are not themselves dependent on any task).

The variant that accepts visited can be used to efficiently accumulate workflows across several tasks (by pruning visited nodes from its traversal).