| 133 | } |
| 134 | |
| 135 | comm::RetCode GlobalConfig::GetTopicConfigByTopicID(const int topic_id, shared_ptr<const TopicConfig> &topic_config) { |
| 136 | topic_config = nullptr; |
| 137 | |
| 138 | auto it = impl_->topic_id2topic_config.find(topic_id); |
| 139 | if (it == impl_->topic_id2topic_config.end()) { |
| 140 | NeedRebuild(); |
| 141 | return comm::RetCode::RET_ERR_RANGE_TOPIC; |
| 142 | } |
| 143 | if (!it->second) return comm::RetCode::RET_ERR_RANGE_TOPIC; |
| 144 | it->second->Load(); |
| 145 | topic_config = it->second; |
| 146 | return comm::RetCode::RET_OK; |
| 147 | } |
| 148 | |
| 149 | |
| 150 | comm::RetCode GlobalConfig::GetAllTopicConfig(vector<shared_ptr<const TopicConfig> > &topic_configs) const { |