MCPcopy Create free account
hub / github.com/ChunelFeng/CGraph / run

Method run

tutorial/MyGNode/MySubMessageNode.h:28–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26 }
27
28 CStatus run() override {
29 std::shared_ptr<MyMessageParam> mp = nullptr; // 通过智能指针类型,接收一个消息。相比value接收(Recv or Sub),性能会好一些
30 CStatus status = CGRAPH_SUB_MPARAM(MyMessageParam, conn_id_, mp)
31 if (!status.isOK()) {
32 CGraph::CGRAPH_ECHO("[%s] recv message error", this->getName().c_str());
33 return status;
34 }
35
36 CGraph::CGRAPH_ECHO("[%s] conn id = [%d], num = [%d], info = [%s]",
37 this->getName().c_str(), conn_id_, mp->num, mp->info.c_str());
38 return status;
39 }
40
41private:
42 CIndex conn_id_;

Callers

nothing calls this directly

Calls 2

CGRAPH_ECHOFunction · 0.85
isOKMethod · 0.80

Tested by

no test coverage detected