Flutter Engine
android Namespace Reference

Classes

struct  aggregate_traits
 
struct  key_value_pair_t
 
class  LruCache
 
class  OnEntryRemoved
 
struct  trait_pointer
 
struct  trait_pointer< T * >
 
struct  trait_trivial_copy
 
struct  trait_trivial_copy< key_value_pair_t< K, V > >
 
struct  trait_trivial_ctor
 
struct  trait_trivial_ctor< key_value_pair_t< K, V > >
 
struct  trait_trivial_dtor
 
struct  trait_trivial_dtor< key_value_pair_t< K, V > >
 
struct  trait_trivial_move
 
struct  trait_trivial_move< key_value_pair_t< K, V > >
 
struct  traits
 
struct  use_trivial_move
 

Typedefs

typedef uint32_t hash_t
 

Functions

uint32_t JenkinsHashMix (uint32_t hash, uint32_t data)
 
hash_t JenkinsHashWhiten (uint32_t hash)
 
uint32_t JenkinsHashMixBytes (uint32_t hash, const uint8_t *bytes, size_t size)
 
uint32_t JenkinsHashMixShorts (uint32_t hash, const uint16_t *shorts, size_t size)
 
template<typename TYPE >
int strictly_order_type (const TYPE &lhs, const TYPE &rhs)
 
template<typename TYPE >
int compare_type (const TYPE &lhs, const TYPE &rhs)
 
template<typename TYPE >
void construct_type (TYPE *p, size_t n)
 
template<typename TYPE >
void destroy_type (TYPE *p, size_t n)
 
template<typename TYPE >
std::enable_if< traits< TYPE >::has_trivial_copy >::type copy_type (TYPE *d, const TYPE *s, size_t n)
 
template<typename TYPE >
std::enable_if<!traits< TYPE >::has_trivial_copy >::type copy_type (TYPE *d, const TYPE *s, size_t n)
 
template<typename TYPE >
void splat_type (TYPE *where, const TYPE *what, size_t n)
 
template<typename TYPE >
std::enable_if< use_trivial_move< TYPE >::value >::type move_forward_type (TYPE *d, const TYPE *s, size_t n=1)
 
template<typename TYPE >
std::enable_if<!use_trivial_move< TYPE >::value >::type move_forward_type (TYPE *d, const TYPE *s, size_t n=1)
 
template<typename TYPE >
std::enable_if< use_trivial_move< TYPE >::value >::type move_backward_type (TYPE *d, const TYPE *s, size_t n=1)
 
template<typename TYPE >
std::enable_if<!use_trivial_move< TYPE >::value >::type move_backward_type (TYPE *d, const TYPE *s, size_t n=1)
 
template<typename TKey >
hash_t hash_type (const TKey &key)
 
template<typename T >
hash_t hash_type (T *const &value)
 

Typedef Documentation

◆ hash_t

typedef uint32_t android::hash_t

Definition at line 325 of file TypeHelpers.h.

Function Documentation

◆ compare_type()

template<typename TYPE >
int android::compare_type ( const TYPE &  lhs,
const TYPE &  rhs 
)
inline

Definition at line 154 of file TypeHelpers.h.

References strictly_order_type().

154  {
155  return strictly_order_type(rhs, lhs) - strictly_order_type(lhs, rhs);
156 }
int strictly_order_type(const TYPE &lhs, const TYPE &rhs)
Definition: TypeHelpers.h:149

◆ construct_type()

template<typename TYPE >
void android::construct_type ( TYPE *  p,
size_t  n 
)
inline

Definition at line 163 of file TypeHelpers.h.

163  {
164  if (!traits<TYPE>::has_trivial_ctor) {
165  while (n > 0) {
166  n--;
167  new (p++) TYPE;
168  }
169  }
170 }

◆ copy_type() [1/2]

template<typename TYPE >
std::enable_if<traits<TYPE>::has_trivial_copy>::type android::copy_type ( TYPE *  d,
const TYPE *  s,
size_t  n 
)
inline

Definition at line 184 of file TypeHelpers.h.

187  {
188  memcpy(d, s, n * sizeof(TYPE));
189 }

◆ copy_type() [2/2]

template<typename TYPE >
std::enable_if<!traits<TYPE>::has_trivial_copy>::type android::copy_type ( TYPE *  d,
const TYPE *  s,
size_t  n 
)
inline

Definition at line 192 of file TypeHelpers.h.

195  {
196  while (n > 0) {
197  n--;
198  new (d) TYPE(*s);
199  d++, s++;
200  }
201 }

◆ destroy_type()

template<typename TYPE >
void android::destroy_type ( TYPE *  p,
size_t  n 
)
inline

Definition at line 173 of file TypeHelpers.h.

