Flutter Engine
fml::SymbolMapping Class Referencefinal

#include <mapping.h>

Inheritance diagram for fml::SymbolMapping:
fml::Mapping

Public Member Functions

 SymbolMapping (fml::RefPtr< fml::NativeLibrary > native_library, const char *symbol_name)
 
 ~SymbolMapping () override
 
size_t GetSize () const override
 
const uint8_t * GetMapping () const override
 
- Public Member Functions inherited from fml::Mapping
 Mapping ()
 
virtual ~Mapping ()
 

Detailed Description

Definition at line 128 of file mapping.h.

Constructor & Destructor Documentation

◆ SymbolMapping()

fml::SymbolMapping::SymbolMapping ( fml::RefPtr< fml::NativeLibrary native_library,
const char *  symbol_name 
)

Definition at line 107 of file mapping.cc.

References fml::NativeLibrary::ResolveSymbol(), and ~SymbolMapping().

109  : native_library_(std::move(native_library)) {
110  if (native_library_ && symbol_name != nullptr) {
111  mapping_ = native_library_->ResolveSymbol(symbol_name);
112 
113  if (mapping_ == nullptr) {
114  // Apparently, dart_bootstrap seems to account for the Mac behavior of
115  // requiring the underscore prefixed symbol name on non-Mac platforms as
116  // well. As a fallback, check the underscore prefixed variant of the
117  // symbol name and allow callers to not have handle this on a per platform
118  // toolchain quirk basis.
119 
120  std::stringstream underscore_symbol_name;
121  underscore_symbol_name << "_" << symbol_name;
122  mapping_ =
123  native_library_->ResolveSymbol(underscore_symbol_name.str().c_str());
124  }
125  }
126 }
const uint8_t * ResolveSymbol(const char *symbol)

◆ ~SymbolMapping()

fml::SymbolMapping::~SymbolMapping ( )
overridedefault

Referenced by SymbolMapping().

Member Function Documentation

◆ GetMapping()

const uint8_t * fml::SymbolMapping::GetMapping ( ) const
overridevirtual

Implements fml::Mapping.

Definition at line 134 of file mapping.cc.

134  {
135  return mapping_;
136 }

◆ GetSize()

size_t fml::SymbolMapping::GetSize ( ) const
overridevirtual

Implements fml::Mapping.

Definition at line 130 of file mapping.cc.

130  {
131  return 0;
132 }

The documentation for this class was generated from the following files: