Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
tonic::DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type > Struct Template Reference

#include <dart_converter.h>

Public Types

using FfiType = int32_t
 

Static Public Member Functions

static Dart_Handle ToDart (T val)
 
static void SetReturnValue (Dart_NativeArguments args, T val)
 
static T FromDart (Dart_Handle handle)
 
static T FromArguments (Dart_NativeArguments args, int index, Dart_Handle &exception)
 
static T FromFfi (FfiType val)
 
static const char * GetFfiRepresentation ()
 
static const char * GetDartRepresentation ()
 
static bool AllowedInLeafCall ()
 

Static Public Attributes

static constexpr const char * kFfiRepresentation = "Int32"
 
static constexpr const char * kDartRepresentation = "int"
 
static constexpr bool kAllowedInLeafCall = true
 

Detailed Description

template<typename T>
struct tonic::DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type >

Definition at line 246 of file dart_converter.h.

Member Typedef Documentation

◆ FfiType

template<typename T >
using tonic::DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type >::FfiType = int32_t

Definition at line 247 of file dart_converter.h.

Member Function Documentation

◆ AllowedInLeafCall()

template<typename T >
static bool tonic::DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type >::AllowedInLeafCall ( )
inlinestatic

◆ FromArguments()

template<typename T >
static T tonic::DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type >::FromArguments ( Dart_NativeArguments  args,
int  index,
Dart_Handle exception 
)
inlinestatic

Definition at line 268 of file dart_converter.h.

270 {
271 int64_t result = 0;
273 return static_cast<T>(result);
274 }
DART_EXPORT Dart_Handle Dart_GetNativeIntegerArgument(Dart_NativeArguments args, int index, int64_t *value)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
GAsyncResult * result
#define T

◆ FromDart()

template<typename T >
static T tonic::DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type >::FromDart ( Dart_Handle  handle)
inlinestatic

Definition at line 262 of file dart_converter.h.

262 {
263 int64_t result = 0;
264 Dart_IntegerToInt64(handle, &result);
265 return static_cast<T>(result);
266 }
DART_EXPORT Dart_Handle Dart_IntegerToInt64(Dart_Handle integer, int64_t *value)

◆ FromFfi()

template<typename T >
static T tonic::DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type >::FromFfi ( FfiType  val)
inlinestatic

Definition at line 276 of file dart_converter.h.

276{ return static_cast<T>(val); }

◆ GetDartRepresentation()

template<typename T >
static const char * tonic::DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type >::GetDartRepresentation ( )
inlinestatic

◆ GetFfiRepresentation()

template<typename T >
static const char * tonic::DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type >::GetFfiRepresentation ( )
inlinestatic

◆ SetReturnValue()

template<typename T >
static void tonic::DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type >::SetReturnValue ( Dart_NativeArguments  args,
T  val 
)
inlinestatic

Definition at line 257 of file dart_converter.h.

257 {
259 args, static_cast<typename std::underlying_type<T>::type>(val));
260 }
DART_EXPORT void Dart_SetIntegerReturnValue(Dart_NativeArguments args, int64_t retval)

◆ ToDart()

template<typename T >
static Dart_Handle tonic::DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type >::ToDart ( T  val)
inlinestatic

Definition at line 252 of file dart_converter.h.

252 {
253 return Dart_NewInteger(
254 static_cast<typename std::underlying_type<T>::type>(val));
255 }
DART_EXPORT Dart_Handle Dart_NewInteger(int64_t value)

Member Data Documentation

◆ kAllowedInLeafCall

template<typename T >
constexpr bool tonic::DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type >::kAllowedInLeafCall = true
staticconstexpr

Definition at line 250 of file dart_converter.h.

◆ kDartRepresentation

template<typename T >
constexpr const char* tonic::DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type >::kDartRepresentation = "int"
staticconstexpr

Definition at line 249 of file dart_converter.h.

◆ kFfiRepresentation

template<typename T >
constexpr const char* tonic::DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type >::kFfiRepresentation = "Int32"
staticconstexpr

Definition at line 248 of file dart_converter.h.


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