PipelineMonitor -> Monitor
collapse PipelineMonitor into Monitor no-op virtual call is probably less work than dynamic_cast.
This commit is contained in:
@@ -93,6 +93,12 @@ class epicsShareClass Monitor : public virtual epics::pvData::Destroyable{
|
||||
virtual void getStats(Stats& s) const {
|
||||
s.nfilled = s.noutstanding = s.nempty = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Report remote queue status.
|
||||
* @param freeElements number of free elements.
|
||||
*/
|
||||
virtual void reportRemoteQueueStatus(epics::pvData::int32 freeElements) {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1383,17 +1383,7 @@ epicsShareFunc void unregisterAllChannelProviderFactory() EPICS_DEPRECATED;
|
||||
* @brief Pipeline (streaming) support API (optional).
|
||||
* This is used by pvAccess to implement pipeline (streaming) monitors.
|
||||
*/
|
||||
class epicsShareClass PipelineMonitor : public virtual Monitor {
|
||||
public:
|
||||
POINTER_DEFINITIONS(PipelineMonitor);
|
||||
virtual ~PipelineMonitor() {}
|
||||
|
||||
/**
|
||||
* Report remote queue status.
|
||||
* @param freeElements number of free elements.
|
||||
*/
|
||||
virtual void reportRemoteQueueStatus(epics::pvData::int32 freeElements) = 0;
|
||||
};
|
||||
typedef Monitor PipelineMonitor;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1882,10 +1882,7 @@ void ServerMonitorHandler::handleResponse(osiSockAddr* responseFrom,
|
||||
int32 nfree = payloadBuffer->getInt();
|
||||
ServerMonitorRequesterImpl::shared_pointer request = static_pointer_cast<ServerMonitorRequesterImpl>(channel->getRequest(ioid));
|
||||
|
||||
Monitor::shared_pointer mp = request->getChannelMonitor();
|
||||
PipelineMonitor* pmp = dynamic_cast<PipelineMonitor*>(mp.get());
|
||||
if (pmp)
|
||||
pmp->reportRemoteQueueStatus(nfree);
|
||||
request->getChannelMonitor()->reportRemoteQueueStatus(nfree);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1907,10 +1904,7 @@ void ServerMonitorHandler::handleResponse(osiSockAddr* responseFrom,
|
||||
{
|
||||
transport->ensureData(4);
|
||||
int32 nfree = payloadBuffer->getInt();
|
||||
Monitor::shared_pointer mp = request->getChannelMonitor();
|
||||
PipelineMonitor* pmp = dynamic_cast<PipelineMonitor*>(mp.get());
|
||||
if (pmp)
|
||||
pmp->reportRemoteQueueStatus(nfree);
|
||||
request->getChannelMonitor()->reportRemoteQueueStatus(nfree);
|
||||
return;
|
||||
// note: not possible to ack and destroy
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user