LLVM 22.0.0git
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | 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 >:
[フレーム]
[legend]

Public Member Functions

RefType  drop_front (uint64_t N) const
  Return a new BinaryStreamRef with the first N elements removed.
RefType  drop_back (uint64_t N) const
  Return a new BinaryStreamRef with the last N elements removed.
RefType  keep_front (uint64_t N) const
  Return a new BinaryStreamRef with only the first N elements remaining.
RefType  keep_back (uint64_t N) const
  Return a new BinaryStreamRef with only the last N elements remaining.
  Return a new BinaryStreamRef with the first and last N elements removed.
RefType  slice (uint64_t Offset, uint64_t Len) const
  Return a new BinaryStreamRef with the first Offset elements removed, and retaining exactly Len elements.

Protected Member Functions

  BinaryStreamRefBase ()=default
  BinaryStreamRefBase (std::shared_ptr< StreamType > SharedImpl, uint64_t Offset, std::optional< uint64_t > Length)
  BinaryStreamRefBase (StreamType &BorrowedImpl, uint64_t Offset, std::optional< uint64_t > Length)

Protected Attributes

std::shared_ptr< StreamType >  SharedImpl
StreamType *  BorrowedImpl = nullptr
std::optional< uint64_tLength

Friends

bool  operator== (const RefType &LHS, const RefType &RHS)

Detailed Description

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

Common stuff for mutable and immutable StreamRefs.

Definition at line 24 of file BinaryStreamRef.h.

Constructor & Destructor Documentation

◆  BinaryStreamRefBase() [1/6]

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

Referenced by BinaryStreamRefBase(), BinaryStreamRefBase(), operator=(), and operator=().

◆  BinaryStreamRefBase() [2/6]

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

Definition at line 27 of file BinaryStreamRef.h.

References BorrowedImpl, llvm::BSF_Append, Length, and ViewOffset.

◆  BinaryStreamRefBase() [3/6]

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

Definition at line 33 of file BinaryStreamRef.h.

References BorrowedImpl, llvm::get(), Length, llvm::Offset, SharedImpl, and ViewOffset.

◆  BinaryStreamRefBase() [4/6]

template<class RefType, class StreamType>
llvm::BinaryStreamRefBase< RefType, StreamType >::BinaryStreamRefBase ( StreamType & BorrowedImpl,
uint64_t Offset,
std::optional< uint64_t > Length )
inlineprotected

Definition at line 37 of file BinaryStreamRef.h.

References BorrowedImpl, Length, llvm::Offset, and ViewOffset.

◆  BinaryStreamRefBase() [5/6]

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

References BinaryStreamRefBase(), and llvm::Other.

◆  BinaryStreamRefBase() [6/6]

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

References BinaryStreamRefBase(), and llvm::Other.

Member Function Documentation

◆  checkOffsetForRead()

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

Definition at line 133 of file BinaryStreamRef.h.

References llvm::DataSize, getLength(), llvm::invalid_offset, llvm::make_error(), llvm::Offset, llvm::stream_too_short, and llvm::Error::success().

◆  drop_back()

template<class RefType, class StreamType>
RefType llvm::BinaryStreamRefBase< RefType, StreamType >::drop_back ( uint64_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 77 of file BinaryStreamRef.h.

References BorrowedImpl, getLength(), and N.

Referenced by keep_front().

◆  drop_front()

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

Return a new BinaryStreamRef with the first N elements removed.

If this BinaryStreamRef is length-tracking, then the resulting one will be too.

Definition at line 59 of file BinaryStreamRef.h.

References BorrowedImpl, getLength(), and N.

Referenced by drop_symmetric(), llvm::pdb::LinePrinter::formatMsfStreamData(), keep_back(), and slice().

◆  drop_symmetric()

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

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

Definition at line 110 of file BinaryStreamRef.h.

References drop_front(), and N.

◆  getEndian()

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

Definition at line 47 of file BinaryStreamRef.h.

References BorrowedImpl.

◆  getLength()

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

Definition at line 49 of file BinaryStreamRef.h.

References BorrowedImpl, Length, and ViewOffset.

Referenced by checkOffsetForRead(), drop_back(), drop_front(), keep_back(), and keep_front().

◆  keep_back()

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

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

Definition at line 103 of file BinaryStreamRef.h.

References assert(), drop_front(), getLength(), and N.

◆  keep_front()

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

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

Definition at line 97 of file BinaryStreamRef.h.

References assert(), drop_back(), getLength(), and N.

Referenced by llvm::pdb::LinePrinter::formatMsfStreamData().

◆  operator=() [1/2]

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

References BinaryStreamRefBase(), and llvm::Other.

◆  operator=() [2/2]

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

References BinaryStreamRefBase(), and llvm::Other.

◆  slice()

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

Return a new BinaryStreamRef with the first Offset elements removed, and retaining exactly Len elements.

Definition at line 116 of file BinaryStreamRef.h.

References drop_front(), and llvm::Offset.

Referenced by llvm::VarStreamArray< CVSymbol >::substream().

◆  valid()

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

Definition at line 120 of file BinaryStreamRef.h.

References BorrowedImpl.

◆  operator==

template<class RefType, class StreamType>
bool operator== ( const RefType & LHS,
const RefType & RHS )
friend

Definition at line 122 of file BinaryStreamRef.h.

References LHS, and RHS.

Member Data Documentation

◆  BorrowedImpl

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

Definition at line 142 of file BinaryStreamRef.h.

Referenced by BinaryStreamRefBase(), BinaryStreamRefBase(), BinaryStreamRefBase(), drop_back(), drop_front(), getEndian(), getLength(), and valid().

◆  Length

template<class RefType, class StreamType>
std::optional<uint64_t> llvm::BinaryStreamRefBase< RefType, StreamType >::Length
protected

Definition at line 144 of file BinaryStreamRef.h.

Referenced by BinaryStreamRefBase(), BinaryStreamRefBase(), BinaryStreamRefBase(), and getLength().

◆  SharedImpl

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

Definition at line 141 of file BinaryStreamRef.h.

Referenced by BinaryStreamRefBase().

◆  ViewOffset

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

Definition at line 143 of file BinaryStreamRef.h.

Referenced by BinaryStreamRefBase(), BinaryStreamRefBase(), BinaryStreamRefBase(), and getLength().


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

Generated on for LLVM by doxygen 1.14.0

AltStyle によって変換されたページ (->オリジナル) /