|
LLVM
4.0.0
|
VarStreamArray represents an array of variable length records backed by a stream. More...
#include <StreamArray.h>
Public Member Functions | |
| VarStreamArrayIterator (const ArrayType &Array, const Extractor &E, bool *HadError=nullptr) | |
| VarStreamArrayIterator ()=default | |
| VarStreamArrayIterator (const Extractor &E) | |
| ~VarStreamArrayIterator ()=default | |
| bool | operator== (const IterType &R) const |
| const ValueType & | operator* () const |
| IterType & | operator++ () |
Public Member Functions inherited from llvm::iterator_facade_base< VarStreamArrayIterator< ValueType, Extractor >, std::forward_iterator_tag, ValueType > | |
| VarStreamArrayIterator < ValueType, Extractor > | operator+ (std::ptrdiff_tn) const |
| VarStreamArrayIterator < ValueType, Extractor > | operator- (std::ptrdiff_tn) const |
| VarStreamArrayIterator < ValueType, Extractor > & | operator++ () |
| VarStreamArrayIterator < ValueType, Extractor > | operator++ (int) |
| VarStreamArrayIterator < ValueType, Extractor > & | operator-- () |
| VarStreamArrayIterator < ValueType, Extractor > | operator-- (int) |
| bool | operator!= (const VarStreamArrayIterator< ValueType, Extractor > &RHS) const |
| bool | operator> (const VarStreamArrayIterator< ValueType, Extractor > &RHS) const |
| bool | operator<= (const VarStreamArrayIterator< ValueType, Extractor > &RHS) const |
| bool | operator>= (const VarStreamArrayIterator< ValueType, Extractor > &RHS) const |
| ValueType * | operator-> () const |
| ReferenceProxy | operator[] (std::ptrdiff_tn) const |
Additional Inherited Members | |
Protected Types inherited from llvm::iterator_facade_base< VarStreamArrayIterator< ValueType, Extractor >, std::forward_iterator_tag, ValueType > | |
| enum | |
VarStreamArray represents an array of variable length records backed by a stream.
This could be a contiguous sequence of bytes in memory, it could be a file on disk, or it could be a PDB stream where bytes are stored as discontiguous blocks in a file. Usually it is desirable to treat arrays as contiguous blocks of memory, but doing so with large PDB files, for example, could mean allocating huge amounts of memory just to allow re-ordering of stream data to be contiguous before iterating over it. By abstracting this out, we need not duplicate this memory, and we can iterate over arrays in arbitrarily formatted streams. Elements are parsed lazily on iteration, so there is no upfront cost associated with building a VarStreamArray, no matter how large it may be.
You create a VarStreamArray by specifying a ValueType and an Extractor type. If you do not specify an Extractor type, it expects you to specialize VarStreamArrayExtractor<T> for your ValueType.
By default an Extractor is default constructed in the class, but in some cases you might find it useful for an Extractor to maintain state across extractions. In this case you can provide your own Extractor through a secondary constructor. The following examples show various ways of creating a VarStreamArray.
// Will use VarStreamArrayExtractor<MyType> as the extractor. VarStreamArray<MyType> MyTypeArray; // Will use a default-constructed MyExtractor as the extractor. VarStreamArray<MyType, MyExtractor> MyTypeArray2; // Will use the specific instance of MyExtractor provided. // MyExtractor need not be default-constructible in this case. MyExtractor E(SomeContext); VarStreamArray<MyType, MyExtractor> MyTypeArray3(E);
Definition at line 75 of file StreamArray.h.
|
inline |
Definition at line 119 of file StreamArray.h.
References llvm::consumeError(), and llvm::msf::StreamRefBase< StreamType, RefType >::getLength().
|
default |
|
inlineexplicit |
Definition at line 133 of file StreamArray.h.
|
default |
|
inline |
Definition at line 151 of file StreamArray.h.
References assert().
|
inline |
Definition at line 156 of file StreamArray.h.
References llvm::consumeError(), llvm::msf::StreamRefBase< StreamType, RefType >::drop_front(), and llvm::msf::StreamRefBase< StreamType, RefType >::getLength().
|
inline |
Definition at line 136 of file StreamArray.h.
References assert().
1.8.6