... | ... | @@ -73,7 +73,48 @@ The base class for all resources modeled in SMTK would contain the following inf |
|
|
|
|
|
Note that all resources would be modeled as shared pointers
|
|
|
|
|
|
Also note that there is no longer a type() method to indicate what type of resource the resource is. The idea behind this decision is that dynamic casting would be used to determine if a resource is of a specific type
|
|
|
Also note that there is no longer a type() method to indicate what type of resource the resource is. The idea behind this decision is that dynamic casting would be used to determine if a resource is of a specific type.
|
|
|
|
|
|
### Current Resource Class
|
|
|
``` c++
|
|
|
namespace smtk
|
|
|
{
|
|
|
namespace common
|
|
|
{
|
|
|
|
|
|
class SMTKCORE_EXPORT Resource : smtkEnableSharedPtr(Resource)
|
|
|
{
|
|
|
friend class ResourceManager;
|
|
|
public:
|
|
|
smtkTypeMacro(Resource);
|
|
|
virtual ~Resource();
|
|
|
std::string location() const;
|
|
|
{return this->m_url;}
|
|
|
|
|
|
ResourceManager *manager() const;
|
|
|
const UUID& id() const
|
|
|
{return this->m_id;}
|
|
|
|
|
|
virtual ResourceComponentPtr find(const UUID& compId) const = 0;
|
|
|
|
|
|
|
|
|
protected:
|
|
|
Resource(const UUID &myID, ResourceManager *manager);
|
|
|
void setId(const UUID &myID)
|
|
|
{this->m_id = myID;}
|
|
|
|
|
|
void setLocation(const std::string &url)
|
|
|
{this->m_url = url;}
|
|
|
|
|
|
private:
|
|
|
UUID m_id;
|
|
|
std::string m_url;
|
|
|
ResourceManager *m_manager;
|
|
|
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
|
|
|
#### Derived Resource Classes
|
|
|
The set of resource classes would include:
|
... | ... | |