SDK::DDSSession: remove channel id to task id association

This commit is contained in:
Alexey Rybalchenko
2020-02-13 12:51:10 +01:00
committed by Dennis Klein
parent 3785fd9ff9
commit 0e72a9bf54
7 changed files with 19 additions and 27 deletions

View File

@@ -135,8 +135,6 @@ struct DDSSession::Impl
dds::intercom_api::CCustomCmd fDDSCustomCmd;
Id fId;
bool fStopOnDestruction;
mutable std::mutex fMtx;
std::unordered_map<DDSChannel::Id, DDSTask::Id> fTaskIdByChannelIdMap;
};
DDSSession::DDSSession(DDSEnvironment env)
@@ -362,18 +360,6 @@ void DDSSession::SendCommand(const std::string& cmd, DDSChannel::Id recipient)
fImpl->fDDSCustomCmd.send(cmd, std::to_string(recipient));
}
auto DDSSession::UpdateChannelToTaskAssociation(DDSChannel::Id channelId, DDSTask::Id taskId) -> void
{
std::lock_guard<std::mutex> lk(fImpl->fMtx);
fImpl->fTaskIdByChannelIdMap[channelId] = taskId;
}
auto DDSSession::GetTaskId(DDSChannel::Id channelId) const -> DDSTask::Id
{
std::lock_guard<std::mutex> lk(fImpl->fMtx);
return fImpl->fTaskIdByChannelIdMap.at(channelId);
}
auto operator<<(std::ostream& os, const DDSSession& session) -> std::ostream&
{
return os << "$DDS_SESSION_ID: " << session.GetId();