Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
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 37 of file service_protocol.h.

Constructor & Destructor Documentation

◆ Description() [1/2]

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

Definition at line 41 of file service_protocol.h.

41{}

◆ Description() [2/2]

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

Definition at line 43 of file service_protocol.h.

44 : isolate_port(p_isolate_port),
45 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 246 of file service_protocol.cc.

249 {
250 view.SetObject();
251 view.AddMember("type", "FlutterView", allocator);
252 view.AddMember("id", CreateFlutterViewID(reinterpret_cast<intptr_t>(handler)),
253 allocator);
254 if (isolate_port != 0) {
255 rapidjson::Value isolate(rapidjson::Type::kObjectType);
256 {
257 isolate.AddMember("type", "@Isolate", allocator);
258 isolate.AddMember("fixedId", true, allocator);
259 isolate.AddMember("id", CreateIsolateID(isolate_port), allocator);
260 isolate.AddMember("name", isolate_name, allocator);
261 isolate.AddMember("number", isolate_port, allocator);
262 }
263 view.AddMember("isolate", isolate, allocator);
264 }
265}
static std::string CreateIsolateID(int64_t isolate)
static std::string CreateFlutterViewID(intptr_t handler)

Member Data Documentation

◆ isolate_name

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

Definition at line 39 of file service_protocol.h.

◆ isolate_port

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

Definition at line 38 of file service_protocol.h.


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