Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
skvx::Vec< 1, T > Struct Template Reference

#include <SkVx.h>

Public Member Functions

SKVX_ALWAYS_INLINE Vec ()=default
 
SKVX_ALWAYS_INLINE Vec (T s)
 
SKVX_ALWAYS_INLINE Vec (std::initializer_list< T > xs)
 
SKVX_ALWAYS_INLINE T operator[] (int i) const
 
SKVX_ALWAYS_INLINE Toperator[] (int i)
 
SKVX_ALWAYS_INLINE void store (void *ptr) const
 

Static Public Member Functions

static SKVX_ALWAYS_INLINE Vec Load (const void *ptr)
 

Public Attributes

T val = {}
 

Detailed Description

template<typename T>
struct skvx::Vec< 1, T >

Definition at line 214 of file SkVx.h.

Constructor & Destructor Documentation

◆ Vec() [1/3]

template<typename T >
SKVX_ALWAYS_INLINE skvx::Vec< 1, T >::Vec ( )
default

◆ Vec() [2/3]

template<typename T >
SKVX_ALWAYS_INLINE skvx::Vec< 1, T >::Vec ( T  s)
inline

Definition at line 218 of file SkVx.h.

218: val(s) {}
struct MyStruct s

◆ Vec() [3/3]

template<typename T >
SKVX_ALWAYS_INLINE skvx::Vec< 1, T >::Vec ( std::initializer_list< T xs)
inline

Definition at line 220 of file SkVx.h.

220 : val(xs.size() ? *xs.begin() : 0) {
221 assert(xs.size() <= (size_t)1);
222 }

Member Function Documentation

◆ Load()

template<typename T >
static SKVX_ALWAYS_INLINE Vec skvx::Vec< 1, T >::Load ( const void *  ptr)
inlinestatic

Definition at line 227 of file SkVx.h.

227 {
228 return sk_unaligned_load<Vec>(ptr);
229 }

◆ operator[]() [1/2]

template<typename T >
SKVX_ALWAYS_INLINE T & skvx::Vec< 1, T >::operator[] ( int  i)
inline

Definition at line 225 of file SkVx.h.

225{ assert(i == 0); return val; }

◆ operator[]() [2/2]

template<typename T >
SKVX_ALWAYS_INLINE T skvx::Vec< 1, T >::operator[] ( int  i) const
inline

Definition at line 224 of file SkVx.h.

224{ assert(i == 0); return val; }

◆ store()

template<typename T >
SKVX_ALWAYS_INLINE void skvx::Vec< 1, T >::store ( void *  ptr) const
inline

Definition at line 230 of file SkVx.h.

230 {
231 memcpy(ptr, this, sizeof(Vec));
232 }
SKVX_ALWAYS_INLINE Vec()=default

Member Data Documentation

◆ val

template<typename T >
T skvx::Vec< 1, T >::val = {}

Definition at line 215 of file SkVx.h.


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