LLVM API Documentation

Public Types | Public Member Functions
llvm::MutableArrayRef< T > Class Template Reference

#include <ArrayRef.h>

Inheritance diagram for llvm::MutableArrayRef< T >:
Inheritance graph
[legend]
Collaboration diagram for llvm::MutableArrayRef< T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Titerator
typedef std::reverse_iterator
< iterator
reverse_iterator

Public Member Functions

 MutableArrayRef ()
 Construct an empty MutableArrayRef.
 MutableArrayRef (NoneType)
 Construct an empty MutableArrayRef from None.
 MutableArrayRef (T &OneElt)
 Construct an MutableArrayRef from a single element.
 MutableArrayRef (T *data, size_t length)
 Construct an MutableArrayRef from a pointer and length.
 MutableArrayRef (T *begin, T *end)
 Construct an MutableArrayRef from a range.
 MutableArrayRef (SmallVectorImpl< T > &Vec)
 Construct an MutableArrayRef from a SmallVector.
 MutableArrayRef (std::vector< T > &Vec)
 Construct a MutableArrayRef from a std::vector.
template<size_t N>
 MutableArrayRef (T(&Arr)[N])
 Construct an MutableArrayRef from a C array.
Tdata () const
iterator begin () const
iterator end () const
reverse_iterator rbegin () const
reverse_iterator rend () const
Tfront () const
 front - Get the first element.
Tback () const
 back - Get the last element.
MutableArrayRef< Tslice (unsigned N) const
 slice(n) - Chop off the first N elements of the array.
MutableArrayRef< Tslice (unsigned N, unsigned M) const
Toperator[] (size_t Index) const

Detailed Description

template<typename T>
class llvm::MutableArrayRef< T >

MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memory), i.e. a start pointer and a length. It allows various APIs to take and modify consecutive elements easily and conveniently.

This class does not own the underlying data, it is expected to be used in situations where the data resides in some other buffer, whose lifetime extends past that of the MutableArrayRef. For this reason, it is not in general safe to store a MutableArrayRef.

This is intended to be trivially copyable, so it should be passed by value.

Definition at line 192 of file ArrayRef.h.


Member Typedef Documentation

template<typename T>
typedef T* llvm::MutableArrayRef< T >::iterator

Reimplemented from llvm::ArrayRef< T >.

Definition at line 194 of file ArrayRef.h.

template<typename T>
typedef std::reverse_iterator<iterator> llvm::MutableArrayRef< T >::reverse_iterator

Reimplemented from llvm::ArrayRef< T >.

Definition at line 196 of file ArrayRef.h.


Constructor & Destructor Documentation

template<typename T>
llvm::MutableArrayRef< T >::MutableArrayRef ( ) [inline]

Construct an empty MutableArrayRef.

Definition at line 199 of file ArrayRef.h.

template<typename T>
llvm::MutableArrayRef< T >::MutableArrayRef ( NoneType  ) [inline]

Construct an empty MutableArrayRef from None.

Definition at line 202 of file ArrayRef.h.

template<typename T>
llvm::MutableArrayRef< T >::MutableArrayRef ( T OneElt) [inline]

Construct an MutableArrayRef from a single element.

Definition at line 205 of file ArrayRef.h.

template<typename T>
llvm::MutableArrayRef< T >::MutableArrayRef ( T data,
size_t  length 
) [inline]

Construct an MutableArrayRef from a pointer and length.

Definition at line 208 of file ArrayRef.h.

template<typename T>
llvm::MutableArrayRef< T >::MutableArrayRef ( T begin,
T end 
) [inline]

Construct an MutableArrayRef from a range.

Definition at line 212 of file ArrayRef.h.

template<typename T>
llvm::MutableArrayRef< T >::MutableArrayRef ( SmallVectorImpl< T > &  Vec) [inline]

Construct an MutableArrayRef from a SmallVector.

Definition at line 215 of file ArrayRef.h.

template<typename T>
llvm::MutableArrayRef< T >::MutableArrayRef ( std::vector< T > &  Vec) [inline]

Construct a MutableArrayRef from a std::vector.

Definition at line 219 of file ArrayRef.h.

template<typename T>
template<size_t N>
llvm::MutableArrayRef< T >::MutableArrayRef ( T(&)  Arr[N]) [inline]

Construct an MutableArrayRef from a C array.

Definition at line 224 of file ArrayRef.h.


Member Function Documentation

template<typename T>
T& llvm::MutableArrayRef< T >::back ( ) const [inline]

back - Get the last element.

Reimplemented from llvm::ArrayRef< T >.

Definition at line 242 of file ArrayRef.h.

References llvm::MutableArrayRef< T >::data(), llvm::ArrayRef< T >::empty(), and llvm::ArrayRef< T >::size().

template<typename T>
iterator llvm::MutableArrayRef< T >::begin ( ) const [inline]

Reimplemented from llvm::ArrayRef< T >.

Definition at line 229 of file ArrayRef.h.

References llvm::MutableArrayRef< T >::data().

Referenced by FitWeights(), and llvm::MutableArrayRef< T >::rend().

template<typename T>
T* llvm::MutableArrayRef< T >::data ( ) const [inline]
template<typename T>
iterator llvm::MutableArrayRef< T >::end ( ) const [inline]
template<typename T>
T& llvm::MutableArrayRef< T >::front ( ) const [inline]

front - Get the first element.

Reimplemented from llvm::ArrayRef< T >.

Definition at line 236 of file ArrayRef.h.

References llvm::MutableArrayRef< T >::data(), and llvm::ArrayRef< T >::empty().

template<typename T>
T& llvm::MutableArrayRef< T >::operator[] ( size_t  Index) const [inline]

Reimplemented from llvm::ArrayRef< T >.

Definition at line 261 of file ArrayRef.h.

References llvm::MutableArrayRef< T >::data(), and llvm::ArrayRef< T >::size().

template<typename T>
reverse_iterator llvm::MutableArrayRef< T >::rbegin ( ) const [inline]

Reimplemented from llvm::ArrayRef< T >.

Definition at line 232 of file ArrayRef.h.

References llvm::MutableArrayRef< T >::end().

template<typename T>
reverse_iterator llvm::MutableArrayRef< T >::rend ( ) const [inline]

Reimplemented from llvm::ArrayRef< T >.

Definition at line 233 of file ArrayRef.h.

References llvm::MutableArrayRef< T >::begin().

template<typename T>
MutableArrayRef<T> llvm::MutableArrayRef< T >::slice ( unsigned  N) const [inline]

slice(n) - Chop off the first N elements of the array.

Reimplemented from llvm::ArrayRef< T >.

Definition at line 248 of file ArrayRef.h.

References llvm::MutableArrayRef< T >::data(), and llvm::ArrayRef< T >::size().

template<typename T>
MutableArrayRef<T> llvm::MutableArrayRef< T >::slice ( unsigned  N,
unsigned  M 
) const [inline]

slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array.

Reimplemented from llvm::ArrayRef< T >.

Definition at line 255 of file ArrayRef.h.

References llvm::MutableArrayRef< T >::data(), and llvm::ArrayRef< T >::size().


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