diff --git a/examples/getme.cpp b/examples/getme.cpp index 35fb913..0635609 100644 --- a/examples/getme.cpp +++ b/examples/getme.cpp @@ -20,7 +20,6 @@ //! [Headers] #include -#include #include #include //! [Headers] @@ -138,8 +137,7 @@ int main(int argc, char *argv[]) { .push_env() .build()); - // add "pva" provider to registry - pva::ClientFactory::start(); + // "pva" provider automatically in registry // add "ca" provider to registry pva::ca::CAClientFactory::start(); diff --git a/examples/miniget.cpp b/examples/miniget.cpp index a84dd4e..f6cd734 100644 --- a/examples/miniget.cpp +++ b/examples/miniget.cpp @@ -6,7 +6,6 @@ #include -#include "pv/clientFactory.h" #include "pva/client.h" int main(int argc, char *argv[]) @@ -17,8 +16,6 @@ int main(int argc, char *argv[]) return 1; } - epics::pvAccess::ClientFactory::start(); - pvac::ClientProvider provider("pva"); pvac::ClientChannel channel(provider.connect(argv[1])); diff --git a/examples/monitorme.cpp b/examples/monitorme.cpp index a2df0e7..bdb59a8 100644 --- a/examples/monitorme.cpp +++ b/examples/monitorme.cpp @@ -20,7 +20,6 @@ #include #include -#include #include #include #include @@ -238,8 +237,7 @@ int main(int argc, char *argv[]) { .push_env() .build()); - // add "pva" provider to registry - pva::ClientFactory::start(); + // "pva" provider automatically in registry // add "ca" provider to registry pva::ca::CAClientFactory::start(); diff --git a/examples/putme.cpp b/examples/putme.cpp index 029227b..ac9c1c8 100644 --- a/examples/putme.cpp +++ b/examples/putme.cpp @@ -22,7 +22,6 @@ //! [Headers] #include -#include #include #include //! [Headers] @@ -182,8 +181,7 @@ int main(int argc, char *argv[]) { .push_env() .build()); - // add "pva" provider to registry - pva::ClientFactory::start(); + // "pva" provider automatically in registry // add "ca" provider to registry pva::ca::CAClientFactory::start(); diff --git a/pvtoolsSrc/eget.cpp b/pvtoolsSrc/eget.cpp index cb8bcfa..1f4856f 100644 --- a/pvtoolsSrc/eget.cpp +++ b/pvtoolsSrc/eget.cpp @@ -3,7 +3,6 @@ #endif #include -#include #include #include @@ -1670,8 +1669,7 @@ int main (int argc, char *argv[]) serviceRequest = true; } - // register "pva" and "ca" providers - ClientFactory::start(); + // register "ca" provider epics::pvAccess::ca::CAClientFactory::start(); // PVs mode @@ -1878,9 +1876,6 @@ int main (int argc, char *argv[]) while (true) epicsThreadSleep(timeOut); } - - epics::pvAccess::ca::CAClientFactory::stop(); - ClientFactory::stop(); } // service RPC mode else @@ -2020,7 +2015,6 @@ int main (int argc, char *argv[]) } - ClientFactory::start(); ChannelProvider::shared_pointer provider = ChannelProviderRegistry::clients()->getProvider("pva"); assert(provider); @@ -2060,8 +2054,6 @@ int main (int argc, char *argv[]) } channel->destroy(); - - ClientFactory::stop(); } if (cleanupAndReport) diff --git a/pvtoolsSrc/pvget.cpp b/pvtoolsSrc/pvget.cpp index 29e0d1b..e9c83b6 100644 --- a/pvtoolsSrc/pvget.cpp +++ b/pvtoolsSrc/pvget.cpp @@ -18,7 +18,6 @@ #include #include -#include #include #include #include @@ -505,7 +504,6 @@ int main (int argc, char *argv[]) // ================ Connect channels and start operations - ClientFactory::start(); epics::pvAccess::ca::CAClientFactory::start(); bool allOK = true; @@ -613,9 +611,6 @@ int main (int argc, char *argv[]) // ========================== All done now - epics::pvAccess::ca::CAClientFactory::stop(); - ClientFactory::stop(); - if(debugFlag) std::cerr<<"Done\n"; return allOK ? 0 : 1; diff --git a/pvtoolsSrc/pvinfo.cpp b/pvtoolsSrc/pvinfo.cpp index 4f1ea8b..babef3c 100644 --- a/pvtoolsSrc/pvinfo.cpp +++ b/pvtoolsSrc/pvinfo.cpp @@ -1,5 +1,4 @@ #include -#include #include #include @@ -137,7 +136,6 @@ int main (int argc, char *argv[]) bool allOK = true; - ClientFactory::start(); epics::pvAccess::ca::CAClientFactory::start(); { @@ -218,8 +216,6 @@ int main (int argc, char *argv[]) } } - epics::pvAccess::ca::CAClientFactory::stop(); - ClientFactory::stop(); } if (cleanupAndReport) diff --git a/pvtoolsSrc/pvput.cpp b/pvtoolsSrc/pvput.cpp index e5a34ac..e4cb427 100644 --- a/pvtoolsSrc/pvput.cpp +++ b/pvtoolsSrc/pvput.cpp @@ -1,5 +1,4 @@ #include -#include #include #include @@ -619,7 +618,6 @@ int main (int argc, char *argv[]) address = uri.host; } - ClientFactory::start(); epics::pvAccess::ca::CAClientFactory::start(); ChannelProvider::shared_pointer provider(ChannelProviderRegistry::clients()->getProvider(providerName)); @@ -733,8 +731,5 @@ int main (int argc, char *argv[]) std::cerr << "unknown exception caught" << std::endl; } - epics::pvAccess::ca::CAClientFactory::stop(); - ClientFactory::stop(); - return allOK ? 0 : 1; } diff --git a/src/ca/caProvider.cpp b/src/ca/caProvider.cpp index 8cd9668..7f1415f 100644 --- a/src/ca/caProvider.cpp +++ b/src/ca/caProvider.cpp @@ -197,3 +197,15 @@ void CAClientFactory::stop() { // unregister now done with exit hook } + +// perhaps useful during dynamic loading? +extern "C" { +void registerClientProvider_ca() +{ + try { + CAClientFactory::start(); + } catch(std::exception& e){ + std::cerr<<"Error loading ca: "<