Flutter Engine
The Flutter Engine
Classes | Public Types | Public Member Functions | List of all members
SkZip< Ts > Class Template Reference

#include <SkZip.h>

Public Types

template<typename U , typename T >
using CanConvertToConst = typename std::integral_constant< bool, std::is_convertible< U *, T * >::value &&sizeof(U)==sizeof(T)>::type
 

Public Member Functions

constexpr SkZip ()
 
constexpr SkZip (size_t)=delete
 
constexpr SkZip (size_t size, Ts *... ts)
 
constexpr SkZip (const SkZip &that)=default
 
constexpr SkZipoperator= (const SkZip &that)=default
 
template<typename... Us, typename = std::enable_if<std::conjunction<CanConvertToConst<Us, Ts>...>::value>>
constexpr SkZip (const SkZip< Us... > &that)
 
constexpr ReturnTuple operator[] (size_t i) const
 
constexpr size_t size () const
 
constexpr bool empty () const
 
constexpr ReturnTuple front () const
 
constexpr ReturnTuple back () const
 
constexpr Iterator begin () const
 
constexpr Iterator end () const
 
template<size_t I>
constexpr auto get () const
 
constexpr std::tuple< Ts *... > data () const
 
constexpr SkZip first (size_t n) const
 
constexpr SkZip last (size_t n) const
 
constexpr SkZip subspan (size_t offset, size_t count) const
 

Detailed Description

template<typename... Ts>
class SkZip< Ts >

Definition at line 25 of file SkZip.h.

Member Typedef Documentation

◆ CanConvertToConst

template<typename... Ts>
template<typename U , typename T >
using SkZip< Ts >::CanConvertToConst = typename std::integral_constant<bool, std::is_convertible<U*, T*>::value && sizeof(U) == sizeof(T)>::type

Definition at line 65 of file SkZip.h.

Constructor & Destructor Documentation

◆ SkZip() [1/5]

template<typename... Ts>
constexpr SkZip< Ts >::SkZip ( )
inlineconstexpr

Definition at line 55 of file SkZip.h.

55: fPointers{nullify<Ts>...}, fSize{0} {}

◆ SkZip() [2/5]

template<typename... Ts>
constexpr SkZip< Ts >::SkZip ( size_t  )
constexprdelete

◆ SkZip() [3/5]

template<typename... Ts>
constexpr SkZip< Ts >::SkZip ( size_t  size,
Ts *...  ts 
)
inlineconstexpr

Definition at line 57 of file SkZip.h.

58 : fPointers{ts...}
59 , fSize{size} {}
constexpr size_t size() const
Definition: SkZip.h:76

◆ SkZip() [4/5]

template<typename... Ts>
constexpr SkZip< Ts >::SkZip ( const SkZip< Ts > &  that)
constexprdefault

◆ SkZip() [5/5]

template<typename... Ts>
template<typename... Us, typename = std::enable_if<std::conjunction<CanConvertToConst<Us, Ts>...>::value>>
constexpr SkZip< Ts >::SkZip ( const SkZip< Us... > &  that)
inlineconstexpr

Definition at line 71 of file SkZip.h.

72 : fPointers(that.data())
73 , fSize{that.size()} { }
constexpr std::tuple< Ts *... > data() const
Definition: SkZip.h:85

Member Function Documentation

◆ back()

template<typename... Ts>
constexpr ReturnTuple SkZip< Ts >::back ( ) const
inlineconstexpr

Definition at line 79 of file SkZip.h.

79{ return this->index(this->size() - 1); }

◆ begin()

template<typename... Ts>
constexpr Iterator SkZip< Ts >::begin ( ) const
inlineconstexpr

Definition at line 80 of file SkZip.h.

80{ return Iterator{this, 0}; }

◆ data()

template<typename... Ts>
constexpr std::tuple< Ts *... > SkZip< Ts >::data ( ) const
inlineconstexpr

Definition at line 85 of file SkZip.h.

85{ return fPointers; }

◆ empty()

template<typename... Ts>
constexpr bool SkZip< Ts >::empty ( ) const
inlineconstexpr

Definition at line 77 of file SkZip.h.

77{ return this->size() == 0; }

◆ end()

template<typename... Ts>
constexpr Iterator SkZip< Ts >::end ( ) const
inlineconstexpr

Definition at line 81 of file SkZip.h.

81{ return Iterator{this, this->size()}; }

◆ first()

template<typename... Ts>
constexpr SkZip SkZip< Ts >::first ( size_t  n) const
inlineconstexpr

Definition at line 86 of file SkZip.h.

86 {
87 SkASSERT(n <= this->size());
88 if (n == 0) { return SkZip(); }
89 return SkZip{n, fPointers};
90 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
Definition: SkZip.h:25
constexpr SkZip()
Definition: SkZip.h:55

◆ front()

template<typename... Ts>
constexpr ReturnTuple SkZip< Ts >::front ( ) const
inlineconstexpr

Definition at line 78 of file SkZip.h.

78{ return this->index(0); }

◆ get()

template<typename... Ts>
template<size_t I>
constexpr auto SkZip< Ts >::get ( ) const
inlineconstexpr

Definition at line 82 of file SkZip.h.

82 {
83 return SkSpan(std::get<I>(fPointers), fSize);
84 }
SkSpan(Container &&) -> SkSpan< std::remove_pointer_t< decltype(std::data(std::declval< Container >()))> >

◆ last()

template<typename... Ts>
constexpr SkZip SkZip< Ts >::last ( size_t  n) const
inlineconstexpr

Definition at line 91 of file SkZip.h.

91 {
92 SkASSERT(n <= this->size());
93 if (n == 0) { return SkZip(); }
94 return SkZip{n, this->pointersAt(fSize - n)};
95 }

◆ operator=()

template<typename... Ts>
constexpr SkZip & SkZip< Ts >::operator= ( const SkZip< Ts > &  that)
constexprdefault

◆ operator[]()

template<typename... Ts>
constexpr ReturnTuple SkZip< Ts >::operator[] ( size_t  i) const
inlineconstexpr

Definition at line 75 of file SkZip.h.

75{ return this->index(i);}

◆ size()

template<typename... Ts>
constexpr size_t SkZip< Ts >::size ( ) const
inlineconstexpr

Definition at line 76 of file SkZip.h.

76{ return fSize; }

◆ subspan()

template<typename... Ts>
constexpr SkZip SkZip< Ts >::subspan ( size_t  offset,
size_t  count 
) const
inlineconstexpr

Definition at line 96 of file SkZip.h.

96 {
97 SkASSERT(offset < this->size());
98 SkASSERT(count <= this->size() - offset);
99 if (count == 0) { return SkZip(); }
100 return SkZip(count, pointersAt(offset));
101 }
int count
Definition: FontMgrTest.cpp:50
SeparatedVector2 offset

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