| 323 | |
| 324 | |
| 325 | CStatus GPipeline::save(const std::string& path) { |
| 326 | CGRAPH_FUNCTION_BEGIN |
| 327 | CGRAPH_ASSERT_INIT(false) |
| 328 | |
| 329 | // 不允许有同名的 element 被存储 |
| 330 | for (const auto* element : repository_.elements_) { |
| 331 | CGRAPH_ASSERT_NOT_NULL(element) |
| 332 | CGRAPH_RETURN_ERROR_STATUS_BY_CONDITION(element->isGAdaptor(), |
| 333 | element->name_ + " is GAdaptor, cannot be saved.") |
| 334 | } |
| 335 | |
| 336 | #if __cplusplus >= 201703L |
| 337 | status = GStorage::save(this, path); |
| 338 | #else |
| 339 | status = CStatus("save function support cpp17+ only"); |
| 340 | #endif |
| 341 | CGRAPH_FUNCTION_END |
| 342 | } |
| 343 | |
| 344 | |
| 345 | CStatus GPipeline::load(const std::string& path) { |
no test coverage detected