Rename add() addColumn() in NTTable
Function for adding columns to table (i.e. to value subfield) was add(ScalarType). However add(Field) adds extra field to top-level structure. Rename former to avoid confusion and as more meaningful name. Update unit tests.
This commit is contained in:
@ -20,7 +20,7 @@ static NTFieldPtr ntField = NTField::get();
|
||||
|
||||
namespace detail {
|
||||
|
||||
NTTableBuilder::shared_pointer NTTableBuilder::add(
|
||||
NTTableBuilder::shared_pointer NTTableBuilder::addColumn(
|
||||
std::string const & name, epics::pvData::ScalarType scalarType
|
||||
)
|
||||
{
|
||||
|
@ -53,7 +53,7 @@ namespace detail {
|
||||
* @param elementType column type, a scalar array.
|
||||
* @return this instance of <b>NTTableBuilder</b>.
|
||||
*/
|
||||
shared_pointer add(std::string const & name, epics::pvData::ScalarType elememtType);
|
||||
shared_pointer addColumn(std::string const & name, epics::pvData::ScalarType elememtType);
|
||||
|
||||
/**
|
||||
* Add descriptor field to the NTTable.
|
||||
|
@ -22,9 +22,9 @@ void test_builder()
|
||||
testOk(builder.get() != 0, "Got builder");
|
||||
|
||||
StructureConstPtr structure = builder->
|
||||
add("column0", pvDouble)->
|
||||
add("column1", pvString)->
|
||||
add("column2", pvInt)->
|
||||
addColumn("column0", pvDouble)->
|
||||
addColumn("column1", pvString)->
|
||||
addColumn("column2", pvInt)->
|
||||
addDescriptor()->
|
||||
addAlarm()->
|
||||
addTimeStamp()->
|
||||
@ -64,8 +64,8 @@ void test_builder()
|
||||
try
|
||||
{
|
||||
structure = builder->
|
||||
add("column0", pvDouble)->
|
||||
add("column0", pvString)->
|
||||
addColumn("column0", pvDouble)->
|
||||
addColumn("column0", pvString)->
|
||||
createStructure();
|
||||
testFail("duplicate column name");
|
||||
} catch (std::runtime_error &) {
|
||||
@ -81,9 +81,9 @@ void test_labels()
|
||||
testOk(builder.get() != 0, "Got builder");
|
||||
|
||||
PVStructurePtr pvStructure = builder->
|
||||
add("column0", pvDouble)->
|
||||
add("column1", pvString)->
|
||||
add("column2", pvInt)->
|
||||
addColumn("column0", pvDouble)->
|
||||
addColumn("column1", pvString)->
|
||||
addColumn("column2", pvInt)->
|
||||
createPVStructure();
|
||||
testOk1(pvStructure.get() != 0);
|
||||
if (!pvStructure)
|
||||
@ -110,9 +110,9 @@ void test_nttable()
|
||||
testOk(builder.get() != 0, "Got builder");
|
||||
|
||||
NTTablePtr ntTable = builder->
|
||||
add("column0", pvDouble)->
|
||||
add("column1", pvString)->
|
||||
add("column2", pvInt)->
|
||||
addColumn("column0", pvDouble)->
|
||||
addColumn("column1", pvString)->
|
||||
addColumn("column2", pvInt)->
|
||||
addDescriptor()->
|
||||
addAlarm()->
|
||||
addTimeStamp()->
|
||||
@ -220,9 +220,9 @@ void test_wrap()
|
||||
testOk(builder.get() != 0, "Got builder");
|
||||
|
||||
PVStructurePtr pvStructure = builder->
|
||||
add("column0", pvDouble)->
|
||||
add("column1", pvString)->
|
||||
add("column2", pvInt)->
|
||||
addColumn("column0", pvDouble)->
|
||||
addColumn("column1", pvString)->
|
||||
addColumn("column2", pvInt)->
|
||||
createPVStructure();
|
||||
testOk1(pvStructure.get() != 0);
|
||||
if (!pvStructure)
|
||||
|
Reference in New Issue
Block a user