Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
flutter::ThreadHost::ThreadHostConfig Struct Reference

#include <thread_host.h>

Public Member Functions

 ThreadHostConfig (const ThreadConfigSetter &setter=fml::Thread::SetCurrentThreadName)
 
 ThreadHostConfig (const std::string &name_prefix, uint64_t mask, const ThreadConfigSetter &setter=fml::Thread::SetCurrentThreadName)
 
 ThreadHostConfig (uint64_t mask, const ThreadConfigSetter &setter=fml::Thread::SetCurrentThreadName)
 
bool isThreadNeeded (Type type) const
 Check if need to create thread.
 
void SetUIConfig (const ThreadConfig &)
 Specified the UI Thread Config, meanwhile set the mask.
 
void SetPlatformConfig (const ThreadConfig &)
 Specified the Platform Thread Config, meanwhile set the mask.
 
void SetRasterConfig (const ThreadConfig &)
 Specified the IO Thread Config, meanwhile set the mask.
 
void SetIOConfig (const ThreadConfig &)
 Specified the IO Thread Config, meanwhile set the mask.
 
void SetProfilerConfig (const ThreadConfig &)
 Specified the ProfilerThread Config, meanwhile set the mask.
 

Static Public Member Functions

static std::string MakeThreadName (Type type, const std::string &prefix)
 Use the prefix and thread type to generator a thread name.
 

Public Attributes

uint64_t type_mask
 
std::string name_prefix = ""
 
const ThreadConfigSetter config_setter
 
std::optional< ThreadConfigplatform_config
 
std::optional< ThreadConfigui_config
 
std::optional< ThreadConfigraster_config
 
std::optional< ThreadConfigio_config
 
std::optional< ThreadConfigprofiler_config
 

Detailed Description

The collection of all the thread configures, and we create custom thread configure in engine to info the thread.

Definition at line 32 of file thread_host.h.

Constructor & Destructor Documentation

◆ ThreadHostConfig() [1/3]

flutter::ThreadHost::ThreadHostConfig::ThreadHostConfig ( const ThreadConfigSetter setter = fml::Thread::SetCurrentThreadName)
inlineexplicit

Definition at line 33 of file thread_host.h.

35 : type_mask(0), config_setter(setter) {}
const ThreadConfigSetter config_setter
Definition thread_host.h:73

◆ ThreadHostConfig() [2/3]

flutter::ThreadHost::ThreadHostConfig::ThreadHostConfig ( const std::string &  name_prefix,
uint64_t  mask,
const ThreadConfigSetter setter = fml::Thread::SetCurrentThreadName 
)
inline

Definition at line 37 of file thread_host.h.

◆ ThreadHostConfig() [3/3]

flutter::ThreadHost::ThreadHostConfig::ThreadHostConfig ( uint64_t  mask,
const ThreadConfigSetter setter = fml::Thread::SetCurrentThreadName 
)
inlineexplicit

Definition at line 43 of file thread_host.h.

46 : ThreadHostConfig("", mask, setter) {}
ThreadHostConfig(const ThreadConfigSetter &setter=fml::Thread::SetCurrentThreadName)
Definition thread_host.h:33

Member Function Documentation

◆ isThreadNeeded()

bool flutter::ThreadHost::ThreadHostConfig::isThreadNeeded ( Type  type) const
inline

Check if need to create thread.

Definition at line 49 of file thread_host.h.

49{ return type_mask & type; }

◆ MakeThreadName()

std::string flutter::ThreadHost::ThreadHostConfig::MakeThreadName ( Type  type,
const std::string &  prefix 
)
static

Use the prefix and thread type to generator a thread name.

Definition at line 15 of file thread_host.cc.

17 {
18 switch (type) {
19 case Type::kPlatform:
20 return prefix + ".platform";
21 case Type::kUi:
22 return prefix + ".ui";
23 case Type::kIo:
24 return prefix + ".io";
25 case Type::kRaster:
26 return prefix + ".raster";
27 case Type::kProfiler:
28 return prefix + ".profiler";
29 }
30}

◆ SetIOConfig()

void flutter::ThreadHost::ThreadHostConfig::SetIOConfig ( const ThreadConfig config)

Specified the IO Thread Config, meanwhile set the mask.

Definition at line 32 of file thread_host.cc.

32 {
34 io_config = config;
35}
std::optional< ThreadConfig > io_config
Definition thread_host.h:78

◆ SetPlatformConfig()

void flutter::ThreadHost::ThreadHostConfig::SetPlatformConfig ( const ThreadConfig config)

Specified the Platform Thread Config, meanwhile set the mask.

Definition at line 42 of file thread_host.cc.

43 {
45 platform_config = config;
46}
std::optional< ThreadConfig > platform_config
Definition thread_host.h:75

◆ SetProfilerConfig()

void flutter::ThreadHost::ThreadHostConfig::SetProfilerConfig ( const ThreadConfig config)

Specified the ProfilerThread Config, meanwhile set the mask.

Definition at line 53 of file thread_host.cc.

54 {
56 profiler_config = config;
57}
std::optional< ThreadConfig > profiler_config
Definition thread_host.h:79

◆ SetRasterConfig()

void flutter::ThreadHost::ThreadHostConfig::SetRasterConfig ( const ThreadConfig config)

Specified the IO Thread Config, meanwhile set the mask.

Definition at line 48 of file thread_host.cc.

48 {
50 raster_config = config;
51}
std::optional< ThreadConfig > raster_config
Definition thread_host.h:77

◆ SetUIConfig()

void flutter::ThreadHost::ThreadHostConfig::SetUIConfig ( const ThreadConfig config)

Specified the UI Thread Config, meanwhile set the mask.

Definition at line 37 of file thread_host.cc.

37 {
39 ui_config = config;
40}
std::optional< ThreadConfig > ui_config
Definition thread_host.h:76

Member Data Documentation

◆ config_setter

const ThreadConfigSetter flutter::ThreadHost::ThreadHostConfig::config_setter

Definition at line 73 of file thread_host.h.

◆ io_config

std::optional<ThreadConfig> flutter::ThreadHost::ThreadHostConfig::io_config

Definition at line 78 of file thread_host.h.

◆ name_prefix

std::string flutter::ThreadHost::ThreadHostConfig::name_prefix = ""

Definition at line 71 of file thread_host.h.

◆ platform_config

std::optional<ThreadConfig> flutter::ThreadHost::ThreadHostConfig::platform_config

Definition at line 75 of file thread_host.h.

◆ profiler_config

std::optional<ThreadConfig> flutter::ThreadHost::ThreadHostConfig::profiler_config

Definition at line 79 of file thread_host.h.

◆ raster_config

std::optional<ThreadConfig> flutter::ThreadHost::ThreadHostConfig::raster_config

Definition at line 77 of file thread_host.h.

◆ type_mask

uint64_t flutter::ThreadHost::ThreadHostConfig::type_mask

Definition at line 69 of file thread_host.h.

◆ ui_config

std::optional<ThreadConfig> flutter::ThreadHost::ThreadHostConfig::ui_config

Definition at line 76 of file thread_host.h.


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