Skip to content

Commit

Permalink
ProxyDataBlob: added option to keep data container alive
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Oct 31, 2024
1 parent 4eae867 commit 2a995cb
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions Common/interface/ProxyDataBlob.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,26 @@ class ProxyDataBlob : public ObjectBase<IDataBlob>
public:
typedef ObjectBase<IDataBlob> TBase;

ProxyDataBlob(IReferenceCounters* pRefCounters, void* pData, size_t Size) :
ProxyDataBlob(IReferenceCounters* pRefCounters,
void* pData,
size_t Size,
IObject* pDataContainer = nullptr) :
TBase{pRefCounters},
m_pData{pData},
m_pConstData{pData},
m_Size{Size}
m_Size{Size},
m_pDataContainer{pDataContainer}
{}

ProxyDataBlob(IReferenceCounters* pRefCounters, const void* pData, size_t Size) :
ProxyDataBlob(IReferenceCounters* pRefCounters,
const void* pData,
size_t Size,
IObject* pDataContainer = nullptr) :
TBase{pRefCounters},
m_pData{nullptr},
m_pConstData{pData},
m_Size{Size}
m_Size{Size},
m_pDataContainer{pDataContainer}
{}

template <typename... ArgsType>
Expand Down Expand Up @@ -92,9 +100,10 @@ class ProxyDataBlob : public ObjectBase<IDataBlob>
}

private:
void* const m_pData;
const void* const m_pConstData;
const size_t m_Size;
void* const m_pData;
const void* const m_pConstData;
const size_t m_Size;
RefCntAutoPtr<IObject> m_pDataContainer;
};

} // namespace Diligent

0 comments on commit 2a995cb

Please sign in to comment.