| 113 | |
| 114 | |
| 115 | CStatus GElementRepository::init() { |
| 116 | CGRAPH_FUNCTION_BEGIN |
| 117 | async_elements_.clear(); // 每次记得清空这里。因为每次init之后,都可能不一样 |
| 118 | for (auto& element : elements_) { |
| 119 | /** |
| 120 | * 1. 查验element是否为空 |
| 121 | * 2. 查验配置信息是否正确 |
| 122 | * 3. 记录异步节点的信息 |
| 123 | */ |
| 124 | CGRAPH_ASSERT_NOT_NULL(element, element->thread_pool_) |
| 125 | status = element->checkSuitable(); |
| 126 | CGRAPH_FUNCTION_CHECK_STATUS |
| 127 | element->updateAspectInfo(); |
| 128 | |
| 129 | if (element->isAsync()) { |
| 130 | async_elements_.emplace(element); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | // 每次初始化之后,所有的状态,都可以恢复了 |
| 135 | status = pushAllState(GElementState::NORMAL); |
| 136 | CGRAPH_FUNCTION_END |
| 137 | } |
| 138 | |
| 139 | |
| 140 | CStatus GElementRepository::destroy() { |
nothing calls this directly
no test coverage detected