9#include <Common/primitive_type.h>
10#include <Common/logging.h>
50 std::string_view funcName,
62 std::vector<const ISdlResource*>& out_resources)
const = 0;
115 template<
typename SdlResourceType>
123 std::string m_typeName;
124 std::string m_docName;
125 std::string m_description;
127 uint32 m_isBlueprint : 1;
128 uint32 m_allowCreateFromClass : 1;
135 return m_isBlueprint;
140 return m_allowCreateFromClass;
160 return m_description;
183template<
typename SdlResourceType>
186 static_assert(std::is_base_of_v<ISdlResource, SdlResourceType>,
187 "Input type must be a SDL resource.");
189 m_base = SdlResourceType::getSdlClass();
Definition ISdlInstantiable.h:12
Interface for all SDL resource.
Definition ISdlResource.h:22
SdlClass & setDescription(std::string description)
Definition SdlClass.cpp:37
SdlClass & setIsBlueprint(bool isBlueprint)
Definition SdlClass.cpp:49
std::string genPrettyName() const
Definition SdlClass.cpp:27
bool hasField() const
Definition SdlClass.h:173
bool hasFunction() const
Definition SdlClass.h:178
virtual const SdlFunction * getFunction(std::size_t index) const =0
ESdlTypeCategory getCategory() const
Definition SdlClass.h:143
virtual std::shared_ptr< ISdlResource > createResource() const =0
SdlClass(ESdlTypeCategory category, const std::string &typeName)
Definition SdlClass.cpp:11
bool allowCreateFromClass() const
Whether a resource can be created by calling createResource(). This attribute is useful to decide whe...
Definition SdlClass.h:138
virtual void call(std::string_view funcName, ISdlResource *resource, SdlInputClauses &clauses, const SdlInputContext &ctx) const =0
virtual std::size_t numFunctions() const =0
bool isDerived() const
Definition SdlClass.h:168
virtual void initResource(ISdlResource &resource, SdlInputClauses &clauses, const SdlInputContext &ctx) const =0
Initialize a resource from value clauses. How the resource will be initialized depends on the resourc...
bool isBlueprint() const
Whether the class is for building other classes only. A blueprint class cannot be instantiated as a S...
Definition SdlClass.h:133
SdlClass & setDocName(std::string docName)
Definition SdlClass.cpp:43
virtual void referencedResources(const ISdlResource *targetResource, std::vector< const ISdlResource * > &out_resources) const =0
Get all SDL resources referenced by targetResource.
std::string genCategoryName() const
Definition SdlClass.cpp:32
virtual void saveResource(const ISdlResource &resource, SdlOutputClauses &clauses, const SdlOutputContext &ctx) const =0
std::size_t numFields() const override=0
SdlClass & setAllowCreateFromClass(bool allowCreateFromClass)
Definition SdlClass.cpp:55
const SdlClass * getBase() const
Definition SdlClass.h:163
virtual void initDefaultResource(ISdlResource &resource) const =0
Initialize a resource to default values. Default values are defined by the resource class's SDL defin...
SdlClass & setBase()
Set another SDL class as the base of this class.
Definition SdlClass.h:184
std::string_view getDocName() const
Definition SdlClass.h:153
const SdlField * getField(std::size_t index) const override=0
std::string_view getDescription() const override
Definition SdlClass.h:158
std::string_view getTypeName() const override
Definition SdlClass.h:148
Definition SdlFunction.h:18
Data that SDL input process can rely on.
Definition SdlInputContext.h:19
Definition SdlOutputClauses.h:14
Data that SDL output process can rely on.
Definition SdlOutputContext.h:19
The root for all renderer implementations.
Definition EEngineProject.h:6
ESdlTypeCategory
Definition ESdlTypeCategory.h:15
PH_DEFINE_EXTERNAL_LOG_GROUP(ApiDatabase, Core)