173  {
174  if (!traits<TYPE>::has_trivial_dtor) {
175  while (n > 0) {
176  n--;
177  p->~TYPE();
178  p++;
179  }
180  }
181 }

◆ hash_type() [1/2]

template<typename TKey >
hash_t android::hash_type ( const TKey &  key)

Referenced by hash_type().

◆ hash_type() [2/2]

template<typename T >
hash_t android::hash_type ( T *const &  value)
inline

Definition at line 363 of file TypeHelpers.h.

References hash_type().

363  {
364  return hash_type(uintptr_t(value));
365 }
uint8_t value
hash_t hash_type(T *const &value)
Definition: TypeHelpers.h:363

◆ JenkinsHashMix()

uint32_t android::JenkinsHashMix ( uint32_t  hash,
uint32_t  data 
)
inline

Definition at line 36 of file JenkinsHash.h.

References JenkinsHashMixBytes(), JenkinsHashMixShorts(), JenkinsHashWhiten(), and fml::size().

36  {
37  hash += data;
38  hash += (hash << 10);
39  hash ^= (hash >> 6);
40  return hash;
41 }

◆ JenkinsHashMixBytes()

uint32_t android::JenkinsHashMixBytes ( uint32_t  hash,
const uint8_t *  bytes,
size_t  size 
)

Referenced by JenkinsHashMix().

◆ JenkinsHashMixShorts()

uint32_t android::JenkinsHashMixShorts ( uint32_t  hash,
const uint16_t *  shorts,
size_t  size 
)

Referenced by JenkinsHashMix().

◆ JenkinsHashWhiten()

hash_t android::JenkinsHashWhiten ( uint32_t  hash)

Referenced by JenkinsHashMix().

◆ move_backward_type() [1/2]

template<typename TYPE >
std::enable_if<use_trivial_move<TYPE>::value>:: type android::move_backward_type ( TYPE *  d,
const TYPE *  s,
size_t  n = 1 
)
inline

Definition at line 253 of file TypeHelpers.h.

References value.

253  {
254  memmove(d, s, n * sizeof(TYPE));
255 }

◆ move_backward_type() [2/2]

template<typename TYPE >
std::enable_if<!use_trivial_move<TYPE>::value>:: type android::move_backward_type ( TYPE *  d,
const TYPE *  s,
size_t  n = 1 
)
inline

Definition at line 259 of file TypeHelpers.h.

259  {
260  while (n > 0) {
261  n--;
262  if (!traits<TYPE>::has_trivial_copy) {
263  new (d) TYPE(*s);
264  } else {
265  *d = *s;
266  }
267  if (!traits<TYPE>::has_trivial_dtor) {
268  s->~TYPE();
269  }
270  d++, s++;
271  }
272 }

◆ move_forward_type() [1/2]

template<typename TYPE >
std::enable_if<use_trivial_move<TYPE>::value>:: type android::move_forward_type ( TYPE *  d,
const TYPE *  s,
size_t  n = 1 
)
inline

Definition at line 228 of file TypeHelpers.h.

References value.

228  {
229  memmove(d, s, n * sizeof(TYPE));
230 }

◆ move_forward_type() [2/2]

template<typename TYPE >
std::enable_if<!use_trivial_move<TYPE>::value>:: type android::move_forward_type ( TYPE *  d,
const TYPE *  s,
size_t  n = 1 
)
inline

Definition at line 234 of file TypeHelpers.h.

References value.

234  {
235  d += n;
236  s += n;
237  while (n > 0) {
238  n--;
239  --d, --s;
240  if (!traits<TYPE>::has_trivial_copy) {
241  new (d) TYPE(*s);
242  } else {
243  *d = *s;
244  }
245  if (!traits<TYPE>::has_trivial_dtor) {
246  s->~TYPE();
247  }
248  }
249 }

◆ splat_type()

template<typename TYPE >
void android::splat_type ( TYPE *  where,
const TYPE *  what,
size_t  n 
)
inline

Definition at line 204 of file TypeHelpers.h.

204  {
205  if (!traits<TYPE>::has_trivial_copy) {
206  while (n > 0) {
207  n--;
208  new (where) TYPE(*what);
209  where++;
210  }
211  } else {
212  while (n > 0) {
213  n--;
214  *where++ = *what;
215  }
216  }
217 }

◆ strictly_order_type()

template<typename TYPE >
int android::strictly_order_type ( const TYPE &  lhs,
const TYPE &  rhs 
)
inline

Definition at line 149 of file TypeHelpers.h.

Referenced by compare_type(), and android::key_value_pair_t< KEY, VALUE >::operator<().

149  {
150  return (lhs < rhs) ? 1 : 0;
151 }