SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
Track smtk::task::Task objects with smtk::common::Instances. More...
#include <Instances.h>
Public Member Functions | |
smtkTypeMacroBase (smtk::task::Instances) | |
smtkSuperclassMacro (smtk::task::TaskInstancesBase) | |
Instances (Manager &taskManager) | |
Instances (const Instances &)=delete | |
void | operator= (const Instances &)=delete |
std::set< smtk::task::Task::Ptr > | findByName (const std::string &name) const |
Returns the tasks with the given name. | |
std::set< smtk::task::Task::Ptr > | findByTitle (const std::string &name) const |
smtk::task::Task::Ptr | findById (const smtk::common::UUID &taskId) const |
Returns the task with the given ID. | |
Task::Ptr | createFromName (const std::string &taskType) |
Task::Ptr | createFromName (const std::string &taskType, Task::Configuration &configuration, std::shared_ptr< smtk::common::Managers > managers) |
Task::Ptr | createFromName (const std::string &taskType, smtk::task::Task::Configuration &configuration, smtk::task::Task::PassedDependencies &dependencies, std::shared_ptr< smtk::common::Managers > managers) |
Public Member Functions inherited from smtk::common::Instances< BaseType, InputTypes > | |
Instances () | |
Construct a manager of object instances. | |
Instances (const Instances &)=delete | |
Delete copy constructor and assignment operator. | |
void | operator= (const Instances &)=delete |
template<typename Type , typename... Args> | |
std::shared_ptr< Type > | create (Args &&... args) |
Create an instance of the given Type and manage it. | |
template<typename... Args> | |
std::shared_ptr< BaseType > | createFromName (const std::string &typeName, Args &&... args) |
Create and manage an instance of Type using its type-name. | |
template<typename... Args> | |
std::shared_ptr< BaseType > | createFromIndex (const std::size_t &typeIndex, Args &&... args) |
Create and manage an instance of a Type using its type-index. | |
bool | manage (const std::shared_ptr< BaseType > &instance) |
Manage an already-created instance of a class. More... | |
bool | unmanage (const std::shared_ptr< BaseType > &instance) |
Unmanage (drop the reference to) an instance. More... | |
bool | contains (const std::shared_ptr< BaseType > &instance) |
Determine whether instance is managed or not. | |
void | clear () |
Unmanage all instances. | |
Observers & | observers () |
Return the set of observers of instances (so that you can insert an observer). | |
smtk::common::Visit | visit (Visitor visitor) const |
Iterate over the collection of instances, invoking a visitor on each. More... | |
std::size_t | size () const |
Return the number of instances being managed. | |
Public Member Functions inherited from smtk::common::Factory< BaseType, InputTypes... > | |
bool | registerType () |
Register a Type to the factory. | |
bool | registerType (Metadata &&metadata) |
Register a Typeusing the Type's Metadata. | |
bool | registerTypes () |
Register a tuple of Types. | |
bool | unregisterType () |
Unregister a Type. | |
bool | unregisterType (const std::string &typeName) |
Unregister a Type using its type name. | |
bool | unregisterType (const std::size_t &typeIndex) |
Unregister a Type using its type index. | |
bool | unregisterTypes () |
Unregister a tuple of Types. | |
bool | contains () const |
Determine whether or not a Type is available. | |
bool | contains (const std::string &typeName) const |
Determine whether or not a Type is available using its type name. | |
bool | contains (const std::size_t typeIndex) const |
Determine whether or not a Type is available using its type index. | |
std::unique_ptr< Type > | create (Args &&... args) const |
Create an instance of a Type. | |
std::unique_ptr< BaseType > | createFromName (const std::string &typeName, Args &&... args) const |
Create an instance of a Type using its type name. | |
std::unique_ptr< BaseType > | createFromIndex (const std::size_t &typeIndex, Args &&... args) const |
Create an instance of a Type using its type name. | |
std::shared_ptr< Type > | make (Args &&... args) const |
Make a shared instance of a Type. | |
std::shared_ptr< BaseType > | makeFromName (const std::string &typeName, Args &&... args) const |
Make a shared instance of a Type using its type name. | |
std::shared_ptr< BaseType > | makeFromIndex (const std::size_t &typeIndex, Args &&... args) const |
Create an instance of a Type using its type name. | |
Interface< TagType, true > | get () const |
Access a convenience Interface for creating objects that singles out one of the three modes of creation: by type, by type name and by type index. | |
Protected Attributes | |
Manager & | m_taskManager |
Additional Inherited Members | |
Public Types inherited from smtk::common::Instances< BaseType, InputTypes > | |
using | Superclass = smtk::common::Factory< BaseType, InputTypes... > |
An alias for the inherited parent class. | |
using | Observer = std::function< void(InstanceEvent, const std::shared_ptr< BaseType > &)> |
The signature of observers watching managed instance lifecycle events. | |
using | Observers = smtk::common::Observers< Observer > |
Access to the set of observers of instances. | |
using | Visitor = std::function< smtk::common::Visit(const std::shared_ptr< BaseType > &)> |
The signature used to visit managed instances of objects. | |
Track smtk::task::Task objects with smtk::common::Instances.
This class adds methods to create tasks by name and will eventually index tasks by UUID and name.
Task::Ptr smtk::task::Instances::createFromName | ( | const std::string & | taskType | ) |
Create a task given its class name and optionally more configuration data.
These override the base factory methods by supplying the task manager.
Task::Ptr smtk::task::Instances::createFromName | ( | const std::string & | taskType, |
smtk::task::Task::Configuration & | configuration, | ||
smtk::task::Task::PassedDependencies & | dependencies, | ||
std::shared_ptr< smtk::common::Managers > | managers | ||
) |
Create a task given its class name and optionally more configuration data.
These override the base factory methods by supplying the task manager.
Task::Ptr smtk::task::Instances::createFromName | ( | const std::string & | taskType, |
Task::Configuration & | configuration, | ||
std::shared_ptr< smtk::common::Managers > | managers | ||
) |
Create a task given its class name and optionally more configuration data.
These override the base factory methods by supplying the task manager.