summaryrefslogtreecommitdiffstats
path: root/source/compiler-core/slang-artifact-impl.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2022-08-24 14:42:55 -0400
committerGitHub <noreply@github.com>2022-08-24 11:42:55 -0700
commit3746a47ce407b14c4afbfc5b625513cf81b5e890 (patch)
tree2b925a4229b7c6bd093e1720d8e0b3447b9acdcb /source/compiler-core/slang-artifact-impl.cpp
parent14d99e80c47a0daac6ef76b5d68511c828147265 (diff)
Improvements around file tracking and Artifacts (#2379)
Diffstat (limited to 'source/compiler-core/slang-artifact-impl.cpp')
-rw-r--r--source/compiler-core/slang-artifact-impl.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/source/compiler-core/slang-artifact-impl.cpp b/source/compiler-core/slang-artifact-impl.cpp
index d8646eb20..056d89a4b 100644
--- a/source/compiler-core/slang-artifact-impl.cpp
+++ b/source/compiler-core/slang-artifact-impl.cpp
@@ -26,8 +26,7 @@ static bool _checkChildren(IArtifact::FindStyle findStyle)
IArtifactHandler* Artifact::_getHandler()
{
- // TODO(JS): For now we just use the default handler, but in the future this should probably be a member
- return DefaultArtifactHandler::getSingleton();
+ return m_handler ? m_handler : DefaultArtifactHandler::getSingleton();
}
void* Artifact::castAs(const Guid& guid)
@@ -98,6 +97,16 @@ SlangResult Artifact::loadSharedLibrary(ArtifactKeep keep, ISlangSharedLibrary**
return SLANG_OK;
}
+IArtifactHandler* Artifact::getHandler()
+{
+ return m_handler;
+}
+
+void Artifact::setHandler(IArtifactHandler* handler)
+{
+ m_handler = handler;
+}
+
SlangResult Artifact::getOrCreateRepresentation(const Guid& typeGuid, ArtifactKeep keep, ICastable** outCastable)
{
auto handler = _getHandler();