diff --git a/pvDataApp/factory/FieldCreateFactory.cpp b/pvDataApp/factory/FieldCreateFactory.cpp index eb9fdc7..b34f304 100644 --- a/pvDataApp/factory/FieldCreateFactory.cpp +++ b/pvDataApp/factory/FieldCreateFactory.cpp @@ -716,29 +716,29 @@ UnionConstPtr FieldBuilder::createUnion() return field; } -FieldBuilderPtr FieldBuilder::addStructure(std::string const & name) +FieldBuilderPtr FieldBuilder::addNestedStructure(std::string const & name) { return FieldBuilderPtr(new FieldBuilder(shared_from_this(), name, structure, false)); } -FieldBuilderPtr FieldBuilder::addUnion(std::string const & name) +FieldBuilderPtr FieldBuilder::addNestedUnion(std::string const & name) { return FieldBuilderPtr(new FieldBuilder(shared_from_this(), name, union_, false)); } -FieldBuilderPtr FieldBuilder::addStructureArray(std::string const & name) +FieldBuilderPtr FieldBuilder::addNestedStructureArray(std::string const & name) { return FieldBuilderPtr(new FieldBuilder(shared_from_this(), name, structure, true)); } -FieldBuilderPtr FieldBuilder::addUnionArray(std::string const & name) +FieldBuilderPtr FieldBuilder::addNestedUnionArray(std::string const & name) { return FieldBuilderPtr(new FieldBuilder(shared_from_this(), name, union_, true)); } -FieldBuilderPtr FieldBuilder::createNested() +FieldBuilderPtr FieldBuilder::addNested() { if (!parentBuilder.get()) throw std::runtime_error("this method can only be called to create nested fields"); diff --git a/pvDataApp/pv/pvIntrospect.h b/pvDataApp/pv/pvIntrospect.h index 12871eb..b958390 100644 --- a/pvDataApp/pv/pvIntrospect.h +++ b/pvDataApp/pv/pvIntrospect.h @@ -708,51 +708,51 @@ public: /** * Add new nested {@code Structure}. - * {@code createNested()} method must be called + * {@code addNested()} method must be called * to complete creation of the nested {@code Structure}. * @param name nested structure name. * @return a new instance of a {@code FieldBuilder} is returned. - * @see #createNested() + * @see #addNested() */ - FieldBuilderPtr addStructure(std::string const & name); + FieldBuilderPtr addNestedStructure(std::string const & name); /** * Add new nested {@code Union}. - * {@code createNested()} method must be called + * {@code addNested()} method must be called * to complete creation of the nested {@code Union}. * @param name nested union name. * @return a new instance of a {@code FieldBuilder} is returned. - * @see #createNested() + * @see #addNested() */ - FieldBuilderPtr addUnion(std::string const & name); + FieldBuilderPtr addNestedUnion(std::string const & name); /** * Add new nested {@code Structure[]}. - * {@code createNested()} method must be called + * {@code addNested()} method must be called * to complete creation of the nested {@code Structure}. * @param name nested structure name. * @return a new instance of a {@code FieldBuilder} is returned. - * @see #createNested() + * @see #addNested() */ - FieldBuilderPtr addStructureArray(std::string const & name); + FieldBuilderPtr addNestedStructureArray(std::string const & name); /** * Add new nested {@code Union[]}. - * {@code createNested()} method must be called + * {@code addNested()} method must be called * to complete creation of the nested {@code Union}. * @param name nested union name. * @return a new instance of a {@code FieldBuilder} is returned. - * @see #createNested() + * @see #addNested() */ - FieldBuilderPtr addUnionArray(std::string const & name); + FieldBuilderPtr addNestedUnionArray(std::string const & name); /** * Complete the creation of a nested object. - * @see #addStructure(String) - * @see #addUnion(String) + * @see #addNestedStructure(String) + * @see #addNestedUnion(String) * @return a previous (parent) {@code FieldBuilder}. */ - FieldBuilderPtr createNested(); + FieldBuilderPtr addNested(); private: FieldBuilder(); diff --git a/testApp/misc/testSerialization.cpp b/testApp/misc/testSerialization.cpp index 63e972d..71980ff 100644 --- a/testApp/misc/testSerialization.cpp +++ b/testApp/misc/testSerialization.cpp @@ -189,11 +189,11 @@ void testEquals() { UnionConstPtr punion = getFieldCreate()->createFieldBuilder()-> add("double", pvDouble)-> add("double2", pvDouble)-> - addStructureArray("nested")-> + addNestedStructureArray("nested")-> setId("nestedId")-> add("short", pvShort)-> add("long", pvLong)-> - createNested()-> + addNested()-> addArray("intArray", pvInt)-> createUnion(); PVUnionPtr union1 = factory->createPVUnion(punion); @@ -683,11 +683,11 @@ void testIntrospectionSerialization() // union UnionConstPtr punion = factory->createFieldBuilder()-> add("double", pvDouble)-> - addStructureArray("nested")-> + addNestedStructureArray("nested")-> setId("nestedId")-> add("short", pvShort)-> add("long", pvLong)-> - createNested()-> + addNested()-> addArray("intArray", pvInt)-> createUnion(); serializatioTest(punion); diff --git a/testApp/pv/testFieldBuilder.cpp b/testApp/pv/testFieldBuilder.cpp index 98b97bd..bd290c5 100644 --- a/testApp/pv/testFieldBuilder.cpp +++ b/testApp/pv/testFieldBuilder.cpp @@ -86,19 +86,19 @@ void test_invalid() { fieldCreate->createFieldBuilder()-> add("f1", pvByte)-> - createNested(); - testFail("createNested() allowed in non-nested FieldBuilder"); + addNested(); + testFail("addNested() allowed in non-nested FieldBuilder"); } catch (std::runtime_error& re) { // ok - testPass("createNested() disallowed in non-nested FieldBuilder"); + testPass("addNested() disallowed in non-nested FieldBuilder"); } try { fieldCreate->createFieldBuilder()-> add("f1", pvByte)-> - addStructure("nested")-> + addNestedStructure("nested")-> add("n1", pvUInt)-> createStructure(); testFail("createStructure() allowed in nested FieldBuilder"); @@ -119,11 +119,11 @@ void test_nestedStructure() std::string NESTED_ID = "nestedID"; StructureConstPtr s = fieldCreate->createFieldBuilder()-> add("double", pvDouble)-> - addStructure("nested")-> + addNestedStructure("nested")-> setId(NESTED_ID)-> add("short", pvShort)-> add("long", pvLong)-> - createNested()-> + addNested()-> addArray("intArray", pvInt)-> createStructure(); testOk1(s.get() != 0); @@ -175,11 +175,11 @@ void test_nestedStructureArray() std::string NESTED_ID = "nestedID"; StructureConstPtr s = fieldCreate->createFieldBuilder()-> add("double", pvDouble)-> - addStructureArray("nested")-> + addNestedStructureArray("nested")-> setId(NESTED_ID)-> add("short", pvShort)-> add("long", pvLong)-> - createNested()-> + addNested()-> addArray("intArray", pvInt)-> createStructure(); testOk1(s.get() != 0);