Flutter Engine
The Flutter Engine
third_party
tonic
dart_library_natives.h
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
5
#ifndef LIB_TONIC_DART_LIBRARY_NATIVES_H_
6
#define LIB_TONIC_DART_LIBRARY_NATIVES_H_
7
8
#include <initializer_list>
9
#include <string>
10
#include <unordered_map>
11
12
#include "third_party/dart/runtime/include/dart_api.h"
13
#include "
tonic/common/macros.h
"
14
15
namespace
tonic
{
16
17
class
DartLibraryNatives
{
18
public
:
19
DartLibraryNatives
();
20
~DartLibraryNatives
();
21
22
struct
Entry
{
23
const
char
*
symbol
;
24
Dart_NativeFunction
native_function
;
25
int
argument_count
;
26
bool
auto_setup_scope
;
27
};
28
29
void
Register
(std::initializer_list<Entry> entries);
30
31
Dart_NativeFunction
GetNativeFunction
(
Dart_Handle
name
,
32
int
argument_count
,
33
bool
* auto_setup_scope);
34
const
uint8_t*
GetSymbol
(
Dart_NativeFunction
native_function);
35
36
private
:
37
std::unordered_map<std::string, Entry> entries_;
38
std::unordered_map<Dart_NativeFunction, const char*> symbols_;
39
40
TONIC_DISALLOW_COPY_AND_ASSIGN(
DartLibraryNatives
);
41
};
42
43
}
// namespace tonic
44
45
#endif
// LIB_TONIC_DART_LIBRARY_NATIVES_H_
tonic::DartLibraryNatives
Definition:
dart_library_natives.h:17
tonic::DartLibraryNatives::Register
void Register(std::initializer_list< Entry > entries)
Definition:
dart_library_natives.cc:15
tonic::DartLibraryNatives::DartLibraryNatives
DartLibraryNatives()
Definition:
dart_library_natives.cc:11
tonic::DartLibraryNatives::~DartLibraryNatives
~DartLibraryNatives()
Definition:
dart_library_natives.cc:13
tonic::DartLibraryNatives::GetSymbol
const uint8_t * GetSymbol(Dart_NativeFunction native_function)
Definition:
dart_library_natives.cc:37
tonic::DartLibraryNatives::GetNativeFunction
Dart_NativeFunction GetNativeFunction(Dart_Handle name, int argument_count, bool *auto_setup_scope)
Definition:
dart_library_natives.cc:22
Dart_Handle
struct _Dart_Handle * Dart_Handle
Definition:
dart_api.h:258
Dart_NativeFunction
void(* Dart_NativeFunction)(Dart_NativeArguments arguments)
Definition:
dart_api.h:3207
argument_count
int argument_count
Definition:
fuchsia.cc:52
flutter::name
DEF_SWITCHES_START aot vmservice shared library name
Definition:
switches.h:32
tonic
Definition:
image_filter.h:14
tonic::DartLibraryNatives::Entry
Definition:
dart_library_natives.h:22
tonic::DartLibraryNatives::Entry::argument_count
int argument_count
Definition:
dart_library_natives.h:25
tonic::DartLibraryNatives::Entry::symbol
const char * symbol
Definition:
dart_library_natives.h:23
tonic::DartLibraryNatives::Entry::native_function
Dart_NativeFunction native_function
Definition:
dart_library_natives.h:24
tonic::DartLibraryNatives::Entry::auto_setup_scope
bool auto_setup_scope
Definition:
dart_library_natives.h:26
macros.h
Generated on Sun Jun 23 2024 21:56:53 for Flutter Engine by
1.9.4