|
LLVM
4.0.0
|
MappedBlockStream represents data stored in an MSF file into chunks of a particular size (called the Block Size), and whose chunks may not be necessarily contiguous. More...
#include <MappedBlockStream.h>
Public Member Functions | |
| Error | readBytes (uint32_t Offset, uint32_t Size, ArrayRef< uint8_t > &Buffer) const override |
| Error | readLongestContiguousChunk (uint32_t Offset, ArrayRef< uint8_t > &Buffer) const override |
| uint32_t | getLength () const override |
| uint32_t | getNumBytesCopied () const |
| llvm::BumpPtrAllocator & | getAllocator () |
| void | invalidateCache () |
| uint32_t | getBlockSize () const |
| uint32_t | getNumBlocks () const |
| uint32_t | getStreamLength () const |
Public Member Functions inherited from llvm::msf::ReadableStream | |
| virtual | ~ReadableStream ()=default |
Static Public Member Functions | |
| static std::unique_ptr < MappedBlockStream > | createStream (uint32_t BlockSize, uint32_t NumBlocks, const MSFStreamLayout &Layout, const ReadableStream &MsfData) |
| static std::unique_ptr < MappedBlockStream > | createIndexedStream (const MSFLayout &Layout, const ReadableStream &MsfData, uint32_t StreamIndex) |
| static std::unique_ptr < MappedBlockStream > | createFpmStream (const MSFLayout &Layout, const ReadableStream &MsfData) |
| static std::unique_ptr < MappedBlockStream > | createDirectoryStream (const MSFLayout &Layout, const ReadableStream &MsfData) |
Protected Member Functions | |
| MappedBlockStream (uint32_t BlockSize, uint32_t NumBlocks, const MSFStreamLayout &StreamLayout, const ReadableStream &MsfData) | |
Friends | |
| class | WritableMappedBlockStream |
MappedBlockStream represents data stored in an MSF file into chunks of a particular size (called the Block Size), and whose chunks may not be necessarily contiguous.
The arrangement of these chunks MSF the file is described by some other metadata contained within the MSF file. In the case of a standard MSF Stream, the layout of the stream's blocks is described by the MSF "directory", but in the case of the directory itself, the layout is described by an array at a fixed location within the MSF. MappedBlockStream provides methods for reading from and writing to one of these streams transparently, as if it were a contiguous sequence of bytes.
Definition at line 40 of file MappedBlockStream.h.
|
protected |
Definition at line 48 of file MappedBlockStream.cpp.
|
static |
Definition at line 75 of file MappedBlockStream.cpp.
References llvm::msf::MSFStreamLayout::Blocks, llvm::msf::SuperBlock::BlockSize, createStream(), llvm::msf::MSFLayout::DirectoryBlocks, llvm::msf::MSFStreamLayout::Length, llvm::msf::SuperBlock::NumBlocks, llvm::msf::SuperBlock::NumDirectoryBytes, and llvm::msf::MSFLayout::SB.
|
static |
Definition at line 84 of file MappedBlockStream.cpp.
References llvm::msf::SuperBlock::BlockSize, createStream(), initializeFpmStreamLayout(), llvm::msf::SuperBlock::NumBlocks, and llvm::msf::MSFLayout::SB.
|
static |
Definition at line 63 of file MappedBlockStream.cpp.
References assert(), llvm::msf::MSFStreamLayout::Blocks, llvm::msf::SuperBlock::BlockSize, llvm::msf::SuperBlock::NumBlocks, llvm::msf::MSFLayout::SB, llvm::msf::MSFLayout::StreamMap, and llvm::msf::MSFLayout::StreamSizes.
|
static |
Definition at line 55 of file MappedBlockStream.cpp.
Referenced by createDirectoryStream(), and createFpmStream().
|
inline |
Definition at line 66 of file MappedBlockStream.h.
|
inline |
Definition at line 70 of file MappedBlockStream.h.
References BlockSize.
Referenced by llvm::msf::WritableMappedBlockStream::getBlockSize().
|
overridevirtual |
Implements llvm::msf::ReadableStream.
Definition at line 200 of file MappedBlockStream.cpp.
References llvm::msf::MSFStreamLayout::Length.
Referenced by llvm::msf::WritableMappedBlockStream::getLength().
|
inline |
Definition at line 71 of file MappedBlockStream.h.
Referenced by llvm::msf::WritableMappedBlockStream::getNumBlocks().
| uint32_t MappedBlockStream::getNumBytesCopied | ( | ) | const |
Definition at line 278 of file MappedBlockStream.cpp.
References llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold >::getBytesAllocated().
|
inline |
Definition at line 72 of file MappedBlockStream.h.
References llvm::msf::MSFStreamLayout::Length.
Referenced by llvm::msf::WritableMappedBlockStream::getStreamLength().
| void MappedBlockStream::invalidateCache | ( | ) |
Definition at line 282 of file MappedBlockStream.cpp.
|
overridevirtual |
Implements llvm::msf::ReadableStream.
Definition at line 91 of file MappedBlockStream.cpp.
References llvm::AbsoluteDifference(), llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold >::Allocate(), llvm::msf::insufficient_buffer, intersect(), llvm::msf::MSFStreamLayout::Length, List, llvm::ArrayRef< T >::slice(), and llvm::Error::success().
Referenced by llvm::msf::WritableMappedBlockStream::readBytes().
|
overridevirtual |
Implements llvm::msf::ReadableStream.
Definition at line 171 of file MappedBlockStream.cpp.
References llvm::msf::MSFStreamLayout::Blocks, llvm::msf::blockToOffset(), llvm::msf::insufficient_buffer, llvm::msf::MSFStreamLayout::Length, llvm::msf::ReadableStream::readBytes(), and llvm::Error::success().
Referenced by llvm::msf::WritableMappedBlockStream::readLongestContiguousChunk().
|
friend |
Definition at line 41 of file MappedBlockStream.h.
1.8.6