added stateChangeRequester; improve semantics for unlisten and channelStateChange

This commit is contained in:
mrkraimer
2016-06-24 15:03:19 -04:00
parent 5398d67e2a
commit fac07c7f3a
3 changed files with 60 additions and 3 deletions

View File

@@ -219,9 +219,18 @@ void PvaClientMonitor::monitorEvent(MonitorPtr const & monitor)
void PvaClientMonitor::unlisten(MonitorPtr const & monitor)
{
if(PvaClient::getDebug()) cout << "PvaClientMonitor::unlisten\n";
throw std::runtime_error("pvaClientMonitor::unlisten called but do not know what to do");
PvaClientMonitorRequesterPtr req = pvaClientMonitorRequester.lock();
if(req) {
req->unlisten();
return;
}
string channelName("disconnected");
Channel::shared_pointer chan(channel.lock());
if(chan) channelName = chan->getChannelName();
cerr << channelName + "pvaClientMonitor::unlisten called but no PvaClientMonitorRequester\n";
}
void PvaClientMonitor::connect()
{
if(PvaClient::getDebug()) cout << "PvaClientMonitor::connect\n";