Flutter Engine
tonic::DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type > Struct Template Reference

#include <dart_converter.h>

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)
 

Detailed Description

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

Definition at line 175 of file dart_converter.h.

Member Function Documentation

◆ 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 192 of file dart_converter.h.

194  {
195  int64_t result = 0;
196  Dart_GetNativeIntegerArgument(args, index, &result);
197  return static_cast<T>(result);
198  }
G_BEGIN_DECLS FlValue * args

◆ 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 186 of file dart_converter.h.

186  {
187  int64_t result = 0;
188  Dart_IntegerToInt64(handle, &result);
189  return static_cast<T>(result);
190  }

◆ SetReturnValue()

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

Definition at line 181 of file dart_converter.h.

181  {
182  Dart_SetIntegerReturnValue(
183  args, static_cast<typename std::underlying_type<T>::type>(val));
184  }
G_BEGIN_DECLS FlValue * args

◆ ToDart()

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

Definition at line 176 of file dart_converter.h.

176  {
177  return Dart_NewInteger(
178  static_cast<typename std::underlying_type<T>::type>(val));
179  }

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