SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
This object provides applications a way to configure a task using information adapted from its dependencies. More...
#include <Adaptor.h>
Public Types | |
using | Configuration = nlohmann::json |
Task adaptors are configured using JSON. | |
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::Adaptor) | |
smtkSuperclassMacro (smtk::resource::Component) | |
smtkSharedFromThisMacro (smtk::resource::PersistentObject) | |
Adaptor () | |
Construct an unconfigured adaptor. | |
Adaptor (const Configuration &config) | |
Adaptor (const Configuration &config, Task *from, Task *to) | |
~Adaptor () override=default | |
Destructor must be virtual. | |
const smtk::resource::ResourcePtr | resource () const override |
Components are required to return their owning resource (if any). More... | |
std::string | name () const override |
Return the name of the object - by default it will return the UUID but that can be overridden. | |
const common::UUID & | id () const override |
Return a unique identifier for the object which will be persistent across sessions. | |
bool | setId (const common::UUID &uid) override |
Assign an ID to this object (used by readers; not for arbitrary reuse). More... | |
virtual bool | updateDownstreamTask (State upstreamPrev, State upstreamNext)=0 |
Subclasses must override this method and respond to changes in the state of the upstream task as provided. More... | |
Task * | from () const |
The task this adaptor uses to fetch configuration parameters. | |
Task * | to () const |
The task to which this adaptor applies configuration parameters. | |
Public Member Functions inherited from smtk::resource::Component | |
smtkTypeMacro (smtk::resource::Component) | |
smtkSuperclassMacro (smtk::resource::PersistentObject) | |
smtkSharedFromThisMacro (smtk::resource::PersistentObject) | |
virtual Resource * | parentResource () const |
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 | configureId (const Configuration &config) |
Protected Attributes | |
smtk::common::UUID | m_id |
Task * | m_from { nullptr } |
Task * | m_to { nullptr } |
smtk::task::Task::Observers::Key | m_observer |
This object provides applications a way to configure a task using information adapted from its dependencies.
|
overridevirtual |
Components are required to return their owning resource (if any).
Components may not have an owning resource at some points in their lifecycle, so be sure to verify the returned value is non-null.
Implements smtk::resource::Component.
|
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.
|
pure virtual |
Subclasses must override this method and respond to changes in the state of the upstream task as provided.
Note this method replaces reconfigureTask()
method which has been removed.
Implemented in smtk::task::adaptor::ConfigureOperation, and smtk::task::adaptor::ResourceAndRole.