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 176 of file mapping.h.

Constructor & Destructor Documentation

◆ SymbolMapping()

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

Definition at line 146 of file mapping.cc.

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

148  : native_library_(std::move(native_library)) {
149  if (native_library_ && symbol_name != nullptr) {
150  mapping_ = native_library_->ResolveSymbol(symbol_name);
151 
152  if (mapping_ == nullptr) {
153  // Apparently, dart_bootstrap seems to account for the Mac behavior of
154  // requiring the underscore prefixed symbol name on non-Mac platforms as
155  // well. As a fallback, check the underscore prefixed variant of the
156  // symbol name and allow callers to not have handle this on a per platform
157  // toolchain quirk basis.
158 
159  std::stringstream underscore_symbol_name;
160  underscore_symbol_name << "_" << symbol_name;
161  mapping_ =
162  native_library_->ResolveSymbol(underscore_symbol_name.str().c_str());
163  }
164  }
165 }
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 173 of file mapping.cc.

173  {
174  return mapping_;
175 }

◆ GetSize()

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

Implements fml::Mapping.

Definition at line 169 of file mapping.cc.

169  {
170  return 0;
171 }

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