* 必须实现 clone 函数 * GAspectParam 和 GDaemonParam 均为 GPassedParam的同名内容 * 继承自GPassedParam的参数,可以用于在 aspect 或 daemon 之间传递 * 本例中,MyConnParam既用于GAspectParam(T10)传递,有用于GDaemonParam(T13)传递 * 故写法为 `: public CGraph::GPassedParam` * @param param */
| 23 | * @param param |
| 24 | */ |
| 25 | CVoid clone(CGraph::GPassedParamPtr param) override { |
| 26 | if (nullptr == param) { |
| 27 | return; // 异常判断,理论不可能出现此情况 |
| 28 | } |
| 29 | |
| 30 | auto* ptr = dynamic_cast<MyConnParam *>(param); // 将传入的参数进行强转,并且赋值到本地 |
| 31 | ip_ = ptr->ip_; |
| 32 | port_ = ptr->port_; |
| 33 | } |
| 34 | |
| 35 | std::string ip_ {"0.0.0.0" }; |
| 36 | short port_ { 0 }; |
nothing calls this directly
no outgoing calls
no test coverage detected