SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
Derived resources are subclassed from smtk::resource::Resource. More...
#include <DerivedFrom.h>
Public Types | |
typedef Parent | ParentResource |
Public Member Functions | |
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 | |
Static Public Attributes | |
static const Resource::Index | type_index |
A static index for this resource type. More... | |
Protected Member Functions | |
template<typename... T> | |
DerivedFrom (T &&... all) | |
Forward all constructor arguments to the parent class. | |
DerivedFrom (DerivedFrom &&rhs) noexcept=default | |
Derived resources are subclassed from smtk::resource::Resource.
Queries concerning the relationship between a derived resource and its parent resources are made using the methods smtk::resource::Resource::isOfType(). To ensure that these methods reflect the proper inheritance of a Resource, derived resources do not directly derive from smtk::resource::Resource; instead, they derive from smtk::resource::DerivedFrom<Self, Parent>, where Self is the class being defined and Parent is either smtk::resource::Resource or one of its derived classes.
|
static |
A static index for this resource type.
NOTE: because we are using CRTP, it is possible to make this value static and redefined for each resource type, regardless of inheritance.