pvMisc
- BitSetUtil
- MultiChoice
@@ -297,8 +297,8 @@ appear under pvDataApp:
This section describes a meta language for describing pvData. Currently
-there are no plans for any software, e.g. a parser, for the meta language. It
-is only meant for documentation. Note that the toString methods described
+there are no plans for a parser for the meta language. It is used for
+documentation. Also the toString introspection and data methods described
below do present data in this format.
Definition
@@ -356,7 +356,9 @@ line is a comment.
...
or
-
structureName fieldName = {values}
+ structureName fieldName
+ fieldDef
+ ...
For structure fieldName each
fieldDef must have a unique
@@ -368,13 +370,15 @@ line is a comment.
top level structure
structureArray
A structureArray field has the definition:
- structure[] structureName fieldName = {values}
+ structure[] fieldName
+ structureDef
+ ...
+
- where structureName must be
- fieldName of a previously
- defined top level structure
Thus a structure array is an array where each element is a structure
- but all elements have the same introspection interface.
+ but all elements have the same introspection interface. For
+ introspection the structureDef appears once without and data
+ valuies.
Each field can optionally have data values assigned to it. The definition
@@ -398,7 +402,7 @@ whatever is valid for the type.
xxx" are valid values.
-For arrays the syntax is:
+For scalar arrays the syntax is:
= [value,...,value]
where each value is a valid
@@ -406,17 +410,6 @@ scalar data value depending on the type. Thus it is a comma separated set of
values enclosed in [] White space
is permitted surrounding each comma.
-For a structure the syntax is:
- { fieldValue,...,fieldValue }
-
-where each fieldValue is a
-valid field value depending on the type. Thus it is a comma separated set of
-values enclosed in {} White space
-is permitted surrounding each comma.
-
-A structureArray was the form:
- [ {structureValue},...,{structureValue}]
-
Example
Define the following top level structure:
@@ -438,15 +431,20 @@ structure point
double y
structure lineExample
- point begin = {0,0}
- point end = {10,10}
+ point begin
+ x 0
+ y 0
+ point end
+ x 10
+ y 10
-structure structureArrayExample
- stucture[] point points =
- [
- {0,0},
- {10,10}
- ]
+structure[] structureArrayExample
+ structure point
+ double x 0.0
+ double y 0.0
+ structure point
+ double x 10.0
+ double y 10.0
PV - User Description
@@ -1817,6 +1815,7 @@ public:
int64 toLong(PVScalar *pv);
float toFloat(PVScalar *pv);
double toDouble(PVScalar *pv);
+ String toString(PVScalar *pv);
void fromByte(PVScalar *pv,int8 from);
void fromShort(PVScalar *pv,int16 from);
void fromInt(PVScalar *pv, int32 from);
@@ -2336,6 +2335,8 @@ public:
operator>=
operator>
Standard C++ operators.
+ diff
+ diff = a - b
getMilliseconds
Get the nunber of milliseconds since the epoch.
@@ -2369,10 +2370,11 @@ public:
//returns (false,true) if pvField(isNot, is valid timeStamp structure
bool attach(PVField *pvField);
void detach();
+ bool isAttached();
// following throw logic_error if not attached to PVField
// a set returns false if field is immutable
- TimeStamp get() const;
- bool set(TimeStamp timeStamp);
+ void get(TimeStamp &) const;
+ bool set(TimeStamp const & timeStamp);
};
where
@@ -2388,6 +2390,8 @@ public:
looks up the parent structure tree.
detach
Detach from the pvData structure.
+ isAttached
+ Is there an attachment to a timeStamp structure?
get
Copies data from the pvData structure to a TimeStamp. An exception is
thrown if not attached to a pvData structure.
@@ -2474,10 +2478,11 @@ public:
//An automatic detach is issued if already attached.
bool attach(PVField *pvField);
void detach();
+ bool isAttached();
// each of the following throws logic_error is not attached to PVField
// set returns false if field is immutable
- Alarm get() const;
- bool set(Alarm alarm);
+ void get(Alarm &) const;
+ bool set(Alarm const & alarm);
};
where
@@ -2494,6 +2499,8 @@ public:
structure.
detach
Just detaches from the pvData structure.
+ isAttached
+ Is there an attachment to an alarm structure?
get
Copies data from the pvData structure to an Alarm. An exception is
thrown if not attached to a pvData structure.
@@ -2555,10 +2562,11 @@ public:
//An automatic detach is issued if already attached.
bool attach(PVField *pvField);
void detach();
+ bool isAttached();
// each of the following throws logic_error is not attached to PVField
// set returns false if field is immutable
- Control get() const;
- bool set(Control control);
+ void get(Control &) const;
+ bool set(Control const & control);
};
where
@@ -2575,6 +2583,8 @@ public:
structure.
detach
Just detaches from the pvData structure.
+ isAttached
+ Is there an attachment to a control structure?
get
Copies data from the pvData structure to a Control. An exception is
thrown if not attached to a pvData structure.
@@ -2657,10 +2667,11 @@ public:
//An automatic detach is issued if already attached.
bool attach(PVField *pvField);
void detach();
+ bool isAttached();
// each of the following throws logic_error is not attached to PVField
// a set returns false if field is immutable
- Display get() const;
- bool set(Display display);
+ void get(Display &) const;
+ bool set(Display const & display);
};
where
@@ -2677,6 +2688,8 @@ public:
structure.
detach
Just detaches from the pvData structure.
+ isAttached
+ Is there an attachment to a display structure?
get
Copies data from the pvData structure to a Display. An exception is
thrown if not attached to a pvData structure.
@@ -2703,6 +2716,7 @@ public:
//An automatic detach is issued if already attached.
bool attach(PVField *pvField);
void detach();
+ bool isAttached();
// each of the following throws logic_error is not attached to PVField
// a set returns false if field is immutable
bool setIndex(int32 index);
@@ -2725,6 +2739,8 @@ public:
pvField (is not, is) an enumerated structure.
detach
Just detaches from the pvData structure.
+ isAttached
+ Is there an attachment to an enemerated structure?
setIndex
Set the index field in the pvData structure. An exception is thrown
if not attached to a pvData structure.
diff --git a/pvDataApp/factory/Convert.cpp b/pvDataApp/factory/Convert.cpp
index 3ce20e4..54ce60d 100644
--- a/pvDataApp/factory/Convert.cpp
+++ b/pvDataApp/factory/Convert.cpp
@@ -856,6 +856,63 @@ double Convert::toDouble(PVScalar * pv)
throw std::logic_error(logicError);
}
+String Convert::toString(PVScalar * pv)
+{
+ static String trueString("true");
+ static String falseString("false");
+
+ ScalarConstPtr scalar = pv->getScalar();
+ ScalarType scalarType = scalar->getScalarType();
+ switch(scalarType) {
+ case pvBoolean: {
+ PVBoolean *pvalue = static_cast(pv);
+ bool value = pvalue->get();
+ return value ? trueString : falseString;
+ }
+ case pvByte: {
+ PVByte *value = static_cast(pv);
+ char buffer[30];
+ sprintf(buffer,"%d",(int)value->get());
+ return String(buffer);
+ }
+ case pvShort: {
+ PVShort *value = static_cast(pv);
+ char buffer[30];
+ sprintf(buffer,"%d",(int)value->get());
+ return String(buffer);
+ }
+ case pvInt: {
+ PVInt *value = static_cast(pv);
+ char buffer[30];
+ sprintf(buffer,"%d",value->get());
+ return String(buffer);
+ }
+ case pvLong: {
+ PVLong *value = static_cast(pv);
+ char buffer[30];
+ sprintf(buffer,"%lli",value->get());
+ return String(buffer);
+ }
+ case pvFloat: {
+ PVFloat *value = static_cast(pv);
+ char buffer[30];
+ sprintf(buffer,"%g",value->get());
+ return String(buffer);
+ }
+ case pvDouble: {
+ PVDouble *value = static_cast(pv);
+ char buffer[30];
+ sprintf(buffer,"%lg",value->get());
+ return String(buffer);
+ }
+ case pvString: {
+ PVString *value = static_cast(pv);
+ return value->get();
+ }
+ }
+ throw std::logic_error(logicError);
+}
+
void Convert::fromByte(PVScalar *pv,int8 from)
{
ScalarConstPtr scalar = pv->getScalar();
@@ -3077,15 +3134,19 @@ void convertToString(StringBuilder buffer,PVField * pv,int indentLevel)
{
Type type = pv->getField()->getType();
if(type==scalarArray) {
- return convertArray(buffer,(PVScalarArray *)pv,indentLevel);
+ convertArray(buffer,static_cast(pv),indentLevel);
+ return;
}
if(type==structure) {
- return convertStructure(buffer,(PVStructure*)pv,indentLevel);
+ convertStructure(buffer,static_cast(pv),indentLevel);
+ return;
}
if(type==structureArray) {
- return convertStructureArray(buffer,(PVStructureArray*)pv,indentLevel);
+ convertStructureArray(
+ buffer,static_cast(pv),indentLevel);
+ return;
}
- PVScalar *pvScalar = (PVScalar*)pv;
+ PVScalar *pvScalar = static_cast(pv);
ScalarConstPtr pscalar = pvScalar->getScalar();
ScalarType scalarType = pscalar->getScalarType();
ScalarTypeFunc::toString(buffer,scalarType);
@@ -3094,7 +3155,7 @@ void convertToString(StringBuilder buffer,PVField * pv,int indentLevel)
*buffer += " ";
switch(scalarType) {
case pvBoolean: {
- PVBoolean *data = (PVBoolean*)pv;
+ PVBoolean *data = static_cast(pv);
bool value = data->get();
if(value) {
*buffer += "true";
@@ -3104,49 +3165,49 @@ void convertToString(StringBuilder buffer,PVField * pv,int indentLevel)
}
return;
case pvByte: {
- PVByte *data = (PVByte*)pv;
+ PVByte *data = static_cast(pv);
char xxx[30];
sprintf(xxx,"%d",(int)data->get());
*buffer += xxx;
}
return;
case pvShort: {
- PVShort *data = (PVShort*)pv;
+ PVShort *data = static_cast(pv);
char xxx[30];
sprintf(xxx,"%d",(int)data->get());
*buffer += xxx;
}
return;
case pvInt: {
- PVInt *data = (PVInt*)pv;
+ PVInt *data = static_cast(pv);
char xxx[30];
sprintf(xxx,"%d",(int)data->get());
*buffer += xxx;
}
return;
case pvLong: {
- PVLong *data = (PVLong*)pv;
+ PVLong *data = static_cast(pv);
char xxx[30];
sprintf(xxx,"%lld",(int64)data->get());
*buffer += xxx;
}
return;
case pvFloat: {
- PVFloat *data = (PVFloat*)pv;
+ PVFloat *data = static_cast(pv);
char xxx[30];
sprintf(xxx,"%g",data->get());
*buffer += xxx;
}
return;
case pvDouble: {
- PVDouble *data = (PVDouble*)pv;
+ PVDouble *data = static_cast(pv);
char xxx[30];
sprintf(xxx,"%lg",data->get());
*buffer += xxx;
}
return;
case pvString: {
- PVString *data = (PVString*)pv;
+ PVString *data = static_cast(pv);
*buffer += data->get();
}
return;
@@ -3157,16 +3218,21 @@ void convertToString(StringBuilder buffer,PVField * pv,int indentLevel)
void convertStructure(StringBuilder buffer,PVStructure *data,int indentLevel)
{
- *buffer += "structure ";
+ String extendsName = data->getExtendsStructureName();
+ if(extendsName.length()<=0) {
+ *buffer += "structure ";
+ } else {
+ *buffer += extendsName;
+ *buffer += " ";
+ }
*buffer += data->getField()->getFieldName();
- convert->newLine(buffer, indentLevel+1);
PVFieldPtrArray fieldsData = data->getPVFields();
if (fieldsData != 0) {
int length = data->getStructure()->getNumberFields();
for(int i=0; inewLine(buffer, indentLevel+1);
PVField *fieldField = fieldsData[i];
fieldField->toString(buffer,indentLevel + 1);
- if(inewLine(buffer, indentLevel+1);
}
}
}
@@ -3176,7 +3242,7 @@ void convertArray(StringBuilder buffer,PVScalarArray * pv,int indentLevel)
ScalarArrayConstPtr array = pv->getScalarArray();
ScalarType type = array->getElementType();
ScalarTypeFunc::toString(buffer,type);
- *buffer += "Array ";
+ *buffer += "[] ";
*buffer += array->getFieldName();
*buffer += " ";
switch(type) {
@@ -3347,22 +3413,16 @@ void convertArray(StringBuilder buffer,PVScalarArray * pv,int indentLevel)
void convertStructureArray(StringBuilder buffer,
PVStructureArray * pvdata,int indentLevel)
{
- *buffer += "structureArray ";
+ *buffer += "structure[] ";
*buffer += pvdata->getField()->getFieldName();
*buffer += " ";
- StructureArrayData data = StructureArrayData();
int length = pvdata->getLength();
- pvdata->get(0, length, &data);
if(length<=0) {
- *buffer += " []";
return;
}
- convert->newLine(buffer, indentLevel);
- *buffer += "[";
+ StructureArrayData data = StructureArrayData();
+ pvdata->get(0, length, &data);
for (int i = 0; i < length; i++) {
- if (i != 0) {
- *buffer += ",";
- }
convert->newLine(buffer, indentLevel + 1);
PVStructure *pvStructure = data.data[i];
if (pvStructure == 0) {
@@ -3371,8 +3431,6 @@ void convertStructureArray(StringBuilder buffer,
pvStructure->toString(buffer,indentLevel+1);
}
}
- convert->newLine(buffer, indentLevel);
- *buffer += "]";
}
int copyArrayDataReference(PVScalarArray *from,PVArray *to)
diff --git a/pvDataApp/factory/FieldCreateFactory.cpp b/pvDataApp/factory/FieldCreateFactory.cpp
index 401bfd5..13b69bb 100644
--- a/pvDataApp/factory/FieldCreateFactory.cpp
+++ b/pvDataApp/factory/FieldCreateFactory.cpp
@@ -135,10 +135,8 @@ ScalarArray::ScalarArray(String fieldName,ScalarType elementType)
ScalarArray::~ScalarArray() {}
void ScalarArray::toString(StringBuilder buffer,int indentLevel) const{
- String temp = String();
- ScalarTypeFunc::toString(&temp,elementType);
- temp += "Array";
- *buffer += temp;
+ ScalarTypeFunc::toString(buffer,elementType);
+ *buffer += "[]";
Field::toString(buffer,indentLevel);
}
@@ -154,7 +152,7 @@ StructureArray::~StructureArray() {
}
void StructureArray::toString(StringBuilder buffer,int indentLevel) const {
- *buffer += " structureArray ";
+ *buffer += "structure[]";
Field::toString(buffer,indentLevel);
newLine(buffer,indentLevel + 1);
pstructure->toString(buffer,indentLevel + 1);
diff --git a/pvDataApp/factory/PVAuxInfoImpl.cpp b/pvDataApp/factory/PVAuxInfoImpl.cpp
index f08533d..0607881 100644
--- a/pvDataApp/factory/PVAuxInfoImpl.cpp
+++ b/pvDataApp/factory/PVAuxInfoImpl.cpp
@@ -124,6 +124,7 @@ void PVAuxInfo::toString(StringBuilder buf)
void PVAuxInfo::toString(StringBuilder buf,int indentLevel)
{
+ if(pImpl->theMap.empty()) return;
Convert *convert = getConvert();
convert->newLine(buf,indentLevel);
*buf += "auxInfo";
@@ -132,9 +133,6 @@ void PVAuxInfo::toString(StringBuilder buf,int indentLevel)
convert->newLine(buf,indentLevel+1);
String key = i->first;
PVScalar *value = i->second;
- *buf += "key(";
- *buf += key.c_str();
- *buf += ") ";
value->toString(buf,indentLevel + 1);
i++;
}
diff --git a/pvDataApp/factory/StandardPVField.cpp b/pvDataApp/factory/StandardPVField.cpp
index 0b96f6e..d8b1268 100644
--- a/pvDataApp/factory/StandardPVField.cpp
+++ b/pvDataApp/factory/StandardPVField.cpp
@@ -21,6 +21,34 @@ static PVDataCreate* pvDataCreate = 0;
static StandardField *standardField = 0;
static StandardPVField *standardPVField = 0;
+static void addExtendsStructureName(PVStructure *pvStructure,String properties)
+{
+ bool gotAlarm = false;
+ bool gotTimeStamp = false;
+ bool gotDisplay = false;
+ bool gotControl = false;
+ if(properties.find("alarm")!=String::npos) gotAlarm = true;
+ if(properties.find("timeStamp")!=String::npos) gotTimeStamp = true;
+ if(properties.find("display")!=String::npos) gotDisplay = true;
+ if(properties.find("control")!=String::npos) gotControl = true;
+ if(gotAlarm) {
+ PVStructure *pv = pvStructure->getStructureField(String("alarm"));
+ if(pv!=0) pv->putExtendsStructureName(String("alarm"));
+ }
+ if(gotTimeStamp) {
+ PVStructure *pv = pvStructure->getStructureField(String("timeStamp"));
+ if(pv!=0) pv->putExtendsStructureName(String("timeStamp"));
+ }
+ if(gotDisplay) {
+ PVStructure *pv = pvStructure->getStructureField(String("display"));
+ if(pv!=0) pv->putExtendsStructureName(String("display"));
+ }
+ if(gotControl) {
+ PVStructure *pv = pvStructure->getStructureField(String("control"));
+ if(pv!=0) pv->putExtendsStructureName(String("control"));
+ }
+}
+
StandardPVField::StandardPVField(){}
StandardPVField::~StandardPVField(){}
@@ -37,7 +65,9 @@ PVStructure * StandardPVField::scalar(PVStructure *parent,
String fieldName,ScalarType type,String properties)
{
StructureConstPtr field = standardField->scalar(fieldName,type,properties);
- return pvDataCreate->createPVStructure(parent,field);
+ PVStructure * pvStructure = pvDataCreate->createPVStructure(parent,field);
+ addExtendsStructureName(pvStructure,properties);
+ return pvStructure;
}
PVScalarArray * StandardPVField::scalarArray(PVStructure *parent,
@@ -53,7 +83,9 @@ PVStructure * StandardPVField::scalarArray(PVStructure *parent,
{
StructureConstPtr field = standardField->scalarArray(
fieldName,elementType,properties);
- return pvDataCreate->createPVStructure(parent,field);
+ PVStructure * pvStructure = pvDataCreate->createPVStructure(parent,field);
+ addExtendsStructureName(pvStructure,properties);
+ return pvStructure;
}
PVStructureArray * StandardPVField::structureArray(PVStructure *parent,
@@ -69,7 +101,9 @@ PVStructure* StandardPVField::structureArray(PVStructure *parent,
{
StructureConstPtr field = standardField->structureArray(
fieldName,structure,properties);
- return pvDataCreate->createPVStructure(parent,field);
+ PVStructure * pvStructure = pvDataCreate->createPVStructure(parent,field);
+ addExtendsStructureName(pvStructure,properties);
+ return pvStructure;
}
PVStructure * StandardPVField::enumerated(PVStructure *parent,
@@ -93,6 +127,7 @@ PVStructure * StandardPVField::enumerated(PVStructure *parent,
StructureConstPtr field = standardField->enumerated(
fieldName,properties);
PVStructure *pvStructure = pvDataCreate->createPVStructure(parent,field);
+ addExtendsStructureName(pvStructure,properties);
PVScalarArray *pvScalarArray = pvStructure->getScalarArrayField(
fieldName += ".choices",pvString);
if(pvScalarArray==0) {
@@ -114,7 +149,9 @@ PVStructure * StandardPVField::scalarValue(PVStructure *parent,
ScalarType type,String properties)
{
StructureConstPtr field = standardField->scalarValue(type,properties);
- return pvDataCreate->createPVStructure(parent,field);
+ PVStructure * pvStructure = pvDataCreate->createPVStructure(parent,field);
+ addExtendsStructureName(pvStructure,properties);
+ return pvStructure;
}
PVScalarArray * StandardPVField::scalarArrayValue(PVStructure *parent,
@@ -130,7 +167,9 @@ PVStructure * StandardPVField::scalarArrayValue(PVStructure *parent,
{
StructureConstPtr field = standardField->scalarArrayValue(
elementType,properties);
- return pvDataCreate->createPVStructure(parent,field);
+ PVStructure * pvStructure = pvDataCreate->createPVStructure(parent,field);
+ addExtendsStructureName(pvStructure,properties);
+ return pvStructure;
}
PVStructureArray * StandardPVField::structureArrayValue(PVStructure *parent,
@@ -146,7 +185,9 @@ PVStructure * StandardPVField::structureArrayValue(PVStructure *parent,
{
StructureConstPtr field = standardField->structureArrayValue(
structure,properties);
- return pvDataCreate->createPVStructure(parent,field);
+ PVStructure * pvStructure = pvDataCreate->createPVStructure(parent,field);
+ addExtendsStructureName(pvStructure,properties);
+ return pvStructure;
}
PVStructure * StandardPVField::enumeratedValue(PVStructure *parent,
@@ -169,6 +210,7 @@ PVStructure * StandardPVField::enumeratedValue(PVStructure *parent,
{
StructureConstPtr field = standardField->enumeratedValue( properties);
PVStructure *pvStructure = pvDataCreate->createPVStructure(parent,field);
+ addExtendsStructureName(pvStructure,properties);
PVScalarArray *pvScalarArray = pvStructure->getScalarArrayField(
String("value.choices"),pvString);
if(pvScalarArray==0) {
diff --git a/pvDataApp/property/pvAlarm.cpp b/pvDataApp/property/pvAlarm.cpp
index eb4b418..c9ef5a0 100644
--- a/pvDataApp/property/pvAlarm.cpp
+++ b/pvDataApp/property/pvAlarm.cpp
@@ -61,18 +61,22 @@ void PVAlarm::detach()
pvMessage = 0;
}
-Alarm PVAlarm::get() const
+bool PVAlarm::isAttached()
+{
+ if(pvSeverity==0 || pvMessage==0) return false;
+ return true;
+}
+
+void PVAlarm::get(Alarm & alarm) const
{
if(pvSeverity==0 || pvMessage==0) {
throw std::logic_error(notAttached);
}
- Alarm alarm;
alarm.setSeverity(AlarmSeverityFunc::getSeverity(pvSeverity->get()));
alarm.setMessage(pvMessage->get());
- return alarm;
}
-bool PVAlarm::set(Alarm alarm)
+bool PVAlarm::set(Alarm const & alarm)
{
if(pvSeverity==0 || pvMessage==0) {
throw std::logic_error(notAttached);
diff --git a/pvDataApp/property/pvAlarm.h b/pvDataApp/property/pvAlarm.h
index 49f99b4..55101b3 100644
--- a/pvDataApp/property/pvAlarm.h
+++ b/pvDataApp/property/pvAlarm.h
@@ -19,10 +19,11 @@ public:
//An automatic detach is issued if already attached.
bool attach(PVField *pvField);
void detach();
+ bool isAttached();
// each of the following throws logic_error is not attached to PVField
// set returns false if field is immutable
- Alarm get() const;
- bool set(Alarm alarm);
+ void get(Alarm & alarm) const;
+ bool set(Alarm const & alarm);
private:
PVInt *pvSeverity;
PVString *pvMessage;
diff --git a/pvDataApp/property/pvControl.cpp b/pvDataApp/property/pvControl.cpp
index 19f3bc3..47272b1 100644
--- a/pvDataApp/property/pvControl.cpp
+++ b/pvDataApp/property/pvControl.cpp
@@ -62,18 +62,21 @@ void PVControl::detach()
pvHigh = 0;
}
-Control PVControl::get() const
+bool PVControl::isAttached(){
+ if(pvLow==0 || pvHigh==0) return false;
+ return true;
+}
+
+void PVControl::get(Control &control) const
{
if(pvLow==0 || pvHigh==0) {
throw std::logic_error(notAttached);
}
- Control control;
control.setLow(pvLow->get());
control.setHigh(pvHigh->get());
- return control;
}
-bool PVControl::set(Control control)
+bool PVControl::set(Control const & control)
{
if(pvLow==0 || pvHigh==0) {
throw std::logic_error(notAttached);
diff --git a/pvDataApp/property/pvControl.h b/pvDataApp/property/pvControl.h
index 952c2c3..9e49481 100644
--- a/pvDataApp/property/pvControl.h
+++ b/pvDataApp/property/pvControl.h
@@ -18,10 +18,11 @@ public:
//An automatic detach is issued if already attached.
bool attach(PVField *pvField);
void detach();
+ bool isAttached();
// each of the following throws logic_error is not attached to PVField
// set returns false if field is immutable
- Control get() const;
- bool set(Control control);
+ void get(Control &) const;
+ bool set(Control const & control);
private:
PVDouble *pvLow;
PVDouble *pvHigh;
diff --git a/pvDataApp/property/pvDisplay.cpp b/pvDataApp/property/pvDisplay.cpp
index 6b1165c..67d39f0 100644
--- a/pvDataApp/property/pvDisplay.cpp
+++ b/pvDataApp/property/pvDisplay.cpp
@@ -81,27 +81,33 @@ void PVDisplay::detach()
pvHigh = 0;
}
-Display PVDisplay::get() const
+bool PVDisplay::isAttached() {
+ if(pvDescription==0 || pvFormat==0 || pvUnits==0 || pvLow==0 || pvHigh==0)
+ return false;
+ return true;
+}
+
+void PVDisplay::get(Display & display) const
{
if(pvDescription==0 || pvFormat==0 || pvUnits==0 || pvLow==0 || pvHigh==0) {
throw std::logic_error(notAttached);
}
- Display display;
display.setDescription(pvDescription->get());
display.setFormat(pvFormat->get());
display.setUnits(pvUnits->get());
display.setLow(pvLow->get());
display.setHigh(pvHigh->get());
- return display;
}
-bool PVDisplay::set(Display display)
+bool PVDisplay::set(Display const & display)
{
if(pvDescription==0 || pvFormat==0 || pvUnits==0 || pvLow==0 || pvHigh==0) {
throw std::logic_error(notAttached);
}
if(pvDescription->isImmutable() || pvFormat->isImmutable()) return false;
- if(pvUnits->isImmutable() || pvLow->isImmutable() || pvHigh->isImmutable()) return false;
+ if(pvUnits->isImmutable() || pvLow->isImmutable() || pvHigh->isImmutable())
+ return false;
+
pvDescription->put(display.getDescription());
pvFormat->put(display.getFormat());
pvUnits->put(display.getUnits());
diff --git a/pvDataApp/property/pvDisplay.h b/pvDataApp/property/pvDisplay.h
index ff1947d..8625a01 100644
--- a/pvDataApp/property/pvDisplay.h
+++ b/pvDataApp/property/pvDisplay.h
@@ -20,10 +20,11 @@ public:
//An automatic detach is issued if already attached.
bool attach(PVField *pvField);
void detach();
+ bool isAttached();
// each of the following throws logic_error is not attached to PVField
// a set returns false if field is immutable
- Display get() const;
- bool set(Display display);
+ void get(Display &) const;
+ bool set(Display const & display);
private:
PVString *pvDescription;
PVString *pvFormat;
diff --git a/pvDataApp/property/pvEnumerated.cpp b/pvDataApp/property/pvEnumerated.cpp
index f2b28af..a071647 100644
--- a/pvDataApp/property/pvEnumerated.cpp
+++ b/pvDataApp/property/pvEnumerated.cpp
@@ -25,7 +25,7 @@ bool PVEnumerated::attach(PVField *pvField)
}
PVStructure *pvStructure = static_cast(pvField);
PVInt *pvInt = pvStructure->getIntField(String("index"));
- if(pvLong==0) {
+ if(pvInt==0) {
pvField->message(notEnumerated,errorMessage);
return false;
}
@@ -46,6 +46,11 @@ void PVEnumerated::detach()
pvChoices = 0;
}
+bool PVEnumerated::isAttached() {
+ if(pvIndex==0 || pvChoices==0) return false;
+ return true;
+}
+
bool PVEnumerated::setIndex(int32 index)
{
if(pvIndex==0 || pvChoices==0) {
diff --git a/pvDataApp/property/pvEnumerated.h b/pvDataApp/property/pvEnumerated.h
index 8bddbdc..45974e3 100644
--- a/pvDataApp/property/pvEnumerated.h
+++ b/pvDataApp/property/pvEnumerated.h
@@ -20,6 +20,7 @@ public:
//An automatic detach is issued if already attached.
bool attach(PVField *pvField);
void detach();
+ bool isAttached();
// each of the following throws logic_error is not attached to PVField
// a set returns false if field is immutable
bool setIndex(int32 index);
diff --git a/pvDataApp/property/pvTimeStamp.cpp b/pvDataApp/property/pvTimeStamp.cpp
index b358896..1e6d04f 100644
--- a/pvDataApp/property/pvTimeStamp.cpp
+++ b/pvDataApp/property/pvTimeStamp.cpp
@@ -69,17 +69,20 @@ void PVTimeStamp::detach()
pvNano = 0;
}
-TimeStamp PVTimeStamp::get() const
+bool PVTimeStamp::isAttached() {
+ if(pvSecs==0 || pvNano==0) return false;
+ return true;
+}
+
+void PVTimeStamp::get(TimeStamp & timeStamp) const
{
if(pvSecs==0 || pvNano==0) {
throw std::logic_error(notAttached);
}
- TimeStamp timeStamp;
timeStamp.put(pvSecs->get(),pvNano->get());
- return timeStamp;
}
-bool PVTimeStamp::set(TimeStamp timeStamp)
+bool PVTimeStamp::set(TimeStamp const & timeStamp)
{
if(pvSecs==0 || pvNano==0) {
throw std::logic_error(notAttached);
diff --git a/pvDataApp/property/pvTimeStamp.h b/pvDataApp/property/pvTimeStamp.h
index 2c3eb48..635df2b 100644
--- a/pvDataApp/property/pvTimeStamp.h
+++ b/pvDataApp/property/pvTimeStamp.h
@@ -22,10 +22,11 @@ public:
//returns (false,true) if pvField(isNot, is valid timeStamp structure
bool attach(PVField *pvField);
void detach();
+ bool isAttached();
// following throw logic_error is not attached to PVField
// a set returns false if field is immutable
- TimeStamp get() const;
- bool set(TimeStamp timeStamp);
+ void get(TimeStamp &) const;
+ bool set(TimeStamp const & timeStamp);
private:
PVLong* pvSecs;
PVInt* pvNano;
diff --git a/pvDataApp/pv/convert.h b/pvDataApp/pv/convert.h
index 1544bc0..234f820 100644
--- a/pvDataApp/pv/convert.h
+++ b/pvDataApp/pv/convert.h
@@ -49,12 +49,13 @@ public:
int64 toLong(PVScalar *pv);
float toFloat(PVScalar *pv);
double toDouble(PVScalar *pv);
+ String toString(PVScalar *pv);
void fromByte(PVScalar *pv,int8 from);
- void fromShort(PVScalar *pv,int16 from);
- void fromInt(PVScalar *pv, int32 from);
- void fromLong(PVScalar *pv, int64 from);
- void fromFloat(PVScalar* pv, float from);
- void fromDouble(PVScalar *pv, double from);
+ void fromShort(PVScalar *pv,int16 from);
+ void fromInt(PVScalar *pv, int32 from);
+ void fromLong(PVScalar *pv, int64 from);
+ void fromFloat(PVScalar* pv, float from);
+ void fromDouble(PVScalar *pv, double from);
int toByteArray(PVScalarArray *pv, int offset, int length,
ByteArray to, int toOffset);
int toShortArray(PVScalarArray *pv, int offset, int length,
diff --git a/test/testIntrospect b/test/testIntrospect
index 9de4a2d..e5aba72 100644
--- a/test/testIntrospect
+++ b/test/testIntrospect
@@ -10,14 +10,14 @@ double double
string string
testScalarArray
-booleanArray boolean
-byteArray byte
-shortArray short
-intArray int
-longArray long
-floatArray float
-doubleArray double
-stringArray string
+boolean[] boolean
+byte[] byte
+short[] short
+int[] int
+long[] long
+float[] float
+double[] double
+string[] string
testSimpleStructure
structure value
@@ -54,7 +54,7 @@ structure value
testStructureArray
structure value
- structureArray value
+ structure[] value
structure powerSupply
structure voltage
double value
diff --git a/test/testIntrospectDiff b/test/testIntrospectDiff
index e69de29..7108e1a 100644
--- a/test/testIntrospectDiff
+++ b/test/testIntrospectDiff
@@ -0,0 +1,22 @@
+13,20c13,20
+< boolean[] boolean
+< byte[] byte
+< short[] short
+< int[] int
+< long[] long
+< float[] float
+< double[] double
+< string[] string
+---
+> booleanArray boolean
+> byteArray byte
+> shortArray short
+> intArray int
+> longArray long
+> floatArray float
+> doubleArray double
+> stringArray string
+57c57
+< structure[] value
+---
+> structureArray value
diff --git a/test/testLinkedListAux b/test/testLinkedListAux
index 4164288..26934c3 100644
--- a/test/testLinkedListAux
+++ b/test/testLinkedListAux
@@ -1,20 +1,20 @@
Time test
-diff 84.008528 milliSeconds
-time per iteration 84.008528 microseconds
-time per addTail/removeHead 0.042004 microseconds
+diff 27.283014 milliSeconds
+time per iteration 27.283014 microseconds
+time per addTail/removeHead 0.013642 microseconds
Time test locked
-diff 580.331337 milliSeconds
-time per iteration 580.331337 microseconds
-time per addTail/removeHead 0.290166 microseconds
+diff 174.127278 milliSeconds
+time per iteration 174.127278 microseconds
+time per addTail/removeHead 0.087064 microseconds
Time std::list test
-diff 2156.999667 milliSeconds
-time per iteration 2156.999667 microseconds
-time per addTail/removeHead 1.078500 microseconds
+diff 651.121969 milliSeconds
+time per iteration 651.121969 microseconds
+time per addTail/removeHead 0.325561 microseconds
Time std::list test locked
-diff 2675.507176 milliSeconds
-time per iteration 2675.507176 microseconds
-time per addTail/removeHead 1.337754 microseconds
+diff 800.277269 milliSeconds
+time per iteration 800.277269 microseconds
+time per addTail/removeHead 0.400139 microseconds
diff --git a/test/testPVAuxInfo b/test/testPVAuxInfo
index cd08a3d..0ea79ff 100644
--- a/test/testPVAuxInfo
+++ b/test/testPVAuxInfo
@@ -2,13 +2,13 @@
testPVAuxInfo
structure value
double value 0
- structure alarm
+ alarm alarm
int severity 0
string message
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 0
int nanoSeconds 0
- structure display
+ display display
string description
string format
string units
@@ -16,8 +16,8 @@ structure value
double low 0
double high 0
auxInfo
- key(factory) string factory factoryName
- key(junk) double junk 3
+ string factory factoryName
+ double junk 3
value offset 0 next 15 number 15
value offset 1 next 2 number 1
alarm offset 2 next 5 number 3
diff --git a/test/testPVAuxInfoDiff b/test/testPVAuxInfoDiff
index e69de29..58f9a80 100644
--- a/test/testPVAuxInfoDiff
+++ b/test/testPVAuxInfoDiff
@@ -0,0 +1,18 @@
+5c5
+< alarm alarm
+---
+> structure alarm
+8c8
+< timeStamp timeStamp
+---
+> structure timeStamp
+11c11
+< display display
+---
+> structure display
+19,20c19,20
+< string factory factoryName
+< double junk 3
+---
+> key(factory) string factory factoryName
+> key(junk) double junk 3
diff --git a/test/testPVData b/test/testPVData
index 895db48..8199210 100644
--- a/test/testPVData
+++ b/test/testPVData
@@ -10,10 +10,10 @@ double double 10
string string 10
structure boolean
boolean value true
- structure alarm
+ alarm alarm
int severity 2
string message messageForAlarm
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 123456789
int nanoSeconds 1000000
structure valueAlarm
@@ -23,20 +23,20 @@ structure boolean
int changeStateSeverity 0
structure byte
byte value 127
- structure alarm
+ alarm alarm
int severity 2
string message messageForAlarm
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 123456789
int nanoSeconds 1000000
- structure display
+ display display
string description this is a description
string format f10.2
string units SomeUnits
structure limit
double low 0
double high 10
- structure control
+ control control
structure limit
double low 1
double high 9
@@ -54,20 +54,20 @@ structure byte
byte hystersis 0
structure short
short value 32767
- structure alarm
+ alarm alarm
int severity 2
string message messageForAlarm
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 123456789
int nanoSeconds 1000000
- structure display
+ display display
string description this is a description
string format f10.2
string units SomeUnits
structure limit
double low 0
double high 10
- structure control
+ control control
structure limit
double low 1
double high 9
@@ -85,20 +85,20 @@ structure short
short hystersis 0
structure int
int value -2147483648
- structure alarm
+ alarm alarm
int severity 2
string message messageForAlarm
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 123456789
int nanoSeconds 1000000
- structure display
+ display display
string description this is a description
string format f10.2
string units SomeUnits
structure limit
double low 0
double high 10
- structure control
+ control control
structure limit
double low 1
double high 9
@@ -116,20 +116,20 @@ structure int
int hystersis 0
structure long
long value -9223372032559808513
- structure alarm
+ alarm alarm
int severity 2
string message messageForAlarm
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 123456789
int nanoSeconds 1000000
- structure display
+ display display
string description this is a description
string format f10.2
string units SomeUnits
structure limit
double low 0
double high 10
- structure control
+ control control
structure limit
double low 1
double high 9
@@ -147,20 +147,20 @@ structure long
long hystersis 0
structure float
float value 1.123e+08
- structure alarm
+ alarm alarm
int severity 2
string message messageForAlarm
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 123456789
int nanoSeconds 1000000
- structure display
+ display display
string description this is a description
string format f10.2
string units SomeUnits
structure limit
double low 0
double high 10
- structure control
+ control control
structure limit
double low 1
double high 9
@@ -178,20 +178,20 @@ structure float
float hystersis 0
structure double
double value 1.123e+35
- structure alarm
+ alarm alarm
int severity 2
string message messageForAlarm
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 123456789
int nanoSeconds 1000000
- structure display
+ display display
string description this is a description
string format f10.2
string units SomeUnits
structure limit
double low 0
double high 10
- structure control
+ control control
structure limit
double low 1
double high 9
@@ -209,76 +209,76 @@ structure double
double hystersis 0
structure string
string value this is a string
- structure alarm
+ alarm alarm
int severity 2
string message messageForAlarm
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 123456789
int nanoSeconds 1000000
testScalarArray
structure boolean
- booleanArray value [true,false,true]
- structure alarm
+ boolean[] value [true,false,true]
+ alarm alarm
int severity 0
string message
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 0
int nanoSeconds 0
structure byte
- byteArray value [0,1,2]
- structure alarm
+ byte[] value [0,1,2]
+ alarm alarm
int severity 0
string message
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 0
int nanoSeconds 0
structure short
- shortArray value [0,1,2]
- structure alarm
+ short[] value [0,1,2]
+ alarm alarm
int severity 0
string message
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 0
int nanoSeconds 0
structure int
- intArray value [0,1,2]
- structure alarm
+ int[] value [0,1,2]
+ alarm alarm
int severity 0
string message
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 0
int nanoSeconds 0
structure long
- longArray value [0,1,2]
- structure alarm
+ long[] value [0,1,2]
+ alarm alarm
int severity 0
string message
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 0
int nanoSeconds 0
structure float
- floatArray value [0,1,2]
- structure alarm
+ float[] value [0,1,2]
+ alarm alarm
int severity 0
string message
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 0
int nanoSeconds 0
structure double
- doubleArray value [0,1,2]
- structure alarm
+ double[] value [0,1,2]
+ alarm alarm
int severity 0
string message
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 0
int nanoSeconds 0
structure string
- stringArray value [0,1,2]
- structure alarm
+ string[] value [0,1,2]
+ alarm alarm
int severity 0
string message
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 0
int nanoSeconds 0
linkedListNode: totalConstruct 5 totalDestruct 0
diff --git a/test/testPVDataDiff b/test/testPVDataDiff
index e69de29..4ddf165 100644
--- a/test/testPVDataDiff
+++ b/test/testPVDataDiff
@@ -0,0 +1,192 @@
+13c13
+< alarm alarm
+---
+> structure alarm
+16c16
+< timeStamp timeStamp
+---
+> structure timeStamp
+26c26
+< alarm alarm
+---
+> structure alarm
+29c29
+< timeStamp timeStamp
+---
+> structure timeStamp
+32c32
+< display display
+---
+> structure display
+39c39
+< control control
+---
+> structure control
+57c57
+< alarm alarm
+---
+> structure alarm
+60c60
+< timeStamp timeStamp
+---
+> structure timeStamp
+63c63
+< display display
+---
+> structure display
+70c70
+< control control
+---
+> structure control
+88c88
+< alarm alarm
+---
+> structure alarm
+91c91
+< timeStamp timeStamp
+---
+> structure timeStamp
+94c94
+< display display
+---
+> structure display
+101c101
+< control control
+---
+> structure control
+119c119
+< alarm alarm
+---
+> structure alarm
+122c122
+< timeStamp timeStamp
+---
+> structure timeStamp
+125c125
+< display display
+---
+> structure display
+132c132
+< control control
+---
+> structure control
+150c150
+< alarm alarm
+---
+> structure alarm
+153c153
+< timeStamp timeStamp
+---
+> structure timeStamp
+156c156
+< display display
+---
+> structure display
+163c163
+< control control
+---
+> structure control
+181c181
+< alarm alarm
+---
+> structure alarm
+184c184
+< timeStamp timeStamp
+---
+> structure timeStamp
+187c187
+< display display
+---
+> structure display
+194c194
+< control control
+---
+> structure control
+212c212
+< alarm alarm
+---
+> structure alarm
+215c215
+< timeStamp timeStamp
+---
+> structure timeStamp
+221,222c221,222
+< boolean[] value [true,false,true]
+< alarm alarm
+---
+> booleanArray value [true,false,true]
+> structure alarm
+225c225
+< timeStamp timeStamp
+---
+> structure timeStamp
+229,230c229,230
+< byte[] value [0,1,2]
+< alarm alarm
+---
+> byteArray value [0,1,2]
+> structure alarm
+233c233
+< timeStamp timeStamp
+---
+> structure timeStamp
+237,238c237,238
+< short[] value [0,1,2]
+< alarm alarm
+---
+> shortArray value [0,1,2]
+> structure alarm
+241c241
+< timeStamp timeStamp
+---
+> structure timeStamp
+245,246c245,246
+< int[] value [0,1,2]
+< alarm alarm
+---
+> intArray value [0,1,2]
+> structure alarm
+249c249
+< timeStamp timeStamp
+---
+> structure timeStamp
+253,254c253,254
+< long[] value [0,1,2]
+< alarm alarm
+---
+> longArray value [0,1,2]
+> structure alarm
+257c257
+< timeStamp timeStamp
+---
+> structure timeStamp
+261,262c261,262
+< float[] value [0,1,2]
+< alarm alarm
+---
+> floatArray value [0,1,2]
+> structure alarm
+265c265
+< timeStamp timeStamp
+---
+> structure timeStamp
+269,270c269,270
+< double[] value [0,1,2]
+< alarm alarm
+---
+> doubleArray value [0,1,2]
+> structure alarm
+273c273
+< timeStamp timeStamp
+---
+> structure timeStamp
+277,278c277,278
+< string[] value [0,1,2]
+< alarm alarm
+---
+> stringArray value [0,1,2]
+> structure alarm
+281c281
+< timeStamp timeStamp
+---
+> structure timeStamp
diff --git a/test/testPVStructureArray b/test/testPVStructureArray
index 2312d5e..3e016bb 100644
--- a/test/testPVStructureArray
+++ b/test/testPVStructureArray
@@ -1,38 +1,5 @@
structure powerSupply
- structureArray value
- [
- structure powerSupply
- structure voltage
- double value 0
- structure alarm
- int severity 0
- string message
- structure power
- double value 0
- structure alarm
- int severity 0
- string message
- structure current
- double value 0
- structure alarm
- int severity 0
- string message ,
- structure powerSupply
- structure voltage
- double value 0
- structure alarm
- int severity 0
- string message
- structure power
- double value 0
- structure alarm
- int severity 0
- string message
- structure current
- double value 0
- structure alarm
- int severity 0
- string message ,
+ structure[] value
structure powerSupply
structure voltage
double value 0
@@ -49,11 +16,42 @@ structure powerSupply
structure alarm
int severity 0
string message
- ]
- structure alarm
+ structure powerSupply
+ structure voltage
+ double value 0
+ structure alarm
+ int severity 0
+ string message
+ structure power
+ double value 0
+ structure alarm
+ int severity 0
+ string message
+ structure current
+ double value 0
+ structure alarm
+ int severity 0
+ string message
+ structure powerSupply
+ structure voltage
+ double value 0
+ structure alarm
+ int severity 0
+ string message
+ structure power
+ double value 0
+ structure alarm
+ int severity 0
+ string message
+ structure current
+ double value 0
+ structure alarm
+ int severity 0
+ string message
+ alarm alarm
int severity 0
string message
- structure timeStamp
+ timeStamp timeStamp
long secondsPastEpoch 0
int nanoSeconds 0
linkedListNode: totalConstruct 5 totalDestruct 0
diff --git a/test/testPVStructureArrayDiff b/test/testPVStructureArrayDiff
index e69de29..164e5d0 100644
--- a/test/testPVStructureArrayDiff
+++ b/test/testPVStructureArrayDiff
@@ -0,0 +1,22 @@
+2c2,3
+< structure[] value
+---
+> structureArray value
+> [
+18c19
+< string message
+---
+> string message ,
+34c35
+< string message
+---
+> string message ,
+51c52,53
+< alarm alarm
+---
+> ]
+> structure alarm
+54c56
+< timeStamp timeStamp
+---
+> structure timeStamp
diff --git a/test/testThreadAux b/test/testThreadAux
index d30c923..59d5f58 100644
--- a/test/testThreadAux
+++ b/test/testThreadAux
@@ -1 +1 @@
-time per call 41.228039 microseconds
+time per call 8.982863 microseconds
diff --git a/test/testTimeStampAux b/test/testTimeStampAux
index c36d1a4..acd1f92 100644
--- a/test/testTimeStampAux
+++ b/test/testTimeStampAux
@@ -1,5 +1,5 @@
-current 1292263902 816951231 milliSec 1292263902816
-2010.12.13 13:11:42 816951231 nanoSeconds isDst false
+current 1292844557 996799614 milliSec 1292844557996
+2010.12.20 06:29:17 996799614 nanoSeconds isDst false
fromTime_t
-current 1292263902 0 milliSec 1292263902000
-2010.12.13 13:11:42 0 nanoSeconds isDst false
+current 1292844557 0 milliSec 1292844557000
+2010.12.20 06:29:17 0 nanoSeconds isDst false
diff --git a/test/testTimerAux b/test/testTimerAux
index fdc6d1a..4db9699 100644
--- a/test/testTimerAux
+++ b/test/testTimerAux
@@ -1,6 +1,6 @@
-one requested 0.400000 diff 0.400294 seconds
-two requested 0.200000 diff 0.200352 seconds
-one requested 0.200000 diff 0.200359 seconds
-two requested 0.400000 diff 0.400304 seconds
-one requested 0.000000 diff 0.000035 seconds
-two requested 0.000000 diff 0.000053 seconds
+one requested 0.400000 diff 0.400278 seconds
+two requested 0.200000 diff 0.200263 seconds
+one requested 0.200000 diff 0.200349 seconds
+two requested 0.400000 diff 0.400335 seconds
+one requested 0.000000 diff 0.000086 seconds
+two requested 0.000000 diff 0.000104 seconds
diff --git a/testApp/property/testProperty.cpp b/testApp/property/testProperty.cpp
index 5cf30d9..3fd81f9 100644
--- a/testApp/property/testProperty.cpp
+++ b/testApp/property/testProperty.cpp
@@ -92,7 +92,7 @@ static void testAlarm(FILE * fd,FILE *auxfd)
al.setSeverity(majorAlarm);
result = pvAlarm.set(al);
assert(result);
- alarm = pvAlarm.get();
+ pvAlarm.get(alarm);
assert(al.getMessage().compare(alarm.getMessage())==0);
assert(al.getSeverity()==alarm.getSeverity());
String message = alarm.getMessage();
@@ -117,7 +117,7 @@ static void testTimeStamp(FILE * fd,FILE *auxfd)
ts.getCurrent();
result = pvTimeStamp.set(ts);
assert(result);
- timeStamp = pvTimeStamp.get();
+ pvTimeStamp.get(timeStamp);
assert(ts.getSecondsPastEpoch()==timeStamp.getSecondsPastEpoch());
assert(ts.getNanoSeconds()==timeStamp.getNanoSeconds());
time_t tt;
@@ -152,7 +152,7 @@ static void testControl(FILE * fd,FILE *auxfd)
cl.setHigh(10.0);
result = pvControl.set(cl);
assert(result);
- control = pvControl.get();
+ pvControl.get(control);
assert(cl.getLow()==control.getLow());
assert(cl.getHigh()==control.getHigh());
double low = control.getLow();
@@ -181,7 +181,7 @@ static void testDisplay(FILE * fd,FILE *auxfd)
dy.setUnits(String("volts"));
result = pvDisplay.set(dy);
assert(result);
- display = pvDisplay.get();
+ pvDisplay.get(display);
assert(dy.getLow()==display.getLow());
assert(dy.getHigh()==display.getHigh());
assert(dy.getDescription().compare(display.getDescription())==0);