implement copy instead of taking it from pvDataCPP; implement plugin support

This commit is contained in:
mrkraimer
2018-07-12 14:05:15 -04:00
parent 6239ef0c0c
commit 3e0282d956
17 changed files with 1863 additions and 17 deletions

33
src/copy/pvPlugin.cpp Normal file
View File

@@ -0,0 +1,33 @@
/* pvPlugin.cpp */
/*
* The License for this software can be found in the file LICENSE that is included with the distribution.
*/
#include <pv/pvPlugin.h>
using namespace epics::pvData;
namespace epics { namespace pvDatabase{
typedef std::map<std::string,PVPluginPtr> PVPluginMap;
static PVPluginMap pluginMap;
static Mutex mutex;
void PVPluginRegistry::registerPlugin(const std::string & name,const PVPluginPtr & pvPlugin)
{
Lock xx(mutex);
PVPluginMap::iterator iter = pluginMap.find(name);
if(iter!=pluginMap.end()) throw std::logic_error("plugin already registered");
pluginMap.insert(PVPluginMap::value_type(name,pvPlugin));
}
PVPluginPtr PVPluginRegistry::find(const std::string & name)
{
Lock xx(mutex);
PVPluginMap::iterator iter = pluginMap.find(name);
if(iter!=pluginMap.end()) return (*iter).second;
return PVPluginPtr();
}
}}