return StringArray instead of StringArray & for choices
This commit is contained in:
@@ -88,14 +88,13 @@ bool PVEnumerated::choicesMutable()
|
||||
return pvChoices->isImmutable();
|
||||
}
|
||||
|
||||
StringArray& PVEnumerated:: getChoices()
|
||||
StringArray PVEnumerated:: getChoices()
|
||||
{
|
||||
if(pvIndex.get()==NULL ) {
|
||||
throw std::logic_error(notAttached);
|
||||
}
|
||||
StringArrayData data;
|
||||
pvChoices->get(0,pvChoices->getLength(),data);
|
||||
printf("getChoices %p size %d\n",&data.data,data.data.size());
|
||||
return data.data;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
int32 getIndex();
|
||||
String getChoice();
|
||||
bool choicesMutable();
|
||||
StringArray & getChoices();
|
||||
StringArray getChoices();
|
||||
int32 getNumberChoices();
|
||||
bool setChoices(StringArray & choices);
|
||||
private:
|
||||
|
||||
@@ -214,13 +214,8 @@ static void testEnumerated(FILE * fd,FILE *auxfd)
|
||||
assert(result);
|
||||
int32 index = pvEnumerated.getIndex();
|
||||
String choice = pvEnumerated.getChoice();
|
||||
StringArray &choices = pvEnumerated.getChoices();
|
||||
StringArray choices = pvEnumerated.getChoices();
|
||||
int32 numChoices = pvEnumerated.getNumberChoices();
|
||||
printf("%p size %d numChoices %d\n",&choices,choices.size(),numChoices);
|
||||
for(int i=0; i<numChoices; i++ ) {
|
||||
String xxx = choices[i];
|
||||
printf("i %d %s\n",i,xxx.c_str());
|
||||
}
|
||||
fprintf(fd,"index %d choice %s choices",index,choice.c_str());
|
||||
for(int i=0; i<numChoices; i++ ) fprintf(fd," %s",choices[i].c_str());
|
||||
fprintf(fd,"\n");
|
||||
|
||||
Reference in New Issue
Block a user