Flutter Engine
The Flutter Engine
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
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}
@ kRaster
Suitable for thread which raster data.
Definition: embedder.h:266
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

◆ ~ThreadHost()

flutter::ThreadHost::~ThreadHost ( )
default

Member Function Documentation

◆ operator=()

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

Member Data Documentation

◆ io_thread

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

Definition at line 86 of file thread_host.h.

◆ name_prefix

std::string flutter::ThreadHost::name_prefix

Definition at line 82 of file thread_host.h.

◆ platform_thread

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

Definition at line 83 of file thread_host.h.

◆ profiler_thread

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

Definition at line 87 of file thread_host.h.

◆ raster_thread

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

Definition at line 85 of file thread_host.h.

◆ ui_thread

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

Definition at line 84 of file thread_host.h.


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