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 ()
 
void AddPlugin (std::unique_ptr< Plugin > plugin)
 

Protected Member Functions

FlutterDesktopPluginRegistrarRef registrar ()
 
void ClearPlugins ()
 

Detailed Description

Definition at line 26 of file plugin_registrar.h.

Constructor & Destructor Documentation

◆ PluginRegistrar() [1/2]

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

Definition at line 18 of file plugin_registrar.cc.

19  : registrar_(registrar) {
20  auto core_messenger = FlutterDesktopPluginRegistrarGetMessenger(registrar_);
21  messenger_ = std::make_unique<BinaryMessengerImpl>(core_messenger);
22 }
FlutterDesktopMessengerRef FlutterDesktopPluginRegistrarGetMessenger(FlutterDesktopPluginRegistrarRef registrar)
FlutterDesktopPluginRegistrarRef registrar()

◆ ~PluginRegistrar()

flutter::PluginRegistrar::~PluginRegistrar ( )
virtual

Definition at line 24 of file plugin_registrar.cc.

References ClearPlugins().

24  {
25  // This must always be the first call.
26  ClearPlugins();
27 
28  // Explicitly cleared to facilitate testing of destruction order.
29  messenger_.reset();
30 }

◆ 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 32 of file plugin_registrar.cc.

Referenced by messenger().

32  {
33  plugins_.insert(std::move(plugin));
34 }

◆ ClearPlugins()

void flutter::PluginRegistrar::ClearPlugins ( )
protected

◆ messenger()

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

Definition at line 42 of file plugin_registrar.h.

References AddPlugin().

Referenced by flutter::TEST().

42 { return messenger_.get(); }

◆ operator=()

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

◆ registrar()


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