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

Class MyShowAddressNode

tutorial/MyGNode/MyShowAddressNode.h:15–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#include "../MyParams/MyParam.h"
14
15class MyShowAddressNode : public CGraph::GNode {
16public:
17 CStatus init() override {
18 CStatus status = CGRAPH_CREATE_GPARAM(MyParam, "param2")
19 return status;
20 }
21
22 CStatus run() override {
23 auto myParam = CGRAPH_GET_GPARAM(MyParam, "param2")
24 if (nullptr == myParam) {
25 return CStatus("get param2 failed");
26 }
27
28 int cnt = 0;
29 {
30 CGRAPH_PARAM_WRITE_CODE_BLOCK(myParam)
31 cnt = ++myParam->iCount;
32 }
33
34 CGraph::CGRAPH_ECHO("singleton node run, name is [%s], this address is [0x%x], cnt is [%d].",
35 this->getName().c_str(), (unsigned int*)this, cnt);
36 return CStatus();
37 }
38};
39
40#endif //CGRAPH_MYSHOWADDRESSNODE_H

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected