| 9 | #include "GFunction.h" |
| 10 | |
| 11 | CGRAPH_NAMESPACE_BEGIN |
| 12 | |
| 13 | GFunctionPtr GFunction::setFunction(const CFunctionType& type, |
| 14 | CGRAPH_CSTATUS_CONST_FUNCTION_REF func) { |
| 15 | CGRAPH_ASSERT_INIT_THROW_ERROR(false) |
| 16 | CGRAPH_ASSERT_NOT_NULL_THROW_ERROR(func) |
| 17 | |
| 18 | switch (type) { |
| 19 | case CFunctionType::INIT: init_function_ = func; break; |
| 20 | case CFunctionType::RUN: run_function_ = func; break; |
| 21 | case CFunctionType::DESTROY: destroy_function_ = func; break; |
| 22 | default: return nullptr; // 不可能出现的情况 |
| 23 | } |
| 24 | |
| 25 | return this; |
| 26 | } |
| 27 | |
| 28 | |
| 29 | GFunction::GFunction() { |
no outgoing calls
no test coverage detected