QSRV implement channelList

just list record names.
This commit is contained in:
Michael Davidsaver
2018-02-07 11:04:29 -08:00
parent b6b6ac3305
commit a1cb3d302a
2 changed files with 16 additions and 3 deletions

View File

@ -586,8 +586,14 @@ pva::ChannelFind::shared_pointer
PDBProvider::channelList(pva::ChannelListRequester::shared_pointer const & requester)
{
pva::ChannelFind::shared_pointer ret;
requester->channelListResult(pvd::Status(pvd::Status::STATUSTYPE_ERROR, "not supported"),
ret, pvd::PVStringArray::const_svector(), true);
pvd::PVStringArray::svector names;
for(pdbRecordIterator rec; !rec.done(); rec.next())
{
names.push_back(rec.name());
}
requester->channelListResult(pvd::Status::Ok,
shared_from_this(),
pvd::freeze(names), false);
return ret;
}

View File

@ -31,12 +31,15 @@ struct PDBPV
};
struct epicsShareClass PDBProvider : public epics::pvAccess::ChannelProvider,
public std::tr1::enable_shared_from_this<PDBProvider>
public epics::pvAccess::ChannelFind,
public std::tr1::enable_shared_from_this<PDBProvider>
{
POINTER_DEFINITIONS(PDBProvider);
explicit PDBProvider(const epics::pvAccess::Configuration::const_shared_pointer& =epics::pvAccess::Configuration::const_shared_pointer());
virtual ~PDBProvider();
// ChannelProvider
virtual void destroy();
virtual std::string getProviderName();
virtual epics::pvAccess::ChannelFind::shared_pointer channelFind(std::string const & channelName,
@ -49,6 +52,10 @@ struct epicsShareClass PDBProvider : public epics::pvAccess::ChannelProvider,
epics::pvAccess::ChannelRequester::shared_pointer const & channelRequester,
short priority, std::string const & address);
// ChannelFind
virtual std::tr1::shared_ptr<ChannelProvider> getChannelProvider() { return shared_from_this(); }
virtual void cancel() {/* our channelFind() is synchronous, so nothing to cancel */}
typedef std::map<std::string, PDBPV::shared_pointer> persist_pv_map_t;
persist_pv_map_t persist_pv_map;