Flutter Engine
tonic::DartClassProvider Class Reference

#include <dart_class_provider.h>

Public Member Functions

 DartClassProvider (DartState *dart_state, const char *library_name)
 
 ~DartClassProvider ()
 
Dart_Handle GetClassByName (const char *class_name)
 

Detailed Description

Definition at line 14 of file dart_class_provider.h.

Constructor & Destructor Documentation

◆ DartClassProvider()

tonic::DartClassProvider::DartClassProvider ( DartState dart_state,
const char *  library_name 
)

Definition at line 13 of file dart_class_provider.cc.

References tonic::DartPersistentValue::Set(), and tonic::ToDart().

14  {
15  library_.Set(dart_state, Dart_LookupLibrary(ToDart(class_name)));
16 }
void Set(DartState *dart_state, Dart_Handle value)
Dart_Handle ToDart(const T &object)

◆ ~DartClassProvider()

tonic::DartClassProvider::~DartClassProvider ( )

Definition at line 18 of file dart_class_provider.cc.

18 {}

Member Function Documentation

◆ GetClassByName()

Dart_Handle tonic::DartClassProvider::GetClassByName ( const char *  class_name)

Definition at line 20 of file dart_class_provider.cc.

References tonic::ToDart(), TONIC_DCHECK, and tonic::DartPersistentValue::value().

20  {
21  Dart_Handle name_handle = ToDart(class_name);
22  Dart_Handle class_handle =
23  Dart_GetNonNullableType(library_.value(), name_handle, 0, nullptr);
24  TONIC_DCHECK(!Dart_IsError(class_handle));
25  return class_handle;
26 }
#define TONIC_DCHECK
Definition: macros.h:32
Dart_PersistentHandle value() const
Dart_Handle ToDart(const T &object)

The documentation for this class was generated from the following files: