Flutter Engine
flutter::ThreadHost Struct Reference

The collection of all the threads used by the engine. More...

#include <thread_host.h>

Public Types

enum  Type {
  Platform = 1 << 0,
  UI = 1 << 1,
  GPU = 1 << 2,
  IO = 1 << 3,
  Profiler = 1 << 4
}
 

Public Member Functions

 ThreadHost ()
 
 ThreadHost (ThreadHost &&)
 
ThreadHostoperator= (ThreadHost &&)=default
 
 ThreadHost (std::string name_prefix, uint64_t type_mask)
 
 ~ThreadHost ()
 
void Reset ()
 

Public Attributes

std::unique_ptr< fml::Threadplatform_thread
 
std::unique_ptr< fml::Threadui_thread
 
std::unique_ptr< fml::Threadraster_thread
 
std::unique_ptr< fml::Threadio_thread
 
std::unique_ptr< fml::Threadprofiler_thread
 

Detailed Description

The collection of all the threads used by the engine.

Definition at line 16 of file thread_host.h.

Member Enumeration Documentation

◆ Type

Enumerator
Platform 
UI 
GPU 
IO 
Profiler 

Definition at line 17 of file thread_host.h.

17  {
18  Platform = 1 << 0,
19  UI = 1 << 1,
20  GPU = 1 << 2,
21  IO = 1 << 3,
22  Profiler = 1 << 4,
23  };

Constructor & Destructor Documentation

◆ ThreadHost() [1/3]

flutter::ThreadHost::ThreadHost ( )
default

◆ ThreadHost() [2/3]

flutter::ThreadHost::ThreadHost ( ThreadHost &&  )
default

◆ ThreadHost() [3/3]

flutter::ThreadHost::ThreadHost ( std::string  name_prefix,
uint64_t  type_mask 
)

Definition at line 13 of file thread_host.cc.

References io_thread, platform_thread, profiler_thread, raster_thread, ui_thread, and ~ThreadHost().

13  {
14  if (mask & ThreadHost::Type::Platform) {
15  platform_thread = std::make_unique<fml::Thread>(name_prefix + ".platform");
16  }
17 
18  if (mask & ThreadHost::Type::UI) {
19  ui_thread = std::make_unique<fml::Thread>(name_prefix + ".ui");
20  }
21 
22  if (mask & ThreadHost::Type::GPU) {
23  raster_thread = std::make_unique<fml::Thread>(name_prefix + ".raster");
24  }
25 
26  if (mask & ThreadHost::Type::IO) {
27  io_thread = std::make_unique<fml::Thread>(name_prefix + ".io");
28  }
29 
30  if (mask & ThreadHost::Type::Profiler) {
31  profiler_thread = std::make_unique<fml::Thread>(name_prefix + ".profiler");
32  }
33 }
std::unique_ptr< fml::Thread > ui_thread
Definition: thread_host.h:26
std::unique_ptr< fml::Thread > profiler_thread
Definition: thread_host.h:29
std::unique_ptr< fml::Thread > io_thread
Definition: thread_host.h:28
std::unique_ptr< fml::Thread > raster_thread
Definition: thread_host.h:27
std::unique_ptr< fml::Thread > platform_thread
Definition: thread_host.h:25

◆ ~ThreadHost()

flutter::ThreadHost::~ThreadHost ( )
default

Referenced by ThreadHost().

Member Function Documentation

◆ operator=()

ThreadHost& flutter::ThreadHost::operator= ( ThreadHost &&  )
default

◆ Reset()

void flutter::ThreadHost::Reset ( )

Definition at line 37 of file thread_host.cc.

References io_thread, platform_thread, profiler_thread, raster_thread, and ui_thread.

Referenced by FlutterEngine::destroyContext, and flutter::AndroidShellHolder::~AndroidShellHolder().

37  {
38  platform_thread.reset();
39  ui_thread.reset();
40  raster_thread.reset();
41  io_thread.reset();
42  profiler_thread.reset();
43 }
std::unique_ptr< fml::Thread > ui_thread
Definition: thread_host.h:26
std::unique_ptr< fml::Thread > profiler_thread
Definition: thread_host.h:29
std::unique_ptr< fml::Thread > io_thread
Definition: thread_host.h:28
std::unique_ptr< fml::Thread > raster_thread
Definition: thread_host.h:27
std::unique_ptr< fml::Thread > platform_thread
Definition: thread_host.h:25

Member Data Documentation

◆ io_thread

◆ platform_thread

◆ profiler_thread

std::unique_ptr<fml::Thread> flutter::ThreadHost::profiler_thread

Definition at line 29 of file thread_host.h.

Referenced by FlutterEngine::destroyContext, Reset(), and ThreadHost().

◆ raster_thread

◆ ui_thread


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