diff --git a/pdbApp/pvif.cpp b/pdbApp/pvif.cpp index d3749ac..ea31192 100644 --- a/pdbApp/pvif.cpp +++ b/pdbApp/pvif.cpp @@ -640,15 +640,9 @@ PVIFBuilder::PVIFBuilder() PVIFBuilder::~PVIFBuilder() {} -PVIFBuilder* PVIFBuilder::create(const options_t& options) +PVIFBuilder* PVIFBuilder::create(const std::string& type) { - options_t::const_iterator it; - - if((it = options.find("@type"))==options.end()) - throw std::runtime_error("Field mapping missing required key \"@type\""); - const std::string& type(it->second.ref()); - - if(type=="scalar") + if(type.empty() || type=="scalar") return new ScalarBuilder; else if(type=="plain") return new PlainBuilder; diff --git a/pdbApp/pvif.h b/pdbApp/pvif.h index 2ec3325..ef408c9 100644 --- a/pdbApp/pvif.h +++ b/pdbApp/pvif.h @@ -287,9 +287,7 @@ struct epicsShareClass PVIFBuilder { // need not be the root structure virtual PVIF* attach(dbChannel *channel, const epics::pvData::PVFieldPtr& root) =0; - typedef std::map options_t; - - static PVIFBuilder* create(const options_t& options); + static PVIFBuilder* create(const std::string& name); protected: PVIFBuilder(); private: diff --git a/testApp/testpvif.cpp b/testApp/testpvif.cpp index 378d618..e5aeb3c 100644 --- a/testApp/testpvif.cpp +++ b/testApp/testpvif.cpp @@ -230,9 +230,7 @@ void testPlain() p2p::auto_ptr builder; { - PVIFBuilder::options_t opts; - opts["@type"] = "plain"; - builder.reset(PVIFBuilder::create(opts)); + builder.reset(PVIFBuilder::create("plain")); } pvd::FieldConstPtr dtype_li(builder->dtype(chan_li));