The epics::pvData namespace. See pv/pvData.h header.
#include <pv/pvData.h>
#include <pv/createRequest.h>
Define a structure type and create a container with default values.
namespace pvd = epics::pvData;
->
add(
"fld1", pvd::pvInt)
->addNestedStructure("sub")
->
add(
"fld2", pvd::pvString)
->endNested()
->createStructure());
pvd::PVStructuretPtr value(stype->build());
value->getSubFieldT<pvd::PVInt>("fld1")->put(4);
value->getSubFieldT<pvd::PVScalar>("sub.fld2")->putFrom(4.2);
is equivalent to the following pseudo-code.
struct stype {
pvd::int32 fld1;
struct {
} sub;
};
stype value;
value.fld1 = 4;
value.fld2 = pvd::castUnsafe<std::string>(4.2);