[+] AuMemory::SharableByteBuffer
This commit is contained in:
parent
42af66c841
commit
2731183a1a
@ -635,4 +635,50 @@ namespace Aurora::Memory
|
||||
this->memory = pRAIIParentOwner;
|
||||
}
|
||||
};
|
||||
|
||||
struct SharableByteBuffer : ByteBuffer,
|
||||
AuEnableSharedFromThis<SharableByteBuffer>
|
||||
{
|
||||
SharableByteBuffer() : ByteBuffer()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
SharableByteBuffer(AuUInt uLength, bool circular = false, bool expandable = false) : ByteBuffer(uLength, circular, expandable)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
SharableByteBuffer(AuUInt uLength, AuUInt uAlignment, bool circular = false, bool expandable = false) : ByteBuffer(uLength, uAlignment, circular, expandable)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
MemoryViewRead readView;
|
||||
MemoryViewWrite writeView;
|
||||
|
||||
public:
|
||||
inline AuSPtr<MemoryViewWrite> ToSharedWriteView()
|
||||
{
|
||||
this->writeView = *this;
|
||||
return { this->SharedFromThis(), &this->writeView };
|
||||
}
|
||||
|
||||
inline AuSPtr<MemoryViewRead> ToSharedReadView()
|
||||
{
|
||||
this->readView = *this;
|
||||
return { this->SharedFromThis(), &this->readView };
|
||||
}
|
||||
|
||||
inline operator AuSPtr<MemoryViewWrite>()
|
||||
{
|
||||
return this->ToSharedWriteView();
|
||||
}
|
||||
|
||||
inline operator AuSPtr<MemoryViewRead>()
|
||||
{
|
||||
return this->ToSharedReadView();
|
||||
}
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user