SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
11 #ifndef smtk_project_Project_h
12 #define smtk_project_Project_h
14 #include "smtk/CoreExports.h"
17 #include "smtk/resource/DerivedFrom.h"
19 #include "smtk/task/Manager.h"
21 #include "smtk/project/OperationFactory.h"
22 #include "smtk/project/ResourceContainer.h"
24 #include <boost/type_index.hpp>
35 template<
typename Self,
typename Parent>
52 static constexpr
const char*
const type_name =
"smtk::project::Project";
53 std::string
typeName()
const override {
return (m_typeName.empty() ? type_name : m_typeName); }
55 static std::shared_ptr<smtk::project::Project> create(
const std::string&
typeName =
"")
68 m_typeName.empty() ? std::type_index(
typeid(*
this)).hash_code()
69 : std::hash<std::string>{}(m_typeName));
81 const std::string&
version()
const {
return m_version; }
82 void setVersion(
const std::string& version) { m_version = version; }
86 const std::string&)
const override
91 void visit(smtk::resource::Component::Visitor&)
const override {}
104 bool clean()
const override;
107 Project(
const std::string&
typeName =
"");
110 ResourceContainer m_resources;
111 OperationFactory m_operations;
112 std::string m_typeName;
113 std::string m_version;
115 std::shared_ptr<smtk::task::Manager> m_taskManager;
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
Derived resources are subclassed from smtk::resource::Resource.
Definition: DerivedFrom.h:32
std::function< bool(const smtk::resource::Component &)> queryOperation(const std::string &) const override
given a std::string describing a query, return a functor for performing the query (accepts component ...
Definition: Project.h:85
A Project represents an encapsulation of a subset of SMTK's Resources and Operations for the purpose ...
Definition: Project.h:43
#define smtkTypedefs(...)
Used by smtkTypeMacro()
Definition: SharedFromThis.h:21
A task manager is responsible for creating new tasks.
Definition: Manager.h:46
const ResourceContainer & resources() const
Access the Project's Resources.
Definition: Project.h:73
A Manager for projects.
Definition: Manager.h:40
const OperationFactory & operations() const
Access the Project's Operations.
Definition: Project.h:77
#define smtkSharedFromThisMacro(...)
A macro to help with derived classes whose bases enable shared_from_this().
Definition: SharedFromThis.h:190
smtk::resource::ComponentPtr find(const smtk::common::UUID &) const override
Given a resource component's UUID, return the resource component.
Definition: Project.h:93
An OperationFactory is a factory for a Project's Operations.
Definition: OperationFactory.h:28
smtk::common::Singleton< detail::Manager > Manager
The Manager is a singleton interface for registering available plugins to manager instances.
Definition: Manager.h:92
std::string typeName()
Return the name of a class.
Definition: TypeName.h:286
const std::string & version() const
Access the Project's version string.
Definition: Project.h:81
std::size_t Index
A hash value uniquely representing the project type.
Definition: Project.h:61
const smtk::task::Manager & taskManager() const
Return this project's task manager.
Definition: Project.h:101
Component is the base class for records stored in an smtk::resource::Resource.
Definition: Component.h:43
Index index() const override
index is a compile-time intrinsic of the derived resource; as such, it cannot be set.
Definition: Project.h:65
A ResourceContainer is a container for a Project's Resources.
Definition: ResourceContainer.h:37
An abstract base class for SMTK resources and their components.
Definition: PersistentObject.h:39
smtk::shared_ptr< smtk::resource::Component > ComponentPtr
Definition: PublicPointerDefs.h:297