void PvaClientChannelCache::addChannel(PvaClientChannelPtr const & pvaClientChannel) { Channel::shared_pointer channel = pvaClientChannel->getChannel(); string name = channel->getChannelName() + channel->getProvider()->getProviderName(); pvaClientChannelMap.insert(std::pair<string,PvaClientChannelPtr>( name,pvaClientChannel)); }
void PvaClientChannelCache::addChannel(PvaClientChannelPtr const & pvaClientChannel) { Channel::shared_pointer channel = pvaClientChannel->getChannel(); string name = channel->getChannelName() + channel->getProvider()->getProviderName(); map<string,PvaClientChannelPtr>::iterator iter = pvaClientChannelMap.find(name); if(iter!=pvaClientChannelMap.end()) { throw std::runtime_error("pvaClientChannelCache::addChannel channel already cached"); } pvaClientChannelMap.insert(std::pair<string,PvaClientChannelPtr>( name,pvaClientChannel)); }
void PvaClientChannelCache::showCache() { map<string,PvaClientChannelPtr>::iterator iter; for(iter = pvaClientChannelMap.begin(); iter != pvaClientChannelMap.end(); ++iter) { PvaClientChannelPtr pvaChannel = iter->second; Channel::shared_pointer channel = pvaChannel->getChannel(); string channelName = channel->getChannelName(); string providerName = channel->getProvider()->getProviderName(); cout << "channel " << channelName << " provider " << providerName << endl; pvaChannel->showCache(); } }