From 236a7311d54c060bee4e5b675804d34d4a3f85ba Mon Sep 17 00:00:00 2001 From: Matej Sekoranja Date: Mon, 23 Sep 2013 11:26:10 +0200 Subject: [PATCH] pvAccess -> pva provider name change --- pvAccessApp/factory/ChannelAccessFactory.cpp | 12 ++++++++++-- pvAccessApp/remoteClient/clientContextImpl.cpp | 2 +- pvAccessApp/rpcClient/rpcClient.cpp | 2 +- testApp/remote/eget.cpp | 10 ++-------- testApp/remote/pvget.cpp | 2 +- testApp/remote/pvinfo.cpp | 2 +- testApp/remote/pvput.cpp | 2 +- testApp/remote/testChannelConnect.cpp | 2 +- testApp/remote/testGetPerformance.cpp | 2 +- testApp/remote/testRemoteClientImpl.cpp | 2 +- 10 files changed, 20 insertions(+), 18 deletions(-) diff --git a/pvAccessApp/factory/ChannelAccessFactory.cpp b/pvAccessApp/factory/ChannelAccessFactory.cpp index 63c706e..2270493 100644 --- a/pvAccessApp/factory/ChannelAccessFactory.cpp +++ b/pvAccessApp/factory/ChannelAccessFactory.cpp @@ -28,7 +28,11 @@ static ChannelProviderFactoryMap channelProviders; class ChannelAccessImpl : public ChannelAccess { public: - ChannelProvider::shared_pointer getProvider(String const & providerName) { + ChannelProvider::shared_pointer getProvider(String const & _providerName) { + + // TODO remove, here for backward compatibility + const String providerName = (_providerName == "pvAccess") ? "pva" : _providerName; + Lock guard(channelProviderMutex); ChannelProviderFactoryMap::const_iterator iter = channelProviders.find(providerName); if (iter != channelProviders.end()) @@ -37,7 +41,11 @@ class ChannelAccessImpl : public ChannelAccess { return ChannelProvider::shared_pointer(); } - ChannelProvider::shared_pointer createProvider(String const & providerName) { + ChannelProvider::shared_pointer createProvider(String const & _providerName) { + + // TODO remove, here for backward compatibility + const String providerName = (_providerName == "pvAccess") ? "pva" : _providerName; + Lock guard(channelProviderMutex); ChannelProviderFactoryMap::const_iterator iter = channelProviders.find(providerName); if (iter != channelProviders.end()) diff --git a/pvAccessApp/remoteClient/clientContextImpl.cpp b/pvAccessApp/remoteClient/clientContextImpl.cpp index 7ab13f8..14b29c7 100644 --- a/pvAccessApp/remoteClient/clientContextImpl.cpp +++ b/pvAccessApp/remoteClient/clientContextImpl.cpp @@ -44,7 +44,7 @@ using namespace epics::pvData; namespace epics { namespace pvAccess { - String ClientContextImpl::PROVIDER_NAME = "pvAccess"; // TODO to be renamed to "pva" + String ClientContextImpl::PROVIDER_NAME = "pva"; Status ChannelImpl::channelDestroyed = Status(Status::STATUSTYPE_WARNING, "channel destroyed"); Status ChannelImpl::channelDisconnected = Status(Status::STATUSTYPE_WARNING, "channel disconnected"); diff --git a/pvAccessApp/rpcClient/rpcClient.cpp b/pvAccessApp/rpcClient/rpcClient.cpp index 64a0712..17ad7e2 100644 --- a/pvAccessApp/rpcClient/rpcClient.cpp +++ b/pvAccessApp/rpcClient/rpcClient.cpp @@ -213,7 +213,7 @@ private: void init() { using namespace std::tr1; - m_provider = getChannelAccess()->getProvider("pvAccess"); + m_provider = getChannelAccess()->getProvider("pva"); shared_ptr channelRequesterImpl(new ChannelRequesterImpl()); m_channelRequesterImpl = channelRequesterImpl; diff --git a/testApp/remote/eget.cpp b/testApp/remote/eget.cpp index e49177f..5226e50 100644 --- a/testApp/remote/eget.cpp +++ b/testApp/remote/eget.cpp @@ -1668,14 +1668,8 @@ int main (int argc, char *argv[]) for (int n = 0; n < nPvs; n++) { shared_ptr channelRequesterImpl(new ChannelRequesterImpl(quiet)); - - // TODO to be removed - String providerName = providerNames[n]; - if (providerName == "pva") - providerName = "pvAccess"; - // TODO no privder check - channels[n] = getChannelAccess()->getProvider(providerName)->createChannel(pvs[n], channelRequesterImpl); + channels[n] = getChannelAccess()->getProvider(providerNames[n])->createChannel(pvs[n], channelRequesterImpl); } // TODO maybe unify for nPvs == 1?! @@ -1921,7 +1915,7 @@ int main (int argc, char *argv[]) ClientFactory::start(); - ChannelProvider::shared_pointer provider = getChannelAccess()->getProvider("pvAccess"); + ChannelProvider::shared_pointer provider = getChannelAccess()->getProvider("pva"); shared_ptr channelRequesterImpl(new ChannelRequesterImpl(quiet)); Channel::shared_pointer channel = diff --git a/testApp/remote/pvget.cpp b/testApp/remote/pvget.cpp index 46b181c..ff6f627 100644 --- a/testApp/remote/pvget.cpp +++ b/testApp/remote/pvget.cpp @@ -432,7 +432,7 @@ int main (int argc, char *argv[]) } ClientFactory::start(); - ChannelProvider::shared_pointer provider = getChannelAccess()->getProvider("pvAccess"); + ChannelProvider::shared_pointer provider = getChannelAccess()->getProvider("pva"); //epics::pvAccess::ca::CAClientFactory::start(); //ChannelProvider::shared_pointer provider = getChannelAccess()->getProvider("ca"); diff --git a/testApp/remote/pvinfo.cpp b/testApp/remote/pvinfo.cpp index 6501bd7..b450a54 100644 --- a/testApp/remote/pvinfo.cpp +++ b/testApp/remote/pvinfo.cpp @@ -122,7 +122,7 @@ int main (int argc, char *argv[]) Requester::shared_pointer requester(new RequesterImpl("pvinfo")); ClientFactory::start(); - ChannelProvider::shared_pointer provider = getChannelAccess()->getProvider("pvAccess"); + ChannelProvider::shared_pointer provider = getChannelAccess()->getProvider("pva"); // first connect to all, this allows resource (e.g. TCP connection) sharing vector channels(nPvs); diff --git a/testApp/remote/pvput.cpp b/testApp/remote/pvput.cpp index b05ce3b..491e3d8 100644 --- a/testApp/remote/pvput.cpp +++ b/testApp/remote/pvput.cpp @@ -860,7 +860,7 @@ int main (int argc, char *argv[]) terseSeparator(fieldSeparator); ClientFactory::start(); - ChannelProvider::shared_pointer provider = getChannelAccess()->getProvider("pvAccess"); + ChannelProvider::shared_pointer provider = getChannelAccess()->getProvider("pva"); //epics::pvAccess::ca::CAClientFactory::start(); //ChannelProvider::shared_pointer provider = getChannelAccess()->getProvider("ca"); diff --git a/testApp/remote/testChannelConnect.cpp b/testApp/remote/testChannelConnect.cpp index 0cd8f37..ed5c369 100644 --- a/testApp/remote/testChannelConnect.cpp +++ b/testApp/remote/testChannelConnect.cpp @@ -72,7 +72,7 @@ int main() Event g_event; ClientFactory::start(); - ChannelProvider::shared_pointer provider = getChannelAccess()->getProvider("pvAccess"); + ChannelProvider::shared_pointer provider = getChannelAccess()->getProvider("pva"); ChannelRequester::shared_pointer channelRequester(new ChannelRequesterImpl(g_event)); Channel::shared_pointer channels[N_CHANNELS]; diff --git a/testApp/remote/testGetPerformance.cpp b/testApp/remote/testGetPerformance.cpp index 40062eb..82167a9 100644 --- a/testApp/remote/testGetPerformance.cpp +++ b/testApp/remote/testGetPerformance.cpp @@ -472,7 +472,7 @@ int main (int argc, char *argv[]) } ClientFactory::start(); - provider = getChannelAccess()->getProvider("pvAccess"); + provider = getChannelAccess()->getProvider("pva"); if (!testFile.empty()) { diff --git a/testApp/remote/testRemoteClientImpl.cpp b/testApp/remote/testRemoteClientImpl.cpp index c97ca3b..6a2bf2e 100644 --- a/testApp/remote/testRemoteClientImpl.cpp +++ b/testApp/remote/testRemoteClientImpl.cpp @@ -455,7 +455,7 @@ int main() */ ClientFactory::start(); - ChannelProvider::shared_pointer provider = getChannelAccess()->getProvider("pvAccess"); + ChannelProvider::shared_pointer provider = getChannelAccess()->getProvider("pva"); ChannelFindRequester::shared_pointer findRequester(new ChannelFindRequesterImpl()); ChannelFind::shared_pointer channelFind = provider->channelFind("testSomething", findRequester);