SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A Project represents an encapsulation of a subset of SMTK's Resources and Operations for the purpose of accomplishing a targeted set of tasks. More...
#include <Project.h>
Public Types | |
typedef std::size_t | Index |
A hash value uniquely representing the project type. | |
![]() | |
typedef smtk::resource::Resource | ParentResource |
![]() | |
typedef std::size_t | Index |
typedef smtk::resource::Metadata | Metadata |
typedef detail::ResourceLinks | Links |
typedef detail::ResourceProperties | Properties |
typedef query::Queries | Queries |
Public Member Functions | |
smtkTypedefs (smtk::project::Project) | |
smtkSharedFromThisMacro (smtk::resource::PersistentObject) | |
std::string | typeName () const override |
Index | index () const override |
index is a compile-time intrinsic of the derived resource; as such, it cannot be set. | |
const ResourceContainer & | resources () const |
Access the Project's Resources. | |
ResourceContainer & | resources () |
const OperationFactory & | operations () const |
Access the Project's Operations. | |
OperationFactory & | operations () |
const std::string & | version () const |
Access the Project's version string. | |
void | setVersion (const std::string &version) |
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 as input, returns true if the component satisfies the query parameters). | |
void | visit (smtk::resource::Component::Visitor &) const override |
smtk::resource::ComponentPtr | find (const smtk::common::UUID &) const override |
Given a resource component's UUID, return the resource component. | |
const smtk::project::Manager * | manager () const |
const smtk::task::Manager & | taskManager () const |
Return this project's task manager. | |
smtk::task::Manager & | taskManager () |
bool | clean () const override |
Indicate whether the resource is in sync with its location. More... | |
![]() | |
bool | isOfType (const Resource::Index &index) const override |
given a resource index, return whether or not this resource is or is derived from the resource described by the index. | |
bool | isOfType (const std::string &typeName) const override |
given a resource's unique name, return whether or not this resource is or is derived from the resource described by the name. | |
int | numberOfGenerationsFromBase (const std::string &typeName) const override |
DerivedFrom (const DerivedFrom &)=delete | |
![]() | |
smtkTypeMacro (smtk::resource::Resource) | |
smtkSuperclassMacro (smtk::resource::PersistentObject) | |
smtkSharedFromThisMacro (smtk::resource::PersistentObject) | |
template<class ResourceType > | |
bool | isOfType () const |
given a resource type, return whether or not this resource is or is derived from the resource described by the index. | |
const smtk::common::UUID & | id () const override |
id and location are run-time intrinsics of the derived resource; we need to allow the user to reset these values. | |
const std::string & | location () const |
bool | setId (const smtk::common::UUID &myID) override |
Assign an ID to this object (used by readers; not for arbitrary reuse). More... | |
bool | setLocation (const std::string &location) |
std::string | name () const override |
Return the user-assigned name of the resource. More... | |
bool | setName (const std::string &name) |
bool | isNameSet () |
void | setClean (bool state=true) |
void | setMarkedForRemoval (bool val) |
Mark the resource to indicate it is about to removed (meaning it is being removed from memory not necessarily for deletion) | |
virtual bool | isMarkedForRemoval () const |
Return whether the object is marked for removal. | |
ManagerPtr | manager () const |
Resources that are managed have a non-null pointer to their manager. | |
virtual Component * | component (const smtk::common::UUID &compId) const |
Given a component's UUID, return a raw pointer to the component. | |
template<typename ComponentType > | |
ComponentType * | componentAs (const smtk::common::UUID &uuid) const |
A templated version of component() that casts its result to a type. More... | |
virtual void | visit (std::function< void(const ComponentPtr &)> &v) const =0 |
visit all components in a resource. | |
ComponentSet | filter (const std::string &queryString) const |
template<typename Collection > | |
Collection | filterAs (const std::string &queryString) const |
given a a std::string describing a query and a type of container, return a set of components that satisfy both. More... | |
Links & | links () override |
const Links & | links () const override |
Properties & | properties () override |
const Properties & | properties () const override |
const Queries & | queries () const |
Queries & | queries () |
Lock & | lock (Key()) const |
classes that are granted permission to the key may retrieve the resource's lock. | |
LockType | locked () const |
Anyone can query whether or not the resource is locked. | |
Resource (Resource &&) noexcept | |
![]() | |
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. | |
Static Public Member Functions | |
static std::shared_ptr< smtk::project::Project > | create (const std::string &typeName="") |
Static Public Attributes | |
static constexpr const char *const | type_name = "smtk::project::Project" |
![]() | |
static const Resource::Index | type_index |
A static index for this resource type. More... | |
![]() | |
static const Resource::Index | type_index = std::type_index(typeid(Resource)).hash_code() |
Protected Member Functions | |
Project (const std::string &typeName="") | |
![]() | |
DerivedFrom (T &&... all) | |
Forward all constructor arguments to the parent class. | |
DerivedFrom (DerivedFrom &&rhs) noexcept=default | |
![]() | |
Resource (const smtk::common::UUID &, ManagerPtr manager=nullptr) | |
Resource (ManagerPtr manager=nullptr) | |
Friends | |
class | Manager |
The Manager is a singleton interface for registering available plugins to manager instances. More... | |
Additional Inherited Members | |
![]() | |
WeakManagerPtr | m_manager |
A Project represents an encapsulation of a subset of SMTK's Resources and Operations for the purpose of accomplishing a targeted set of tasks.
It contains Resources and a list of Operations that are pertinent to the Project. As a descendent of Resource, it also contains links, properties, and Query functionality.
|
overridevirtual |
Indicate whether the resource is in sync with its location.
Resources that have a non-empty location and are identical to the data stored at location are clean. All other resources are dirty.
Operations that are write-operators (i.e., not read-only) should mark resources as modified. Saving a resource using its metadata's write method will mark the resource as clean. Loading a resource using its metadata's read method should return a clean resource.
Reimplemented from smtk::resource::Resource.
|
friend |
The Manager is a singleton interface for registering available plugins to manager instances.
When a plugin is loaded, it creates a Client that adds itself to Manager's set of Client weak_ptrs. When a manager instance is passed into the Manager's "registerPluginsTo" method, each Client in the set that accepts a manager of this type constructs a Registry that tethers the scope of the manager's ability to use features from the plugin to the lifetime of the Registry object. Additionally, when a manager is passed into this class a register function is created that facilitates the registration of future plugins to the manager.