Flutter Engine
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.

References value, and Write().

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 238 of file service_protocol.cc.

References flutter::CreateFlutterViewID(), and flutter::CreateIsolateID().

Referenced by Description().

241  {
242  view.SetObject();
243  view.AddMember("type", "FlutterView", allocator);
244  view.AddMember("id", CreateFlutterViewID(reinterpret_cast<intptr_t>(handler)),
245  allocator);
246  if (isolate_port != 0) {
247  rapidjson::Value isolate(rapidjson::Type::kObjectType);
248  {
249  isolate.AddMember("type", "@Isolate", allocator);
250  isolate.AddMember("fixedId", true, allocator);
251  isolate.AddMember("id", CreateIsolateID(isolate_port), allocator);
252  isolate.AddMember("name", isolate_name, allocator);
253  isolate.AddMember("number", isolate_port, allocator);
254  }
255  view.AddMember("isolate", isolate, allocator);
256  }
257 }
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 37 of file service_protocol.h.

◆ isolate_port

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

Definition at line 36 of file service_protocol.h.


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