| 108 | } |
| 109 | |
| 110 | bool lite::register_parse_info_func( |
| 111 | std::string info_type, const ParseInfoFunc& parse_func) { |
| 112 | LITE_LOCK_GUARD(parse_info_static_data().map_mutex); |
| 113 | auto& global_map = parse_info_static_data().parse_info_methods; |
| 114 | if (global_map.find(info_type) != global_map.end()) { |
| 115 | LITE_THROW(ssprintf( |
| 116 | "The parse info method %s is already registered.", info_type.c_str())); |
| 117 | return false; |
| 118 | } else { |
| 119 | global_map[info_type] = parse_func; |
| 120 | LITE_LOG("Registered infomation parser method %s.", info_type.c_str()); |
| 121 | return true; |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | #if LITE_BUILD_WITH_MGE |
| 126 | |