| 110 | } |
| 111 | |
| 112 | comm::RetCode LockConfig::GetLockByLockID(const int lock_id, shared_ptr<const proto::Lock> &lock) const { |
| 113 | auto it(impl_->lock_id2lock.find(lock_id)); |
| 114 | if (it == impl_->lock_id2lock.end()) return comm::RetCode::RET_ERR_RANGE_LOCK; |
| 115 | lock = it->second; |
| 116 | return comm::RetCode::RET_OK; |
| 117 | } |
| 118 | |
| 119 | comm::RetCode LockConfig::GetLockIDByAddr(const comm::proto::Addr &addr, int &lock_id) const { |
| 120 | auto &&encoded_addr = comm::utils::EncodeAddr(addr); |
no outgoing calls