Add +type:"structure"

This commit is contained in:
Michael Davidsaver
2021-10-19 11:05:17 -07:00
parent c5cba4ccc4
commit b3d37e7f39
3 changed files with 50 additions and 0 deletions

View File

@ -108,6 +108,7 @@ record(...) {
@li "any"
@li "meta"
@li "proc"
@li "structure"
The "scalar" mapping places an NTScalar or NTScalarArray as a sub-structure.
@ -124,6 +125,9 @@ placed in the top-level structure.
The "proc" mapping uses neither "value" nor meta-data.
Instead the target record is processed during a put.
The "structure" mapping allows an "+id" to be attached without a "+channel".
So none of "+channel", "+trigger", nor "+putorder" are meaningful for a "structure" mapping.
@subsubsection qsrv_group_map_trig Field Update Triggers
The field triggers define how changes to the consitutent field

View File

@ -5,6 +5,9 @@
Release 1.3.2 (UNRELEASED)
==========================
- Additions
- Add new "structure" to @ref qsrv_group_map_types
Release 1.3.1 (June 2021)
=========================

View File

@ -1175,6 +1175,47 @@ struct ProcBuilder : public PVIFBuilder
}
};
struct PVIFNoOp : public PVIF
{
PVIFNoOp(dbChannel *channel) :PVIF(channel) {}
virtual void put(epics::pvData::BitSet& mask, unsigned dbe, db_field_log *pfl) OVERRIDE FINAL
{}
virtual pvd::Status get(const epics::pvData::BitSet& mask, proc_t proc, bool permit) OVERRIDE FINAL
{
return pvd::Status();
}
virtual unsigned dbe(const epics::pvData::BitSet& mask) OVERRIDE FINAL
{
return 0;
}
};
struct IDBuilder : public PVIFBuilder
{
explicit IDBuilder(dbChannel* chan) :PVIFBuilder(chan) {}
virtual ~IDBuilder() {}
// fetch the structure description
virtual epics::pvData::FieldConstPtr dtype() OVERRIDE FINAL {
throw std::logic_error("Don't call me");
}
virtual epics::pvData::FieldBuilderPtr dtype(epics::pvData::FieldBuilderPtr& builder,
const std::string& fld) OVERRIDE FINAL
{
// caller has already done builder->setId(...)
return builder;
}
virtual PVIF* attach(const epics::pvData::PVStructurePtr& root,
const FieldName& fldname) OVERRIDE FINAL
{
return new PVIFNoOp(channel);
}
};
}//namespace
pvd::Status PVIF::get(const epics::pvData::BitSet& mask, proc_t proc, bool permit)
@ -1240,6 +1281,8 @@ PVIFBuilder* PVIFBuilder::create(const std::string& type, dbChannel* chan)
return new MetaBuilder(chan);
else if(type=="proc")
return new ProcBuilder(chan);
else if(type=="structure")
return new IDBuilder(chan);
else
throw std::runtime_error(std::string("Unknown +type=")+type);
}