MCPcopy Create free account
hub / github.com/AGenUI/AGenUI / processNormalEvent

Method processNormalEvent

core/src/stream/agenui_streaming_content_parser.cpp:130–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128 }
129
130 void StreamingContentParser::processNormalEvent(const ProtocolStreamExtractor::ParseResult& result) {
131 if (!_coordinator) {
132 return;
133 }
134
135 AGenUIExeCode ret = Execute_Success;
136 const std::string& data = result.eventJson;
137 if (result.eventType == ProtocolStreamExtractor::EventType::CreateSurface) {
138 ret = _coordinator->createSurface(data);
139 } else if (result.eventType == ProtocolStreamExtractor::EventType::UpdateDataModel) {
140 ret = _coordinator->updateDataModel(data);
141 } else if (result.eventType == ProtocolStreamExtractor::EventType::AppendDataModel) {
142 ret = _coordinator->appendDataModel(data);
143 } else if (result.eventType == ProtocolStreamExtractor::EventType::DeleteSurface) {
144 ret = _coordinator->deleteSurface(data);
145 }
146 if (ret != Execute_Success) {
147 AGENUI_LOG("ret:%s, type:%d, data:%s", getExeCodeString(ret).c_str(), result.eventType, data.c_str());
148 }
149 }
150
151 void StreamingContentParser::sendSingleComponentUpdate(const std::string& componentJson, const std::string& surfaceId, const std::string& version) {
152 if (!_coordinator) {

Callers

nothing calls this directly

Calls 6

getExeCodeStringFunction · 0.85
c_strMethod · 0.80
createSurfaceMethod · 0.45
updateDataModelMethod · 0.45
appendDataModelMethod · 0.45
deleteSurfaceMethod · 0.45

Tested by

no test coverage detected