|
SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
Worklet represents a set of tasks created to reuse a set of workflow logic in multiple workflows. More...
#include <Worklet.h>
Public Types | |
| using | Configuration = nlohmann::json |
| Worklets are configured with arbitrary JSON objects, though this may change. | |
Public Types inherited from smtk::resource::Component | |
| typedef std::function< void(const ComponentPtr &)> | Visitor |
| typedef detail::ComponentLinks | Links |
| typedef detail::ComponentProperties | Properties |
Public Member Functions | |
| smtkTypeMacro (smtk::task::Worklet) | |
| smtkSuperclassMacro (smtk::resource::Component) | |
| smtkCreateMacro (smtk::task::Worklet) | |
| Worklet (const Configuration &config, Manager &taskManager, const std::shared_ptr< smtk::common::Managers > &managers=nullptr) | |
| void | configure (const Configuration &config, Manager &taskManager) |
| A method called by all constructors passed Configuration information. More... | |
| const Configuration & | configuration () const |
| Return the worklet's configuration. | |
| const common::UUID & | id () const override |
| Set/get the worklet's unique identifier. | |
| bool | setId (const common::UUID &newId) override |
| Assign an ID to this object (used by readers; not for arbitrary reuse). More... | |
| std::string | name () const override |
| Return the worklet's name. | |
| const std::shared_ptr< resource::Resource > | resource () const override |
| Return the resource that owns the worklet. | |
| const std::string & | schema () const |
| Return the schema used by the worklet. | |
| int | version () const |
| Return the version of the worklet. | |
| const std::string & | operationName () const |
| Return the operation name to be used to instantiate the worklet If none is specified in the worklet's configuration, then smtk::task::EmplaceWorklet will be used. | |
| const std::string & | description () const |
| Return the description of the worklet. | |
| std::shared_ptr< Manager > | manager () const |
| Return the Task Manager managing the worklet. | |
| void | setCategories (const std::set< std::string > &cats) |
| Set/Get the categories associated with this worklet. More... | |
| const std::set< std::string > & | categories () const |
| Set/Get the categories associated with this worklet. More... | |
Public Member Functions inherited from smtk::resource::Component | |
| smtkTypeMacro (smtk::resource::Component) | |
| smtkSuperclassMacro (smtk::resource::PersistentObject) | |
| smtkSharedFromThisMacro (smtk::resource::PersistentObject) | |
| Resource * | parentResource () const override |
| Return a raw (not shared) pointer to the resource that owns this component. More... | |
| template<typename ResourceType > | |
| ResourceType * | parentResourceAs () const |
| This variant of parentResource casts the result to the given ResourceType. | |
| Links & | links () override |
| Return the links that connect this component to external resources/components. | |
| const Links & | links () const override |
| Properties & | properties () override |
| Return properties defined on this component. | |
| const Properties & | properties () const override |
Public Member Functions inherited from smtk::resource::PersistentObject | |
| smtkTypeMacroBase (smtk::resource::PersistentObject) | |
| template<typename T > | |
| T::Ptr | as () |
| Attempt to cast this object to a subclass. | |
| template<typename T > | |
| T::ConstPtr | as () const |
| Attempt to cast this object to a subclass. | |
Protected Member Functions | |
| void | setName (const std::string &newName) |
| Sets the name of the Worklet - to be used via the smtk::task::Gallery. | |
Protected Attributes | |
| std::string | m_name |
| Worklet's name to present to the user. | |
| smtk::common::UUID | m_id |
| Worklet's UUID. | |
| std::string | m_schema |
| Worklet's schema. | |
| int | m_version = 0 |
| Worklet's version. | |
| std::string | m_operationName |
| Worklet's operation name. | |
| std::string | m_description |
| Worklet's description string. | |
| std::weak_ptr< smtk::task::Manager > | m_manager |
| If this worklet is being managed, this will refer to its manager. | |
| Configuration | m_configuration |
| The JSON configuration of the worklet. | |
| std::set< std::string > | m_categories |
| Categories associated with the worklet. | |
Friends | |
| class | Gallery |
Worklet represents a set of tasks created to reuse a set of workflow logic in multiple workflows.
|
inline |
Set/Get the categories associated with this worklet.
These categories are used by category expressions associated with a task's agents to see if the tasks generated from the worklet would be appropriate children tasks, or with the task manager to see if the generated tasks would be appropriate top-level tasks.
| void smtk::task::Worklet::configure | ( | const Configuration & | config, |
| Manager & | taskManager | ||
| ) |
A method called by all constructors passed Configuration information.
Calling this outside of the constructor will reconfigure the worklet
| void smtk::task::Worklet::setCategories | ( | const std::set< std::string > & | cats | ) |
Set/Get the categories associated with this worklet.
These categories are used by category expressions associated with a task's agents to see if the tasks generated from the worklet would be appropriate children tasks, or with the task manager to see if the generated tasks would be appropriate top-level tasks.
|
overridevirtual |
Assign an ID to this object (used by readers; not for arbitrary reuse).
TODO: care must be taken to modify the recorded ID in all links that connect to this object (see Resource::setId and its treatment of manager registration for reference).
Implements smtk::resource::PersistentObject.
1.8.17