automatic ClientFactory::start()

register the "pva" provider automatically.
This commit is contained in:
Michael Davidsaver
2017-07-17 14:29:27 +02:00
parent 2c530868f6
commit eef51a9a6d
10 changed files with 38 additions and 35 deletions
+22
View File
@@ -41,3 +41,25 @@ void ClientFactory::stop()
{
// unregister now done with exit hook
}
// automatically register on load
namespace {
struct pvaloader
{
pvaloader() {
ClientFactory::start();
}
} pvaloaderinstance;
} // namespace
// perhaps useful during dynamic loading?
extern "C" {
void registerClientProvider_pva()
{
try {
ClientFactory::start();
} catch(std::exception& e){
std::cerr<<"Error loading pva: "<<e.what()<<"\n";
}
}
} // extern "C"