SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A Manager for projects. More...
#include <Manager.h>
Public Member Functions | |
smtkTypedefs (smtk::project::Manager) | |
template<typename ProjectType , typename ResourcesTuple = std::tuple<>, typename OperationsTuple = std::tuple<>> | |
bool | registerProject (const std::string &version="0.0.0") |
Register a project identified by its class type, available resources and operations, and its version. | |
bool | registerProject (const std::string &name, const std::set< std::string > &resources={}, const std::set< std::string > &operations={}, const std::string &version="0.0.0") |
Register a project identified by a unique name, available resources and operations, and its version. More... | |
bool | registerProject (smtk::project::Metadata &&) |
Register a project identified by its metadata. | |
bool | unregisterProject (const std::string &) |
Unregister a project identified by its typename, type index or class type. | |
bool | unregisterProject (const Project::Index &) |
template<typename ProjectType > | |
bool | unregisterProject () |
template<typename OperationType > | |
bool | registerOperation () |
Register an operation identified by its class type or Metadata. | |
bool | registerOperation (smtk::operation::Metadata &&) |
template<typename Tuple > | |
bool | registerOperations () |
Register a tuple of operations identified by their class types. | |
bool | registered (const std::string &) const |
Check if a project identified by its typename, type index or class type is registered. | |
bool | registered (const Project::Index &) const |
template<typename ProjectType > | |
bool | registered () const |
bool | unregisterOperation (const std::string &) |
Unregister an operation identified by its typename, type index or class type. | |
bool | unregisterOperation (const smtk::operation::Operation::Index &) |
template<typename OperationType > | |
bool | unregisterOperation () |
template<typename Tuple > | |
bool | unregisterOperations () |
ProjectPtr | create (const std::string &, const std::shared_ptr< smtk::common::Managers > &=nullptr) |
Construct a project identified by its typename, type index or class type. | |
ProjectPtr | create (const Project::Index &, const std::shared_ptr< smtk::common::Managers > &=nullptr) |
template<typename ProjectType > | |
smtk::shared_ptr< ProjectType > | create (const std::shared_ptr< smtk::common::Managers > &=nullptr) |
ProjectPtr | create (const std::string &, const smtk::common::UUID &, const std::shared_ptr< smtk::common::Managers > &=nullptr) |
Construct a project with a given UUID identified by its typename, type index or class type. | |
ProjectPtr | create (const Project::Index &, const smtk::common::UUID &, const std::shared_ptr< smtk::common::Managers > &=nullptr) |
template<typename ProjectType > | |
smtk::shared_ptr< ProjectType > | create (const smtk::common::UUID &, const std::shared_ptr< smtk::common::Managers > &=nullptr) |
ProjectPtr | get (const smtk::common::UUID &id) |
Returns the project that relates to the given uuid. More... | |
ConstProjectPtr | get (const smtk::common::UUID &id) const |
template<typename ProjectType > | |
smtk::shared_ptr< ProjectType > | get (const smtk::common::UUID &) |
template<typename ProjectType > | |
smtk::shared_ptr< const ProjectType > | get (const smtk::common::UUID &) const |
ProjectPtr | get (const std::string &) |
Returns the project that relates to the given url. More... | |
ConstProjectPtr | get (const std::string &) const |
template<typename ProjectType > | |
smtk::shared_ptr< ProjectType > | get (const std::string &) |
template<typename ProjectType > | |
smtk::shared_ptr< const ProjectType > | get (const std::string &) const |
std::set< ProjectPtr > | find (const std::string &) |
Returns a set of projects that have a given typename, type index or class type. | |
std::set< ProjectPtr > | find (const Project::Index &) |
template<typename ProjectType > | |
std::set< smtk::shared_ptr< ProjectType > > | find () |
bool | add (const Project::Index &, const ProjectPtr &) |
Add a project identified by its type index. More... | |
template<typename ProjectType > | |
bool | add (const smtk::shared_ptr< ProjectType > &) |
Add a project identified by its class type. More... | |
bool | add (const ProjectPtr &) |
Returns true if the project was added or already is part of this manager. | |
bool | remove (const ProjectPtr &) |
Removes a project from a given Manager. More... | |
Container & | projects () |
Return the set of projects. | |
const Container & | projects () const |
std::set< smtk::project::ProjectPtr > | projectsSet () const |
MetadataContainer & | metadata () |
Return the map of metadata. | |
Observers & | observers () |
Return the observers associated with this manager. | |
const Observers & | observers () const |
Metadata::Observers & | metadataObservers () |
Return the metadata observers associated with this manager. | |
const Metadata::Observers & | metadataObservers () const |
smtk::resource::ManagerPtr | resourceManager () |
smtk::operation::ManagerPtr | operationManager () |
template<typename ProjectType > | |
std::shared_ptr< ProjectType > | get (const smtk::common::UUID &id) |
template<typename ProjectType > | |
std::shared_ptr< const ProjectType > | get (const smtk::common::UUID &id) const |
template<typename ProjectType > | |
std::shared_ptr< ProjectType > | get (const std::string &url) |
template<typename ProjectType > | |
std::shared_ptr< const ProjectType > | get (const std::string &url) const |
template<typename ProjectType > | |
std::set< std::shared_ptr< ProjectType > > | find () |
Static Public Member Functions | |
static std::shared_ptr< Manager > | create (const smtk::resource::ManagerPtr &resourceManager, const smtk::operation::ManagerPtr &operationManager) |
A Manager for projects.
Like other managers in SMTK, the Project Manager has functionality for registering Project types and for creating and accessing Projects.
bool smtk::project::Manager::add | ( | const Project::Index & | , |
const ProjectPtr & | |||
) |
Add a project identified by its type index.
Returns true if the project was added or already is part of this manager. If the project is currently part of a different manager, we will reparent it to this manager.
bool smtk::project::Manager::add | ( | const smtk::shared_ptr< ProjectType > & | project | ) |
Add a project identified by its class type.
Returns true if the project was added or already is part of this manager.
smtk::project::ProjectPtr smtk::project::Manager::get | ( | const smtk::common::UUID & | id | ) |
Returns the project that relates to the given uuid.
If no association exists this will return a null pointer
smtk::project::ProjectPtr smtk::project::Manager::get | ( | const std::string & | url | ) |
Returns the project that relates to the given url.
If no association exists this will return a null pointer
bool smtk::project::Manager::registerProject | ( | const std::string & | name, |
const std::set< std::string > & | resources = {} , |
||
const std::set< std::string > & | operations = {} , |
||
const std::string & | version = "0.0.0" |
||
) |
Register a project identified by a unique name, available resources and operations, and its version.
. The resulting project will simply be an instance of smtk::project::Project.
bool smtk::project::Manager::remove | ( | const ProjectPtr & | project | ) |
Removes a project from a given Manager.
This doesn't explicitly release the memory of the project, it only stops the tracking of the project by the manager.