forked from ChunelFeng/CGraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyShowAddressNode.h
More file actions
40 lines (33 loc) · 1.02 KB
/
MyShowAddressNode.h
File metadata and controls
40 lines (33 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/***************************
@Author: Chunel
@Contact: chunel@foxmail.com
@File: MyShowAddressNode.h
@Time: 2021/10/31 12:50 上午
@Desc:
***************************/
#ifndef CGRAPH_MYSHOWADDRESSNODE_H
#define CGRAPH_MYSHOWADDRESSNODE_H
#include "CGraph.h"
#include "../MyParams/MyParam.h"
class MyShowAddressNode : public CGraph::GNode {
public:
CStatus init() override {
CStatus status = CGRAPH_CREATE_GPARAM(MyParam, "param2")
return status;
}
CStatus run() override {
auto myParam = CGRAPH_GET_GPARAM(MyParam, "param2")
if (nullptr == myParam) {
return CStatus("get param2 failed");
}
int cnt = 0;
{
CGRAPH_PARAM_WRITE_CODE_BLOCK(myParam)
cnt = ++myParam->iCount;
}
CGraph::CGRAPH_ECHO("singleton node run, name is [%s], this address is [0x%x], cnt is [%d].",
this->getName().c_str(), (unsigned int*)this, cnt);
return CStatus();
}
};
#endif //CGRAPH_MYSHOWADDRESSNODE_H