Flutter Windows Embedder
flutter::PluginRegistrar Class Reference

#include <plugin_registrar.h>

Inheritance diagram for flutter::PluginRegistrar:
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 }

◆ ~PluginRegistrar()

flutter::PluginRegistrar::~PluginRegistrar ( )
virtual

Definition at line 30 of file plugin_registrar.cc.

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 }

References ClearPlugins().

◆ 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.

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

Referenced by flutter::TEST().

◆ ClearPlugins()

void flutter::PluginRegistrar::ClearPlugins ( )
protected

Definition at line 42 of file plugin_registrar.cc.

42  {
43  plugins_.clear();
44 }

Referenced by ~PluginRegistrar(), and flutter::PluginRegistrarWindows::~PluginRegistrarWindows().

◆ messenger()

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

Definition at line 43 of file plugin_registrar.h.

43 { return messenger_.get(); }

Referenced by flutter::TEST().

◆ operator=()

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

◆ registrar()

FlutterDesktopPluginRegistrarRef flutter::PluginRegistrar::registrar ( )
inlineprotected

◆ texture_registrar()

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

Definition at line 47 of file plugin_registrar.h.

47 { return texture_registrar_.get(); }

Referenced by flutter::TEST().


The documentation for this class was generated from the following files:
flutter::PluginRegistrar::registrar
FlutterDesktopPluginRegistrarRef registrar()
Definition: plugin_registrar.h:57
FlutterDesktopPluginRegistrarGetMessenger
FlutterDesktopMessengerRef FlutterDesktopPluginRegistrarGetMessenger(FlutterDesktopPluginRegistrarRef registrar)
Definition: flutter_windows.cc:290
flutter::PluginRegistrar::ClearPlugins
void ClearPlugins()
Definition: plugin_registrar.cc:42
flutter::PluginRegistrar::texture_registrar
TextureRegistrar * texture_registrar()
Definition: plugin_registrar.h:47
FlutterDesktopRegistrarGetTextureRegistrar
FlutterDesktopTextureRegistrarRef FlutterDesktopRegistrarGetTextureRegistrar(FlutterDesktopPluginRegistrarRef registrar)
Definition: flutter_windows.cc:375