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/project/OperationFactory.h"
20 #include "smtk/project/ResourceContainer.h"
22 #include <boost/type_index.hpp>
31 template<
typename Self,
typename Parent>
48 static constexpr
const char*
const type_name =
"smtk::project::Project";
49 std::string
typeName()
const override {
return (m_typeName.empty() ? type_name : m_typeName); }
51 static std::shared_ptr<smtk::project::Project> create(
const std::string&
typeName =
"")
64 m_typeName.empty() ? std::type_index(
typeid(*
this)).hash_code()
65 : std::hash<std::string>{}(m_typeName));
77 const std::string&
version()
const {
return m_version; }
78 void setVersion(
const std::string& version) { m_version = version; }
82 const std::string&)
const override
87 void visit(smtk::resource::Component::Visitor&)
const override {}
96 bool clean()
const override;
99 Project(
const std::string&
typeName =
"");
102 ResourceContainer m_resources;
103 OperationFactory m_operations;
104 std::string m_typeName;
105 std::string m_version;
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:81
A Project represents an encapsulation of a subset of SMTK's Resources and Operations for the purpose ...
Definition: Project.h:39
#define smtkTypedefs(...)
Used by smtkTypeMacro()
Definition: SharedFromThis.h:21
const ResourceContainer & resources() const
Access the Project's Resources.
Definition: Project.h:69
A Manager for projects.
Definition: Manager.h:40
const OperationFactory & operations() const
Access the Project's Operations.
Definition: Project.h:73
#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:89
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:77
std::size_t Index
A hash value uniquely representing the project type.
Definition: Project.h:57
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:61
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