Flutter Engine
The Flutter Engine
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
15namespace tonic {
16
18 public:
21
22 struct Entry {
23 const char* symbol;
27 };
28
29 void Register(std::initializer_list<Entry> entries);
30
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_
void Register(std::initializer_list< Entry > entries)
const uint8_t * GetSymbol(Dart_NativeFunction native_function)
Dart_NativeFunction GetNativeFunction(Dart_Handle name, int argument_count, bool *auto_setup_scope)
struct _Dart_Handle * Dart_Handle
Definition: dart_api.h:258
void(* Dart_NativeFunction)(Dart_NativeArguments arguments)
Definition: dart_api.h:3207
int argument_count
Definition: fuchsia.cc:52
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32