forked from ChunelFeng/CGraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyTemplateNode.h
More file actions
38 lines (31 loc) · 903 Bytes
/
MyTemplateNode.h
File metadata and controls
38 lines (31 loc) · 903 Bytes
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
/***************************
@Author: Chunel
@Contact: chunel@foxmail.com
@File: MyTemplateNode.h
@Time: 2021/9/18 9:52 下午
@Desc:
***************************/
#ifndef CGRAPH_MYTEMPLATENODE_H
#define CGRAPH_MYTEMPLATENODE_H
#include "CGraph.h"
template <typename ...Args>
class MyTemplateNode : public CGraph::GTemplateNode<Args ...> {
public:
// 通过两种不同的方式,实现构造函数,可以在pipeline中通过不同的方式 register 进来
explicit MyTemplateNode(int num, float score) {
num_ = num;
score_ = score;
}
explicit MyTemplateNode(int num) {
num_ = num;
score_ = 7.0f; // 默认值
}
CStatus run () override {
CGraph::CGRAPH_ECHO("[MyTemplateNode] num = [%d], score = [%f]", num_, score_);
return CStatus();
}
private:
int num_;
float score_;
};
#endif //CGRAPH_MYTEMPLATENODE_H