pass in upstream provider as argument

This commit is contained in:
Michael Davidsaver
2016-01-29 12:14:34 -05:00
parent 2b6bd8c94d
commit 1a7db1df17
4 changed files with 9 additions and 7 deletions
+2 -2
View File
@@ -126,8 +126,8 @@ struct ChannelCache::cacheClean : public epicsTimerNotify
}
};
ChannelCache::ChannelCache()
:provider(pva::getChannelProviderRegistry()->getProvider("pva"))
ChannelCache::ChannelCache(const pva::ChannelProvider::shared_pointer& prov)
:provider(prov)
,timerQueue(&epicsTimerQueueActive::allocate(1, epicsThreadPriorityCAServerLow-2))
,cleaner(new cacheClean(this))
,cleanerRuns(0)
+1 -1
View File
@@ -161,7 +161,7 @@ struct ChannelCache
size_t cleanerRuns;
size_t cleanerDust;
ChannelCache();
ChannelCache(const epics::pvAccess::ChannelProvider::shared_pointer& prov);
~ChannelCache();
};
+4 -3
View File
@@ -152,7 +152,8 @@ void GWServerChannelProvider::destroy()
std::cout<<"GWServer destory request\n";
}
GWServerChannelProvider::GWServerChannelProvider()
GWServerChannelProvider::GWServerChannelProvider(const pva::ChannelProvider::shared_pointer& prov)
:cache(prov)
{
std::cout<<"GW Server ctor\n";
}
@@ -176,7 +177,7 @@ struct GWServerChannelProviderFactory : public pva::ChannelProviderFactory
{
pva::ChannelProvider::shared_pointer P(last_provider.lock());
if(!P) {
P.reset(new GWServerChannelProvider);
P.reset(new GWServerChannelProvider(pva::getChannelProviderRegistry()->getProvider("pva")));
last_provider = P;
}
return P;
@@ -184,7 +185,7 @@ struct GWServerChannelProviderFactory : public pva::ChannelProviderFactory
virtual pva::ChannelProvider::shared_pointer newInstance()
{
pva::ChannelProvider::shared_pointer P(new GWServerChannelProvider);
pva::ChannelProvider::shared_pointer P(new GWServerChannelProvider(pva::getChannelProviderRegistry()->getProvider("pva")));
last_provider = P;
return P;
}
+2 -1
View File
@@ -31,7 +31,8 @@ struct GWServerChannelProvider : public
short priority, std::string const & addressx);
virtual void configure(epics::pvData::PVStructure::shared_pointer /*configuration*/);
virtual void destroy();
GWServerChannelProvider();
GWServerChannelProvider(const epics::pvAccess::ChannelProvider::shared_pointer& prov);
virtual ~GWServerChannelProvider();
};