LLVM  8.0.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::BinaryStreamRefBase< RefType, StreamType > Class Template Reference

Common stuff for mutable and immutable StreamRefs. More...

#include "llvm/Support/BinaryStreamRef.h"

Inheritance diagram for llvm::BinaryStreamRefBase< RefType, StreamType >:
Inheritance graph
[legend]
Collaboration diagram for llvm::BinaryStreamRefBase< RefType, StreamType >:
Collaboration graph
[legend]

Public Member Functions

llvm::support::endianness getEndian () const
 
uint32_t getLength () const
 
RefType drop_front (uint32_t N) const
 Return a new BinaryStreamRef with the first N elements removed. More...
 
RefType drop_back (uint32_t N) const
 Return a new BinaryStreamRef with the last N elements removed. More...
 
RefType keep_front (uint32_t N) const
 Return a new BinaryStreamRef with only the first N elements remaining. More...
 
RefType keep_back (uint32_t N) const
 Return a new BinaryStreamRef with only the last N elements remaining. More...
 
RefType drop_symmetric (uint32_t N) const
 Return a new BinaryStreamRef with the first and last N elements removed. More...
 
RefType slice (uint32_t Offset, uint32_t Len) const
 Return a new BinaryStreamRef with the first Offset elements removed, and retaining exactly Len elements. More...
 
bool valid () const
 
bool operator== (const RefType &Other) const
 

Protected Member Functions

 BinaryStreamRefBase ()=default
 
 BinaryStreamRefBase (StreamType &BorrowedImpl)
 
 BinaryStreamRefBase (std::shared_ptr< StreamType > SharedImpl, uint32_t Offset, Optional< uint32_t > Length)
 
 BinaryStreamRefBase (StreamType &BorrowedImpl, uint32_t Offset, Optional< uint32_t > Length)
 
 BinaryStreamRefBase (const BinaryStreamRefBase &Other)=default
 
BinaryStreamRefBaseoperator= (const BinaryStreamRefBase &Other)=default
 
BinaryStreamRefBaseoperator= (BinaryStreamRefBase &&Other)=default
 
 BinaryStreamRefBase (BinaryStreamRefBase &&Other)=default
 
Error checkOffsetForRead (uint32_t Offset, uint32_t DataSize) const
 

Protected Attributes

std::shared_ptr< StreamType > SharedImpl
 
StreamType * BorrowedImpl = nullptr
 
uint32_t ViewOffset = 0
 
Optional< uint32_tLength
 

Detailed Description

template<class RefType, class StreamType>
class llvm::BinaryStreamRefBase< RefType, StreamType >

Common stuff for mutable and immutable StreamRefs.

Definition at line 25 of file BinaryStreamRef.h.

Constructor & Destructor Documentation

◆ BinaryStreamRefBase() [1/6]

template<class RefType, class StreamType>
llvm::BinaryStreamRefBase< RefType, StreamType >::BinaryStreamRefBase ( )
protecteddefault

◆ BinaryStreamRefBase() [2/6]

template<class RefType, class StreamType>
llvm::BinaryStreamRefBase< RefType, StreamType >::BinaryStreamRefBase ( StreamType &  BorrowedImpl)
inlineexplicitprotected

Definition at line 28 of file BinaryStreamRef.h.

◆ BinaryStreamRefBase() [3/6]

template<class RefType, class StreamType>
llvm::BinaryStreamRefBase< RefType, StreamType >::BinaryStreamRefBase ( std::shared_ptr< StreamType >  SharedImpl,
uint32_t  Offset,
Optional< uint32_t Length 
)
inlineprotected

Definition at line 34 of file BinaryStreamRef.h.

◆ BinaryStreamRefBase() [4/6]

template<class RefType, class StreamType>
llvm::BinaryStreamRefBase< RefType, StreamType >::BinaryStreamRefBase ( StreamType &  BorrowedImpl,
uint32_t  Offset,
Optional< uint32_t Length 
)
inlineprotected

Definition at line 38 of file BinaryStreamRef.h.

◆ BinaryStreamRefBase() [5/6]

template<class RefType, class StreamType>
llvm::BinaryStreamRefBase< RefType, StreamType >::BinaryStreamRefBase ( const BinaryStreamRefBase< RefType, StreamType > &  Other)
protecteddefault

◆ BinaryStreamRefBase() [6/6]

