5#ifndef FLUTTER_FML_NATIVE_LIBRARY_H_
6#define FLUTTER_FML_NATIVE_LIBRARY_H_
10#include "flutter/fml/build_config.h"
11#include "flutter/fml/macros.h"
12#include "flutter/fml/memory/ref_counted.h"
13#include "flutter/fml/memory/ref_ptr.h"
15#if defined(FML_OS_WIN)
34 bool close_handle_when_done);
40 auto* resolved_symbol = Resolve(symbol);
41 if (!resolved_symbol) {
44 return std::optional<T>(
reinterpret_cast<T>(resolved_symbol));
48 auto* resolved_symbol =
reinterpret_cast<const uint8_t*
>(Resolve(symbol));
49 if (resolved_symbol ==
nullptr) {
50 FML_DLOG(INFO) <<
"Could not resolve symbol in library: " << symbol;
52 return resolved_symbol;
57 bool close_handle_ =
true;
static fml::RefPtr< NativeLibrary > CreateForCurrentProcess()
const std::optional< T > ResolveFunction(const char *symbol)
static fml::RefPtr< NativeLibrary > Create(const char *path)
static fml::RefPtr< NativeLibrary > CreateWithHandle(Handle handle, bool close_handle_when_done)
const uint8_t * ResolveSymbol(const char *symbol)
#define FML_DLOG(severity)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path