diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2023-04-19 17:06:56 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-19 17:06:56 -0400 |
| commit | 588991f6df3d6813378721166a7260990835817e (patch) | |
| tree | fca8c57fedb1967af20ca2da50bbd7dc8afc6a07 /source/core/slang-castable.cpp | |
| parent | 520a3c064c42e8cd50ef4fde21539870d5b19cb7 (diff) | |
Make SourceMap a value type (#2812)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Moved JSON source map writing logic to JSONSourceMapUtil.
* Use ArtifactHandler to read/write SourceMaps.
Use ObjectCastableAdapter to hold SourceMap
Only serialize SourceMap <-> JSON on demand.
* Make some types swappable.
* BoxValue impl.
* Added asBoxValue.
* Remove const get funcs.
* Fix typo in asBoxValue.
* Fix another typo in asBoxValue.
* Slightly simplify conversion to blob of SourceMap.
* Small fix for asBoxValue
Diffstat (limited to 'source/core/slang-castable.cpp')
| -rw-r--r-- | source/core/slang-castable.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/source/core/slang-castable.cpp b/source/core/slang-castable.cpp index 6b7644bf2..f3c6541dd 100644 --- a/source/core/slang-castable.cpp +++ b/source/core/slang-castable.cpp @@ -20,37 +20,6 @@ namespace Slang { return castable; } -/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ObjectCastableAdapter !!!!!!!!!!!!!!!!!!!!!!!!!!! */ - -void* ObjectCastableAdapter::castAs(const Guid& guid) -{ - if (auto intf = getInterface(guid)) - { - return intf; - } - return getObject(guid); -} - -void* ObjectCastableAdapter::getInterface(const Guid& guid) -{ - if (guid == ISlangUnknown::getTypeGuid() || - guid == ICastable::getTypeGuid() || - guid == IObjectCastableAdapter::getTypeGuid()) - { - return static_cast<IObjectCastableAdapter*>(this); - } - return nullptr; -} - -void* ObjectCastableAdapter::getObject(const Guid& guid) -{ - if (guid == m_containedGuid) - { - return m_contained; - } - return nullptr; -} - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! UnknownCastableAdapter !!!!!!!!!!!!!!!!!!!!!!!!!!! */ void* UnknownCastableAdapter::castAs(const Guid& guid) |
