NTUnionBuilder: Add missing value() function

Add missing function NTUnionBuilder::value() to allow the union type of
the NTUnion's value field to be specified.
This commit is contained in:
Dave Hickin
2016-09-09 18:07:59 +01:00
parent 4768444b8a
commit 048d6ef737
3 changed files with 47 additions and 2 deletions
+6
View File
@@ -18,6 +18,12 @@ static NTFieldPtr ntField = NTField::get();
namespace detail {
NTUnionBuilder::shared_pointer NTUnionBuilder::value(UnionConstPtr unionType)
{
valueType = unionType;
return shared_from_this();
}
StructureConstPtr NTUnionBuilder::createStructure()
{
FieldBuilderPtr builder =
+8
View File
@@ -40,6 +40,14 @@ namespace detail {
public:
POINTER_DEFINITIONS(NTUnionBuilder);
/**
* Specifies the union for the value field.
* If this is not called then a variant union is the default.
* @param unionType the introspection object for the union value field
* @return this instance of NTUnionBuilder
*/
shared_pointer value(epics::pvData::UnionConstPtr unionType);
/**
* Adds descriptor field to the NTUnion.
* @return this instance of <b>NTUnionBuilder</b>.