5#ifndef LIB_TONIC_DART_CLASS_LIBRARY_H_
6#define LIB_TONIC_DART_CLASS_LIBRARY_H_
10#include <unordered_map>
12#include "third_party/dart/runtime/include/dart_api.h"
16struct DartWrapperInfo;
24 std::unique_ptr<DartClassProvider> provider) {
25 providers_.insert(std::make_pair(library_name, std::move(provider)));
30 const std::string& interface_name);
34 const char* interface_name,
41 template <
typename T,
typename U>
42 std::size_t operator()(
const std::pair<T, U>& pair)
const {
43 return std::hash<T>()(pair.first) + 37 * std::hash<U>()(pair.second);
47 std::unordered_map<std::string, std::unique_ptr<DartClassProvider>>
49 std::unordered_map<const DartWrapperInfo*, Dart_PersistentHandle> info_cache_;
50 std::unordered_map<std::pair<std::string, std::string>,
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
void add_provider(const std::string &library_name, std::unique_ptr< DartClassProvider > provider)
Dart_PersistentHandle GetClass(const DartWrapperInfo &info)
Dart_Handle Dart_PersistentHandle