consolidate SubscriptionRequest with BaseRequestImpl
"interface" with a single implementation. combine and de-virtualize
This commit is contained in:
@@ -493,29 +493,6 @@ public:
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* A request that expects an response multiple responses.
|
||||
* Responses identified by its I/O ID.
|
||||
* This interface needs to be extended (to provide method called on response).
|
||||
*/
|
||||
class SubscriptionRequest { /*: public ResponseRequest*/
|
||||
public:
|
||||
POINTER_DEFINITIONS(SubscriptionRequest);
|
||||
|
||||
virtual ~SubscriptionRequest() {}
|
||||
|
||||
/**
|
||||
* Update (e.g. after some time of unresponsiveness) - report current value.
|
||||
*/
|
||||
virtual void updateSubscription() = 0;
|
||||
|
||||
/**
|
||||
* Rescubscribe (e.g. when server was restarted)
|
||||
* @param transport new transport to be used.
|
||||
*/
|
||||
virtual void resubscribeSubscription(Transport::shared_pointer const & transport) = 0;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,6 @@ typedef std::map<pvAccessID, ResponseRequest::weak_pointer> IOIDResponseRequestM
|
||||
*/
|
||||
class BaseRequestImpl :
|
||||
public DataResponse,
|
||||
public SubscriptionRequest,
|
||||
public TransportSender,
|
||||
public virtual epics::pvAccess::Destroyable
|
||||
{
|
||||
@@ -375,7 +374,7 @@ public:
|
||||
// TODO notify?
|
||||
}
|
||||
|
||||
virtual void resubscribeSubscription(Transport::shared_pointer const & transport) OVERRIDE {
|
||||
virtual void resubscribeSubscription(Transport::shared_pointer const & transport) {
|
||||
if (transport.get() != 0 && !m_subscribed.get() && startRequest(QOS_INIT))
|
||||
{
|
||||
m_subscribed.set();
|
||||
@@ -383,9 +382,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void updateSubscription() OVERRIDE FINAL {
|
||||
// default is noop
|
||||
}
|
||||
void updateSubscription() {}
|
||||
|
||||
virtual void send(ByteBuffer* buffer, TransportSendControl* control) OVERRIDE {
|
||||
int8 qos = getPendingRequest();
|
||||
@@ -3947,7 +3944,7 @@ public:
|
||||
ResponseRequest::shared_pointer ptr = iter->second.lock();
|
||||
if (ptr)
|
||||
{
|
||||
SubscriptionRequest::shared_pointer rrs = dynamic_pointer_cast<SubscriptionRequest>(ptr);
|
||||
BaseRequestImpl::shared_pointer rrs = dynamic_pointer_cast<BaseRequestImpl>(ptr);
|
||||
if (rrs)
|
||||
EXCEPTION_GUARD(rrs->updateSubscription());
|
||||
}
|
||||
@@ -4881,7 +4878,7 @@ void InternalClientContextImpl::InternalChannelImpl::resubscribeSubscriptions()
|
||||
ResponseRequest::shared_pointer ptr = iter->second.lock();
|
||||
if (ptr)
|
||||
{
|
||||
SubscriptionRequest::shared_pointer rrs = dynamic_pointer_cast<SubscriptionRequest>(ptr);
|
||||
BaseRequestImpl::shared_pointer rrs = dynamic_pointer_cast<BaseRequestImpl>(ptr);
|
||||
if (rrs)
|
||||
EXCEPTION_GUARD(rrs->resubscribeSubscription(transport));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user