Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
FlutterDesktopMessenger Struct Reference

Public Member Functions

 FlutterDesktopMessenger ()=default
 
void AddRef ()
 
void Release ()
 
FlutterDesktopEngineStateGetEngine () const
 Getter for the engine field. More...
 
void SetEngine (FlutterDesktopEngineState *engine)
 
std::mutex & GetMutex ()
 
 FlutterDesktopMessenger (const FlutterDesktopMessenger &value)=delete
 
FlutterDesktopMessengeroperator= (const FlutterDesktopMessenger &value)=delete
 

Detailed Description

Definition at line 158 of file flutter_glfw.cc.

Constructor & Destructor Documentation

◆ FlutterDesktopMessenger() [1/2]

FlutterDesktopMessenger::FlutterDesktopMessenger ( )
default

◆ FlutterDesktopMessenger() [2/2]

FlutterDesktopMessenger::FlutterDesktopMessenger ( const FlutterDesktopMessenger value)
delete

Member Function Documentation

◆ AddRef()

void FlutterDesktopMessenger::AddRef ( )
inline

Increments the reference count.

Thread-safe.

Definition at line 164 of file flutter_glfw.cc.

164{ ref_count_.fetch_add(1); }

◆ GetEngine()

FlutterDesktopEngineState * FlutterDesktopMessenger::GetEngine ( ) const
inline

Getter for the engine field.

Definition at line 178 of file flutter_glfw.cc.

178{ return engine_; }

◆ GetMutex()

std::mutex & FlutterDesktopMessenger::GetMutex ( )
inline

Returns the mutex associated with the |FlutterDesktopMessenger|.

This mutex is used to synchronize reading or writing state inside the |FlutterDesktopMessenger| (ie |engine_|).

Definition at line 191 of file flutter_glfw.cc.

191{ return mutex_; }

◆ operator=()

FlutterDesktopMessenger & FlutterDesktopMessenger::operator= ( const FlutterDesktopMessenger value)
delete

◆ Release()

void FlutterDesktopMessenger::Release ( )
inline

Decrements the reference count and deletes the object if the count has gone to zero.

Thread-safe.

Definition at line 170 of file flutter_glfw.cc.

170 {
171 int32_t old_count = ref_count_.fetch_sub(1);
172 if (old_count <= 1) {
173 delete this;
174 }
175 }

◆ SetEngine()

void FlutterDesktopMessenger::SetEngine ( FlutterDesktopEngineState engine)
inline

Setter for the engine field. Thread-safe.

Definition at line 182 of file flutter_glfw.cc.

182 {
183 std::scoped_lock lock(mutex_);
184 engine_ = engine;
185 }
FlutterEngine engine
Definition: main.cc:68

The documentation for this struct was generated from the following file: