add dummy ChannelFind implementation.

Since this class is not really used...
This commit is contained in:
Michael Davidsaver
2018-06-06 09:32:01 -07:00
parent 656e2fcfd4
commit a413f8f9db
2 changed files with 27 additions and 1 deletions

View File

@@ -385,6 +385,10 @@ public:
virtual std::tr1::shared_ptr<ChannelProvider> getChannelProvider() = 0;
virtual void cancel() = 0;
//! Allocate a no-op ChannelFind. This is sufficient for most, if not all, ChannelProvider implementations.
//! Holds only a weak_ptr<ChannelProvider>
static ChannelFind::shared_pointer buildDummy(const std::tr1::shared_ptr<ChannelProvider>& provider);
};
/**

View File

@@ -430,7 +430,6 @@ ChannelRequester::shared_pointer DefaultChannelRequester::build()
return ret;
}
MonitorElement::MonitorElement(epics::pvData::PVStructurePtr const & pvStructurePtr)
: pvStructurePtr(pvStructurePtr)
,changedBitSet(epics::pvData::BitSet::create(static_cast<epics::pvData::uint32>(pvStructurePtr->getNumberFields())))
@@ -438,3 +437,26 @@ MonitorElement::MonitorElement(epics::pvData::PVStructurePtr const & pvStructure
{}
}} // namespace epics::pvAccess
namespace {
struct DummyChannelFind : public epics::pvAccess::ChannelFind {
epics::pvAccess::ChannelProvider::weak_pointer provider;
DummyChannelFind(const epics::pvAccess::ChannelProvider::shared_pointer& provider) : provider(provider) {}
virtual ~DummyChannelFind() {}
virtual void destroy() OVERRIDE FINAL {}
virtual epics::pvAccess::ChannelProvider::shared_pointer getChannelProvider() OVERRIDE FINAL { return provider.lock(); }
virtual void cancel() OVERRIDE FINAL {}
};
}
namespace epics {namespace pvAccess {
ChannelFind::shared_pointer ChannelFind::buildDummy(const ChannelProvider::shared_pointer& provider)
{
std::tr1::shared_ptr<DummyChannelFind> ret(new DummyChannelFind(provider));
return ret;
}
}} // namespace epics::pvAccess