Flutter Engine
 
Loading...
Searching...
No Matches
flutter::ThreadHost Struct Reference

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

#include <thread_host.h>

Classes

struct  ThreadHostConfig
 

Public Types

enum  Type {
  kPlatform = 1 << 0 ,
  kUi = 1 << 1 ,
  kRaster = 1 << 2 ,
  kIo = 1 << 3 ,
  kProfiler = 1 << 4
}
 

Public Member Functions

 ThreadHost ()
 
 ThreadHost (ThreadHost &&)
 
ThreadHostoperator= (ThreadHost &&)=default
 
 ThreadHost (const std::string &name_prefix, uint64_t mask)
 
 ThreadHost (const ThreadHostConfig &host_config)
 
 ~ThreadHost ()
 

Public Attributes

std::string name_prefix
 
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 21 of file thread_host.h.

Member Enumeration Documentation

◆ Type

Enumerator
kPlatform 
kUi 
kRaster 
kIo 
kProfiler 

Definition at line 22 of file thread_host.h.

22 {
23 kPlatform = 1 << 0,
24 kUi = 1 << 1,
25 kRaster = 1 << 2,
26 kIo = 1 << 3,
27 kProfiler = 1 << 4,
28 };

Constructor & Destructor Documentation

◆ ThreadHost() [1/4]

flutter::ThreadHost::ThreadHost ( )
default

◆ ThreadHost() [2/4]

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

◆ ThreadHost() [3/4]

flutter::ThreadHost::ThreadHost ( const std::string &  name_prefix,
uint64_t  mask 
)

Definition at line 76 of file thread_host.cc.

77 : ThreadHost(ThreadHostConfig(name_prefix, mask)) {}
std::string name_prefix
Definition thread_host.h:82

◆ ThreadHost() [4/4]

flutter::ThreadHost::ThreadHost ( const ThreadHostConfig host_config)
explicit

Definition at line 79 of file thread_host.cc.

80 : name_prefix(host_config.name_prefix) {
81 if (host_config.isThreadNeeded(ThreadHost::Type::kPlatform)) {
83 CreateThread(Type::kPlatform, host_config.platform_config, host_config);
84 }
85
86 if (host_config.isThreadNeeded(ThreadHost::Type::kUi)) {
87 ui_thread = CreateThread(Type::kUi, host_config.ui_config, host_config);
88 }
89
90 if (host_config.isThreadNeeded(ThreadHost::Type::kRaster)) {
92 CreateThread(Type::kRaster, host_config.raster_config, host_config);
93 }
94
95 if (host_config.isThreadNeeded(ThreadHost::Type::kIo)) {
96 io_thread = CreateThread(Type::kIo, host_config.io_config, host_config);
97 }
98
99 if (host_config.isThreadNeeded(ThreadHost::Type::kProfiler)) {
101 CreateThread(Type::kProfiler, host_config.profiler_config, host_config);
102 }
103}
std::unique_ptr< fml::Thread > io_thread
Definition thread_host.h:86
std::unique_ptr< fml::Thread > platform_thread
Definition thread_host.h:83
std::unique_ptr< fml::Thread > profiler_thread
Definition thread_host.h:87
std::unique_ptr< fml::Thread > raster_thread
Definition thread_host.h:85
std::unique_ptr< fml::Thread > ui_thread
Definition thread_host.h:84

References flutter::ThreadHost::ThreadHostConfig::io_config, io_thread, flutter::ThreadHost::ThreadHostConfig::isThreadNeeded(), kIo, kPlatform, kProfiler, kRaster, kUi, flutter::ThreadHost::ThreadHostConfig::platform_config, platform_thread, flutter::ThreadHost::ThreadHostConfig::profiler_config, profiler_thread, flutter::ThreadHost::ThreadHostConfig::raster_config, raster_thread, flutter::ThreadHost::ThreadHostConfig::ui_config, and ui_thread.

◆ ~ThreadHost()

flutter::ThreadHost::~ThreadHost ( )
default

Member Function Documentation

◆ operator=()

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

Member Data Documentation

◆ io_thread

◆ name_prefix

std::string flutter::ThreadHost::name_prefix

Definition at line 82 of file thread_host.h.

Referenced by flutter::testing::TEST_F().

◆ platform_thread

◆ profiler_thread

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

Definition at line 87 of file thread_host.h.

Referenced by ThreadHost().

◆ raster_thread

◆ ui_thread


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