Flutter Engine
 
Loading...
Searching...
No Matches
flutter::ServiceProtocol::Handler::Description Struct Reference

#include <service_protocol.h>

Public Member Functions

 Description ()
 
 Description (int64_t p_isolate_port, std::string p_isolate_name)
 
void Write (Handler *handler, rapidjson::Value &value, rapidjson::MemoryPoolAllocator<> &allocator) const
 

Public Attributes

int64_t isolate_port = 0
 
std::string isolate_name
 

Detailed Description

Definition at line 35 of file service_protocol.h.

Constructor & Destructor Documentation

◆ Description() [1/2]

flutter::ServiceProtocol::Handler::Description::Description ( )
inline

Definition at line 39 of file service_protocol.h.

39{}

◆ Description() [2/2]

flutter::ServiceProtocol::Handler::Description::Description ( int64_t  p_isolate_port,
std::string  p_isolate_name 
)
inline

Definition at line 41 of file service_protocol.h.

42 : isolate_port(p_isolate_port),
43 isolate_name(std::move(p_isolate_name)) {}

Member Function Documentation

◆ Write()

void flutter::ServiceProtocol::Handler::Description::Write ( Handler handler,
rapidjson::Value &  value,
rapidjson::MemoryPoolAllocator<> &  allocator 
) const

Definition at line 241 of file service_protocol.cc.

244 {
245 view.SetObject();
246 view.AddMember("type", "FlutterView", allocator);
247 view.AddMember("id", CreateFlutterViewID(reinterpret_cast<intptr_t>(handler)),
248 allocator);
249 if (isolate_port != 0) {
250 rapidjson::Value isolate(rapidjson::Type::kObjectType);
251 {
252 isolate.AddMember("type", "@Isolate", allocator);
253 isolate.AddMember("fixedId", true, allocator);
254 isolate.AddMember("id", CreateIsolateID(isolate_port), allocator);
255 isolate.AddMember("name", isolate_name, allocator);
256 isolate.AddMember("number", isolate_port, allocator);
257 }
258 view.AddMember("isolate", isolate, allocator);
259 }
260}
FlView * view
const gchar FlBinaryMessengerMessageHandler handler
static std::string CreateIsolateID(int64_t isolate)
static std::string CreateFlutterViewID(intptr_t handler)

References flutter::CreateFlutterViewID(), flutter::CreateIsolateID(), handler, isolate_name, isolate_port, and view.

Member Data Documentation

◆ isolate_name

std::string flutter::ServiceProtocol::Handler::Description::isolate_name

Definition at line 37 of file service_protocol.h.

Referenced by Write().

◆ isolate_port

int64_t flutter::ServiceProtocol::Handler::Description::isolate_port = 0

Definition at line 36 of file service_protocol.h.

Referenced by Write().


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