LLDB mainline
|
A pure virtual protocol class for abstracted read only data buffers. More...
#include "lldb/Core/DataBuffer.h"
Public Member Functions | |
virtual | ~DataBuffer ()=default |
virtual lldb::offset_t | GetByteSize () const =0 |
Get the number of bytes in the data buffer. | |
const uint8_t * | GetBytes () const |
Get a const pointer to the data. | |
llvm::ArrayRef< uint8_t > | GetData () const |
virtual bool | isA (const void *ClassID) const |
Static Public Member Functions | |
static bool | classof (const DataBuffer *data_buffer) |
Static Public Attributes | |
static char | ID |
LLVM RTTI support. | |
Protected Member Functions | |
virtual const uint8_t * | GetBytesImpl () const =0 |
} | |
A pure virtual protocol class for abstracted read only data buffers.
A pure virtual protocol class for abstracted writable data buffers.
DataBuffer is an abstract class that gets packaged into a shared pointer that can use to implement various ways to store data (on the heap, memory mapped, cached inferior memory). It gets used by DataExtractor so many DataExtractor objects can share the same data and sub-ranges of that shared data, and the last object that contains a reference to the shared data will free it.
Subclasses can implement as many different constructors or member functions that allow data to be stored in the object's buffer prior to handing the shared data to clients that use these buffers.
All subclasses must override all of the pure virtual functions as they are used by clients to access the data. Having a common interface allows different ways of storing data, yet using it in one common way.
This class currently expects all data to be available without any extra calls being made, but we can modify it to optionally get data on demand with some extra function calls to load the data before it gets accessed.
DataBuffer is an abstract class that gets packaged into a shared pointer that can use to implement various ways to store data (on the heap, memory mapped, cached inferior memory). It gets used by DataExtractor so many DataExtractor objects can share the same data and sub-ranges of that shared data, and the last object that contains a reference to the shared data will free it.
Definition at line 42 of file DataBuffer.h.
|
virtualdefault |
|
inlinestatic |
Definition at line 67 of file DataBuffer.h.
|
inline |
Get a const pointer to the data.
Definition at line 57 of file DataBuffer.h.
References GetBytesImpl().
Referenced by lldb_private::DataBufferHeap::DataBufferHeap(), GetData(), and lldb_private::DataExtractor::GetSharedDataOffset().
|
protectedpure virtual |
}
Get a const pointer to the data.
Implemented in lldb_private::DataBufferUnowned, lldb_private::DataBufferHeap, lldb_private::DataBufferLLVM, and lldb_private::WritableDataBufferLLVM.
Referenced by lldb_private::WritableDataBuffer::GetBytes(), and GetBytes().
|
pure virtual |
Get the number of bytes in the data buffer.
Implemented in lldb_private::DataBufferUnowned, lldb_private::DataBufferHeap, lldb_private::DataBufferLLVM, and lldb_private::WritableDataBufferLLVM.
Referenced by lldb_private::DataBufferHeap::DataBufferHeap(), lldb_private::WritableDataBuffer::GetData(), and GetData().
|
inline |
Definition at line 59 of file DataBuffer.h.
References GetBytes(), and GetByteSize().
|
inlinevirtual |
Reimplemented in lldb_private::WritableDataBuffer, lldb_private::DataBufferUnowned, lldb_private::DataBufferHeap, lldb_private::DataBufferLLVM, and lldb_private::WritableDataBufferLLVM.
Definition at line 66 of file DataBuffer.h.
References ID.
Referenced by classof(), lldb_private::WritableDataBuffer::classof(), lldb_private::DataBufferUnowned::classof(), lldb_private::DataBufferHeap::classof(), lldb_private::DataBufferLLVM::classof(), lldb_private::WritableDataBufferLLVM::classof(), lldb_private::WritableDataBuffer::isA(), and lldb_private::DataBufferLLVM::isA().
|
static |