Flutter Engine
The Flutter Engine
dart_invoke.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
9
10namespace tonic {
11
13 const char* name,
14 std::initializer_list<Dart_Handle> args) {
16 return Dart_Invoke(target, field, args.size(),
17 const_cast<Dart_Handle*>(args.begin()));
18}
19
21 std::initializer_list<Dart_Handle> args) {
22 int argc = args.size();
23 Dart_Handle* argv = const_cast<Dart_Handle*>(args.begin());
25 CheckAndHandleError(handle);
26 return handle;
27}
28
30 Dart_Handle handle = Dart_InvokeClosure(closure, 0, nullptr);
31 CheckAndHandleError(handle);
32 return handle;
33}
34
35} // namespace tonic
struct _Dart_Handle * Dart_Handle
Definition: dart_api.h:258
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_Invoke(Dart_Handle target, Dart_Handle name, int number_of_arguments, Dart_Handle *arguments)
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_InvokeClosure(Dart_Handle closure, int number_of_arguments, Dart_Handle *arguments)
DART_EXPORT Dart_Handle Dart_NewStringFromCString(const char *str)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
uint32_t * target
char ** argv
Definition: library.h:9
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
std::function< void()> closure
Definition: closure.h:14
Dart_Handle DartInvoke(Dart_Handle closure, std::initializer_list< Dart_Handle > args)
Definition: dart_invoke.cc:20
Dart_Handle DartInvokeVoid(Dart_Handle closure)
Definition: dart_invoke.cc:29
bool CheckAndHandleError(Dart_Handle handle)
Definition: dart_error.cc:33
Dart_Handle DartInvokeField(Dart_Handle target, const char *name, std::initializer_list< Dart_Handle > args)
Definition: dart_invoke.cc:12