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 36 of file service_protocol.h.

Constructor & Destructor Documentation

◆ Description() [1/2]

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

Definition at line 40 of file service_protocol.h.

40 {}

◆ Description() [2/2]

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

Definition at line 42 of file service_protocol.h.

References value, and Write().

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

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

Referenced by Description().

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

◆ isolate_port

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

Definition at line 37 of file service_protocol.h.


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