Flutter Engine
TypeHelpers.h File Reference
#include <sys/types.h>
#include <cstdint>
#include <cstring>
#include <new>
#include <type_traits>

Go to the source code of this file.

Classes

struct  android::trait_trivial_ctor< T >
 
struct  android::trait_trivial_dtor< T >
 
struct  android::trait_trivial_copy< T >
 
struct  android::trait_trivial_move< T >
 
struct  android::trait_pointer< T >
 
struct  android::trait_pointer< T * >
 
struct  android::traits< TYPE >
 
struct  android::aggregate_traits< T, U >
 
struct  android::use_trivial_move< TYPE >
 
struct  android::key_value_pair_t< KEY, VALUE >
 
struct  android::trait_trivial_ctor< key_value_pair_t< K, V > >
 
struct  android::trait_trivial_dtor< key_value_pair_t< K, V > >
 
struct  android::trait_trivial_copy< key_value_pair_t< K, V > >
 
struct  android::trait_trivial_move< key_value_pair_t< K, V > >
 

Namespaces

 android
 

Macros

#define ANDROID_TRIVIAL_CTOR_TRAIT(T)
 
#define ANDROID_TRIVIAL_DTOR_TRAIT(T)
 
#define ANDROID_TRIVIAL_COPY_TRAIT(T)
 
#define ANDROID_TRIVIAL_MOVE_TRAIT(T)
 
#define ANDROID_BASIC_TYPES_TRAITS(T)
 
#define ANDROID_INT32_HASH(T)
 
#define ANDROID_INT64_HASH(T)
 
#define ANDROID_REINTERPRET_HASH(T, R)
 

Typedefs

typedef uint32_t android::hash_t
 

Functions

template<typename TYPE >
int android::strictly_order_type (const TYPE &lhs, const TYPE &rhs)
 
template<typename TYPE >
int android::compare_type (const TYPE &lhs, const TYPE &rhs)
 
template<typename TYPE >
void android::construct_type (TYPE *p, size_t n)
 
template<typename TYPE >
void android::destroy_type (TYPE *p, size_t n)
 
template<typename TYPE >
std::enable_if< traits< TYPE >::has_trivial_copy >::type android::copy_type (TYPE *d, const TYPE *s, size_t n)
 
template<typename TYPE >
std::enable_if<!traits< TYPE >::has_trivial_copy >::type android::copy_type (TYPE *d, const TYPE *s, size_t n)
 
template<typename TYPE >
void android::splat_type (TYPE *where, const TYPE *what, size_t n)
 
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)
 
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)
 
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)
 
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)
 
template<typename TKey >
hash_t android::hash_type (const TKey &key)
 
template<typename T >
hash_t android::hash_type (T *const &value)
 

Macro Definition Documentation

◆ ANDROID_BASIC_TYPES_TRAITS

#define ANDROID_BASIC_TYPES_TRAITS (   T)
Value:
ANDROID_TRIVIAL_DTOR_TRAIT(T) \
ANDROID_TRIVIAL_COPY_TRAIT(T) \
ANDROID_TRIVIAL_MOVE_TRAIT(T)
#define ANDROID_TRIVIAL_CTOR_TRAIT(T)
Definition: TypeHelpers.h:91

Definition at line 115 of file TypeHelpers.h.

◆ ANDROID_INT32_HASH

#define ANDROID_INT32_HASH (   T)
Value:
template <> \
inline hash_t hash_type(const T& value) { \
return hash_t(value); \
}
uint32_t hash_t
Definition: TypeHelpers.h:325
uint8_t value
hash_t hash_type(T *const &value)
Definition: TypeHelpers.h:363

Definition at line 331 of file TypeHelpers.h.

◆ ANDROID_INT64_HASH

#define ANDROID_INT64_HASH (   T)
Value:
template <> \
inline hash_t hash_type(const T& value) { \
return hash_t((value >> 32) ^ value); \
}
uint32_t hash_t
Definition: TypeHelpers.h:325
uint8_t value
hash_t hash_type(T *const &value)
Definition: TypeHelpers.h:363

Definition at line 336 of file TypeHelpers.h.

◆ ANDROID_REINTERPRET_HASH

#define ANDROID_REINTERPRET_HASH (   T,
 
)
Value:
template <> \
inline hash_t hash_type(const T& value) { \
R newValue; \
static_assert(sizeof(newValue) == sizeof(value), "size mismatch"); \
memcpy(&newValue, &value, sizeof(newValue)); \
return hash_type(newValue); \
}
uint32_t hash_t
Definition: TypeHelpers.h:325
uint8_t value
hash_t hash_type(T *const &value)
Definition: TypeHelpers.h:363

Definition at line 341 of file TypeHelpers.h.

◆ ANDROID_TRIVIAL_COPY_TRAIT

#define ANDROID_TRIVIAL_COPY_TRAIT (   T)
Value:
template <> \
struct trait_trivial_copy<T> { \
enum { value = true }; \
};
uint8_t value

Definition at line 103 of file TypeHelpers.h.

◆ ANDROID_TRIVIAL_CTOR_TRAIT

#define ANDROID_TRIVIAL_CTOR_TRAIT (   T)
Value:
template <> \
struct trait_trivial_ctor<T> { \
enum { value = true }; \
};
uint8_t value

Definition at line 91 of file TypeHelpers.h.

◆ ANDROID_TRIVIAL_DTOR_TRAIT

#define ANDROID_TRIVIAL_DTOR_TRAIT (   T)
Value:
template <> \
struct trait_trivial_dtor<T> { \
enum { value = true }; \
};
uint8_t value

Definition at line 97 of file TypeHelpers.h.

◆ ANDROID_TRIVIAL_MOVE_TRAIT

#define ANDROID_TRIVIAL_MOVE_TRAIT (   T)
Value:
template <> \
struct trait_trivial_move<T> { \
enum { value = true }; \
};
uint8_t value

Definition at line 109 of file TypeHelpers.h.