|
SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A task manager is responsible for creating new tasks. More...
#include <Manager.h>
Public Types | |
| using | ResourceObjectMap = std::map< smtk::resource::Resource *, std::unordered_set< smtk::resource::PersistentObject * > > |
| A map of objects grouped by their parent resource. More... | |
| using | TaskInstances = smtk::task::Instances |
| Managed instances of Task objects (and a registry of Task classes). | |
| using | AdaptorInstances = smtk::task::adaptor::Instances |
| Managed instances of Adaptor objects (and a registry of Adaptor classes). | |
| using | PortInstances = smtk::task::PortInstances |
| Managed instances of Port objects (and a registry od Port subclasses). | |
| using | AgentFactory = smtk::common::Factory< smtk::task::Agent, Task * > |
| The signatures the agent factory uses to construct agents. | |
Public Member Functions | |
| smtkTypeMacroBase (smtk::task::Manager) | |
| smtkCreateMacro (smtk::task::Manager) | |
| Manager (smtk::resource::Resource *parent) | |
| Manager (const Manager &)=delete | |
| void | operator= (const Manager &)=delete |
| TaskInstances & | taskInstances () |
| Return the set of managed task instances. More... | |
| const TaskInstances & | taskInstances () const |
| Active & | active () |
| Return a tracker for the active task. | |
| const Active & | active () const |
| AdaptorInstances & | adaptorInstances () |
| Return the set of managed adaptor instances. More... | |
| const AdaptorInstances & | adaptorInstances () const |
| PortInstances & | portInstances () |
| Return the set of managed task-port instances. More... | |
| const PortInstances & | portInstances () const |
| const AgentFactory & | agentFactory () const |
| Return a factory to create agents for tasks. | |
| AgentFactory & | agentFactory () |
| smtk::common::Managers::Ptr | managers () const |
| Return the managers instance that contains this manager, if it exists. | |
| void | setManagers (const smtk::common::Managers::Ptr &managers) |
| nlohmann::json | getStyle (const smtk::string::Token &styleClass) const |
| Given a style key, return a style config. | |
| nlohmann::json | getStyles () const |
| void | setStyles (const nlohmann::json &styles) |
| Overwrite this task-manager's styles with the provided styles. | |
| void | addStyles (const nlohmann::json &styles, std::unordered_map< smtk::string::Token, smtk::string::Token > &styleMap) |
| Append styles into this task manager. More... | |
| smtk::resource::Resource * | resource () const |
| If this manager is owned by a resource (typically a project), return it. | |
| ResourceObjectMap | workflowObjects (const nlohmann::json &spec, Task *task=nullptr) |
| Given a filter spec, return a set of objects grouped by their parent resources. More... | |
| ResourceObjectMap | workflowObjects (const smtk::view::Configuration::Component &spec, Task *task=nullptr) |
| bool | isResourceRelevant (const std::shared_ptr< smtk::resource::Resource > &resource, const nlohmann::json &spec) |
| Return true if the resource matches the filter spec provided. | |
| bool | isResourceRelevant (smtk::resource::Resource *resource, const nlohmann::json &spec) |
| bool | isResourceRelevant (const std::shared_ptr< smtk::resource::Resource > &resource, const smtk::view::Configuration::Component &spec) |
| bool | isResourceRelevant (smtk::resource::Resource *resource, const smtk::view::Configuration::Component &spec) |
| Gallery & | gallery () |
| Return a gallery of Task Worklets. | |
| const Gallery & | gallery () const |
| smtk::common::Categories::Expression & | toplevelExpression () |
| Return the category expression constraint for placing worklets at the top-level of the workflow. | |
| const smtk::common::Categories::Expression & | toplevelExpression () const |
| TaskManagerTaskObservers & | taskObservers () |
| Return the set of observers of task events (so you can insert/remove an observer). | |
| TaskManagerAdaptorObservers & | adaptorObservers () |
| Return the set of observers of adaptor events (so you can insert/remove an observer). | |
| TaskManagerWorkflowObservers & | workflowObservers () |
| Return the set of observers of workflow events (so you can insert/remove an observer). | |
| bool | changePortId (Port *port, std::function< bool()> fp) |
| Change the ID of a Port. More... | |
| bool | changePortName (Port *port, const std::string &newName, std::function< bool()> fp) |
| Change the Name of a Port. More... | |
Static Public Member Functions | |
| static constexpr smtk::operation::Observers::Priority | operationObserverPriority () |
| Use an elevated priority for the task-manager's observation of operations. More... | |
A task manager is responsible for creating new tasks.
Eventually, the task manager will also hold an inventory of created tasks and be a clearinghouse for task state transitions.
| using smtk::task::Manager::ResourceObjectMap = std::map<smtk::resource::Resource*, std::unordered_set<smtk::resource::PersistentObject*> > |
A map of objects grouped by their parent resource.
If a resource itself is intended for selection, one entry of its target set of objects will be the null pointer.
|
inline |
Return the set of managed adaptor instances.
This class also acts as a registrar for Adaptor subclasses.
| void smtk::task::Manager::addStyles | ( | const nlohmann::json & | styles, |
| std::unordered_map< smtk::string::Token, smtk::string::Token > & | styleMap | ||
| ) |
Append styles into this task manager.
In the event of a name collision (where the content for styles of the same name is different), the name is made unique and an entry is added to the styleMap from the original name to the uniquified name.
| bool smtk::task::Manager::changePortId | ( | Port * | port, |
| std::function< bool()> | fp | ||
| ) |
Change the ID of a Port.
This method is used to update internal data structures. Please use task::Port::setId to change the name of the Port - it will call this method with an appropriate lambda.
| bool smtk::task::Manager::changePortName | ( | Port * | port, |
| const std::string & | newName, | ||
| std::function< bool()> | fp | ||
| ) |
|
inlinestaticconstexpr |
Use an elevated priority for the task-manager's observation of operations.
This is done so that task-related events are emitted before other ordinary-priority operation observations (especially hint-processing).
|
inline |
Return the set of managed task-port instances.
This class also acts as a registrar for Port subclasses.
|
inline |
Return the set of managed task instances.
This class also acts as a registrar for Task subclasses.
| Manager::ResourceObjectMap smtk::task::Manager::workflowObjects | ( | const nlohmann::json & | spec, |
| Task * | task = nullptr |
||
| ) |
Given a filter spec, return a set of objects grouped by their parent resources.
The objects are drawn – according to the spec – from either ports of the active task or resources owned by the parent of this task manager (assuming it is a project). If a resource itself is intended to be part of the result, one of the object pointers in that resource's target set will be the null pointer.
The variant that accepts a JSON spec is for use inside task-manager style. The variant that accepts a Configuration::Component spec is for use inside view-configuration XML. The two forms of spec are similar but not identical in order to improve readability and reduce maintenance overhead.
1.8.17