template<class RefType, class StreamType>
llvm::BinaryStreamRefBase< RefType, StreamType >::BinaryStreamRefBase ( BinaryStreamRefBase< RefType, StreamType > &&  Other)
protecteddefault

Member Function Documentation

◆ checkOffsetForRead()

template<class RefType, class StreamType>
Error llvm::BinaryStreamRefBase< RefType, StreamType >::checkOffsetForRead ( uint32_t  Offset,
uint32_t  DataSize 
) const
inlineprotected

Definition at line 136 of file BinaryStreamRef.h.

◆ drop_back()

template<class RefType, class StreamType>
RefType llvm::BinaryStreamRefBase< RefType, StreamType >::drop_back ( uint32_t  N) const
inline

Return a new BinaryStreamRef with the last N elements removed.

If this BinaryStreamRef is length-tracking and N is greater than 0, then this BinaryStreamRef will no longer length-track.

Definition at line 80 of file BinaryStreamRef.h.

Referenced by llvm::BinaryStreamRefBase< WritableBinaryStreamRef, WritableBinaryStream >::keep_front().

◆ drop_front()

template<class RefType, class StreamType>
RefType llvm::BinaryStreamRefBase< RefType, StreamType >::drop_front ( uint32_t  N) const
inline

◆ drop_symmetric()

template<class RefType, class StreamType>
RefType llvm::BinaryStreamRefBase< RefType, StreamType >::drop_symmetric ( uint32_t  N) const
inline

Return a new BinaryStreamRef with the first and last N elements removed.

Definition at line 113 of file BinaryStreamRef.h.

◆ getEndian()

template<class RefType, class StreamType>
llvm::support::endianness llvm::BinaryStreamRefBase< RefType, StreamType >::getEndian ( ) const
inline

Definition at line 48 of file BinaryStreamRef.h.

◆ getLength()

template<class RefType, class StreamType>
uint32_t llvm::BinaryStreamRefBase< RefType, StreamType >::getLength ( ) const
inline

◆ keep_back()

template<class RefType, class StreamType>
RefType llvm::BinaryStreamRefBase< RefType, StreamType >::keep_back ( uint32_t  N) const
inline

Return a new BinaryStreamRef with only the last N elements remaining.

Definition at line 106 of file BinaryStreamRef.h.

◆ keep_front()

template<class RefType, class StreamType>
RefType llvm::BinaryStreamRefBase< RefType, StreamType >::keep_front ( uint32_t  N) const
inline

◆ operator=() [1/2]

template<class RefType, class StreamType>
BinaryStreamRefBase& llvm::BinaryStreamRefBase< RefType, StreamType >::operator= ( const BinaryStreamRefBase< RefType, StreamType > &  Other)
protecteddefault

◆ operator=() [2/2]

template<class RefType, class StreamType>
BinaryStreamRefBase& llvm::BinaryStreamRefBase< RefType, StreamType >::operator= ( BinaryStreamRefBase< RefType, StreamType > &&  Other)
protecteddefault

◆ operator==()

template<class RefType, class StreamType>
bool llvm::BinaryStreamRefBase< RefType, StreamType >::operator== ( const RefType &  Other) const
inline

Definition at line 125 of file BinaryStreamRef.h.

◆ slice()

template<class RefType, class StreamType>
RefType llvm::BinaryStreamRefBase< RefType, StreamType >::slice ( uint32_t  Offset,
uint32_t  Len 
) const
inline

◆ valid()

template<class RefType, class StreamType>
bool llvm::BinaryStreamRefBase< RefType, StreamType >::valid ( ) const
inline

Member Data Documentation

◆ BorrowedImpl

template<class RefType, class StreamType>
StreamType* llvm::BinaryStreamRefBase< RefType, StreamType >::BorrowedImpl = nullptr
protected

◆ Length

template<class RefType, class StreamType>
Optional<uint32_t> llvm::BinaryStreamRefBase< RefType, StreamType >::Length
protected

◆ SharedImpl

template<class RefType, class StreamType>
std::shared_ptr<StreamType> llvm::BinaryStreamRefBase< RefType, StreamType >::SharedImpl
protected

Definition at line 144 of file BinaryStreamRef.h.

◆ ViewOffset

template<class RefType, class StreamType>
uint32_t llvm::BinaryStreamRefBase< RefType, StreamType >::ViewOffset = 0
protected

The documentation for this class was generated from the following file: