Consider using a union field
https://github.com/epics-base/exampleCPP/blob/master/database/src/exampleDatabase.cpp
Has some examples of how to create a union .
One example is:
static void createVariantUnionArrayRecord(
PVDatabasePtr const &master,
string const &recordName)
{
StructureConstPtr top =
fieldCreate->createFieldBuilder()->
add("timeStamp",standardField->timeStamp()) ->
addArray("value",fieldCreate->createVariantUnion())->
createStructure();
PVStructurePtr pvStructure =
pvDataCreate->createPVStructure(top);
PVRecordPtr pvRecord =
PVRecord::create(recordName,pvStructure);
bool result = master->addRecord(pvRecord);
if(!result) cout<< "record " << recordName
<< " not added" << endl;
}
field "value" can be made into any pvType you want. In your case
you can make it a structure.
What "value" is can be changed at run time.
On 7/27/20 1:23 PM, Madden, Timothy J. via Tech-talk wrote:
Folks
Most of the interfaces for Structure require a StructureConstPtr
data type.
This is a pointer to an immutable structure.
Suppose I wish the structure to change at run time. What do we
do?
Tim Madden
APS