Flutter Engine
flutter::PluginRegistrar Class Reference

#include <plugin_registrar.h>

Inheritance diagram for flutter::PluginRegistrar:
flutter::PluginRegistrarGlfw flutter::PluginRegistrarWindows

Public Member Functions

 PluginRegistrar (FlutterDesktopPluginRegistrarRef core_registrar)
 
virtual ~PluginRegistrar ()
 
 PluginRegistrar (PluginRegistrar const &)=delete
 
PluginRegistraroperator= (PluginRegistrar const &)=delete
 
BinaryMessengermessenger ()
 
TextureRegistrartexture_registrar ()
 
void AddPlugin (std::unique_ptr< Plugin > plugin)
 

Protected Member Functions

FlutterDesktopPluginRegistrarRef registrar ()
 
void ClearPlugins ()
 

Detailed Description

Definition at line 27 of file plugin_registrar.h.

Constructor & Destructor Documentation

◆ PluginRegistrar() [1/2]

flutter::PluginRegistrar::PluginRegistrar ( FlutterDesktopPluginRegistrarRef  core_registrar)
explicit

Definition at line 19 of file plugin_registrar.cc.

20  : registrar_(registrar) {
21  auto core_messenger = FlutterDesktopPluginRegistrarGetMessenger(registrar_);
22  messenger_ = std::make_unique<BinaryMessengerImpl>(core_messenger);
23 
24  auto texture_registrar =
26  texture_registrar_ =
27  std::make_unique<TextureRegistrarImpl>(texture_registrar);
28 }
FlutterDesktopMessengerRef FlutterDesktopPluginRegistrarGetMessenger(FlutterDesktopPluginRegistrarRef registrar)
FlutterDesktopTextureRegistrarRef FlutterDesktopRegistrarGetTextureRegistrar(FlutterDesktopPluginRegistrarRef registrar)
FlutterDesktopPluginRegistrarRef registrar()
TextureRegistrar * texture_registrar()

◆ ~PluginRegistrar()

flutter::PluginRegistrar::~PluginRegistrar ( )
virtual

Definition at line 30 of file plugin_registrar.cc.

References ClearPlugins().

30  {
31  // This must always be the first call.
32  ClearPlugins();
33 
34  // Explicitly cleared to facilitate testing of destruction order.
35  messenger_.reset();
36 }

◆ PluginRegistrar() [2/2]

flutter::PluginRegistrar::PluginRegistrar ( PluginRegistrar const &  )
delete

Member Function Documentation

◆ AddPlugin()

void flutter::PluginRegistrar::AddPlugin ( std::unique_ptr< Plugin plugin)

Definition at line 38 of file plugin_registrar.cc.

Referenced by texture_registrar().

38  {
39  plugins_.insert(std::move(plugin));
40 }

◆ ClearPlugins()

void flutter::PluginRegistrar::ClearPlugins ( )
protected

◆ messenger()

BinaryMessenger* flutter::PluginRegistrar::messenger ( )
inline

Definition at line 43 of file plugin_registrar.h.

Referenced by flutter::TEST().

43 { return messenger_.get(); }

◆ operator=()

PluginRegistrar& flutter::PluginRegistrar::operator= ( PluginRegistrar const &  )
delete

◆ registrar()

◆ texture_registrar()

TextureRegistrar* flutter::PluginRegistrar::texture_registrar ( )
inline

Definition at line 47 of file plugin_registrar.h.

References AddPlugin().

Referenced by flutter::TEST().

47 { return texture_registrar_.get(); }

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