Massive name changes to factory.

The changes make it clear what is a default implementation and
what implements base classes defined in pvData.h.
This commit is contained in:
Marty Kraimer
2011-02-01 05:31:55 -05:00
parent ca3e22fd81
commit 52ee919845
34 changed files with 606 additions and 677 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -55,29 +55,6 @@ INC += standardPVField.h
SRC_DIRS += $(PVDATA)/factory
INC += factory.h
INC += AbstractPVField.h
INC += AbstractPVScalar.h
INC += AbstractPVArray.h
INC += AbstractPVScalarArray.h
INC += BasePVStructure.h
INC += BasePVBoolean.h
INC += BasePVByte.h
INC += BasePVShort.h
INC += BasePVInt.h
INC += BasePVLong.h
INC += BasePVFloat.h
INC += BasePVDouble.h
INC += BasePVString.h
INC += BasePVBooleanArray.h
INC += BasePVByteArray.h
INC += BasePVShortArray.h
INC += BasePVIntArray.h
INC += BasePVLongArray.h
INC += BasePVFloatArray.h
INC += BasePVDoubleArray.h
INC += BasePVString.h
INC += BasePVStructure.h
INC += BasePVStructureArray.h
LIBSRCS += TypeFunc.cpp
LIBSRCS += PVAuxInfoImpl.cpp
LIBSRCS += FieldCreateFactory.cpp

View File

@@ -1,11 +1,9 @@
/*BasePVBoolean.h*/
/*PVBoolean.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVBOOLEAN_H
#define BASEPVBOOLEAN_H
#include <cstddef>
#include <cstdlib>
#include <string>
@@ -13,13 +11,10 @@
#include "pvData.h"
#include "convert.h"
#include "factory.h"
#include "AbstractPVField.h"
#include "byteBuffer.h"
namespace epics { namespace pvData {
PVBoolean::~PVBoolean() {}
class BasePVBoolean : public PVBoolean {
public:
BasePVBoolean(PVStructure *parent,ScalarConstPtr scalar);
@@ -70,4 +65,3 @@ namespace epics { namespace pvData {
}
}}
#endif /* BASEPVBOOLEAN_H */

View File

@@ -1,33 +1,25 @@
/*BasePVBooleanArrray.h*/
/*PVBooleanArrray.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVBOOLEANARRAY_H
#define BASEPVBOOLEANARRAY_H
#include <cstddef>
#include <cstdlib>
#include <string>
#include <cstdio>
#include "pvData.h"
#include "factory.h"
#include "AbstractPVScalarArray.h"
#include "serializeHelper.h"
using std::min;
namespace epics { namespace pvData {
PVBooleanArray::~PVBooleanArray() {}
PVBooleanArray::PVBooleanArray(PVStructure *parent,ScalarArrayConstPtr scalar)
: PVScalarArray(parent,scalar) {}
class BasePVBooleanArray : public PVBooleanArray {
class DefaultPVBooleanArray : public PVBooleanArray {
public:
BasePVBooleanArray(PVStructure *parent,ScalarArrayConstPtr scalarArray);
virtual ~BasePVBooleanArray();
DefaultPVBooleanArray(PVStructure *parent,ScalarArrayConstPtr scalarArray);
virtual ~DefaultPVBooleanArray();
virtual void setCapacity(int capacity);
virtual int get(int offset, int length, BooleanArrayData *data) ;
virtual int put(int offset,int length,BooleanArray from,
@@ -44,17 +36,17 @@ namespace epics { namespace pvData {
bool *value;
};
BasePVBooleanArray::BasePVBooleanArray(PVStructure *parent,
DefaultPVBooleanArray::DefaultPVBooleanArray(PVStructure *parent,
ScalarArrayConstPtr scalarArray)
: PVBooleanArray(parent,scalarArray),value(new bool[0])
{ }
BasePVBooleanArray::~BasePVBooleanArray()
DefaultPVBooleanArray::~DefaultPVBooleanArray()
{
delete[] value;
}
void BasePVBooleanArray::setCapacity(int capacity)
void DefaultPVBooleanArray::setCapacity(int capacity)
{
if(PVArray::getCapacity()==capacity) return;
if(!PVArray::isCapacityMutable()) {
@@ -71,7 +63,7 @@ namespace epics { namespace pvData {
PVArray::setCapacityLength(capacity,length);
}
int BasePVBooleanArray::get(int offset, int len, BooleanArrayData *data)
int DefaultPVBooleanArray::get(int offset, int len, BooleanArrayData *data)
{
int n = len;
int length = PVArray::getLength();
@@ -84,7 +76,7 @@ namespace epics { namespace pvData {
return n;
}
int BasePVBooleanArray::put(int offset,int len,
int DefaultPVBooleanArray::put(int offset,int len,
BooleanArray from,int fromOffset)
{
if(PVField::isImmutable()) {
@@ -113,19 +105,19 @@ namespace epics { namespace pvData {
return len;
}
void BasePVBooleanArray::shareData(BooleanArray shareValue,int capacity,int length)
void DefaultPVBooleanArray::shareData(BooleanArray shareValue,int capacity,int length)
{
delete[] value;
value = shareValue;
PVArray::setCapacityLength(capacity,length);
}
void BasePVBooleanArray::serialize(ByteBuffer *pbuffer,
void DefaultPVBooleanArray::serialize(ByteBuffer *pbuffer,
SerializableControl *pflusher) {
serialize(pbuffer, pflusher, 0, getLength());
}
void BasePVBooleanArray::deserialize(ByteBuffer *pbuffer,
void DefaultPVBooleanArray::deserialize(ByteBuffer *pbuffer,
DeserializableControl *pcontrol) {
int size = SerializeHelper::readSize(pbuffer, pcontrol);
if(size>=0) {
@@ -149,7 +141,7 @@ namespace epics { namespace pvData {
// TODO null arrays (size == -1) not supported
}
void BasePVBooleanArray::serialize(ByteBuffer *pbuffer,
void DefaultPVBooleanArray::serialize(ByteBuffer *pbuffer,
SerializableControl *pflusher, int offset, int count) {
// cache
int length = getLength();
@@ -178,14 +170,13 @@ namespace epics { namespace pvData {
}
}
bool BasePVBooleanArray::operator==(PVField& pv)
bool DefaultPVBooleanArray::operator==(PVField& pv)
{
return getConvert()->equals(this, &pv);
}
bool BasePVBooleanArray::operator!=(PVField& pv)
bool DefaultPVBooleanArray::operator!=(PVField& pv)
{
return !(getConvert()->equals(this, &pv));
}
}}
#endif /* BASEPVBOOLEANARRAY_H */

View File

@@ -1,11 +1,9 @@
/*BasePVByte.h*/
/*PVByte.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVBYTE_H
#define BASEPVBYTE_H
#include <cstddef>
#include <cstdlib>
#include <string>
@@ -13,13 +11,10 @@
#include "pvData.h"
#include "convert.h"
#include "factory.h"
#include "AbstractPVField.h"
#include "byteBuffer.h"
namespace epics { namespace pvData {
PVByte::~PVByte() {}
class BasePVByte : public PVByte {
public:
BasePVByte(PVStructure *parent,ScalarConstPtr scalar);
@@ -69,4 +64,3 @@ namespace epics { namespace pvData {
}
}}
#endif /* BASEPVBYTE_H */

View File

@@ -1,29 +1,21 @@
/*BasePVByteArray.h*/
/*PVByteArray.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVBYTEARRAY_H
#define BASEPVBYTEARRAY_H
#include <cstddef>
#include <cstdlib>
#include <string>
#include <cstdio>
#include "pvData.h"
#include "factory.h"
#include "AbstractPVScalarArray.h"
#include "serializeHelper.h"
using std::min;
namespace epics { namespace pvData {
PVByteArray::~PVByteArray() {}
PVByteArray::PVByteArray(PVStructure *parent,ScalarArrayConstPtr scalar)
: PVScalarArray(parent,scalar) {}
class BasePVByteArray : public PVByteArray {
public:
BasePVByteArray(PVStructure *parent,ScalarArrayConstPtr scalarArray);
@@ -188,4 +180,3 @@ namespace epics { namespace pvData {
return !(getConvert()->equals(this, &pv));
}
}}
#endif /* BASEPVBYTEARRAY_H */

View File

@@ -4,8 +4,6 @@
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVDOUBLE_H
#define BASEPVDOUBLE_H
#include <cstddef>
#include <cstdlib>
#include <string>
@@ -13,13 +11,10 @@
#include "pvData.h"
#include "convert.h"
#include "factory.h"
#include "AbstractPVField.h"
#include "byteBuffer.h"
namespace epics { namespace pvData {
PVDouble::~PVDouble() {}
class BasePVDouble : public PVDouble {
public:
BasePVDouble(PVStructure *parent,ScalarConstPtr scalar);
@@ -69,4 +64,3 @@ namespace epics { namespace pvData {
}
}}
#endif /* BASEPVDOUBLE_H */

View File

@@ -1,29 +1,21 @@
/*BasePVDoubleArray.h*/
/*PVDoubleArray.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVDOUBLEARRAY_H
#define BASEPVDOUBLEARRAY_H
#include <cstddef>
#include <cstdlib>
#include <string>
#include <cstdio>
#include "pvData.h"
#include "factory.h"
#include "AbstractPVScalarArray.h"
#include "serializeHelper.h"
using std::min;
namespace epics { namespace pvData {
PVDoubleArray::~PVDoubleArray() {}
PVDoubleArray::PVDoubleArray(PVStructure *parent,ScalarArrayConstPtr scalar)
: PVScalarArray(parent,scalar) {}
class BasePVDoubleArray : public PVDoubleArray {
public:
BasePVDoubleArray(PVStructure *parent,ScalarArrayConstPtr scalarArray);
@@ -191,4 +183,3 @@ namespace epics { namespace pvData {
return !(getConvert()->equals(this, &pv));
}
}}
#endif /* BASEPVDOUBLEARRAY_H */

View File

@@ -1,11 +1,9 @@
/*BasePVFloat.h*/
/*PVFloat.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVFLOAT_H
#define BASEPVFLOAT_H
#include <cstddef>
#include <cstdlib>
#include <string>
@@ -13,13 +11,10 @@
#include "pvData.h"
#include "convert.h"
#include "factory.h"
#include "AbstractPVField.h"
#include "byteBuffer.h"
namespace epics { namespace pvData {
PVFloat::~PVFloat() {}
class BasePVFloat : public PVFloat {
public:
BasePVFloat(PVStructure *parent,ScalarConstPtr scalar);
@@ -69,4 +64,3 @@ namespace epics { namespace pvData {
}
}}
#endif /* BASEPVFLOAT_H */

View File

@@ -1,29 +1,21 @@
/*BasePVFloatArray.h*/
/*PVFloatArray.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVFLOATARRAY_H
#define BASEPVFLOATARRAY_H
#include <cstddef>
#include <cstdlib>
#include <string>
#include <cstdio>
#include "pvData.h"
#include "factory.h"
#include "AbstractPVScalarArray.h"
#include "serializeHelper.h"
namespace epics { namespace pvData {
using std::min;
PVFloatArray::~PVFloatArray() {}
PVFloatArray::PVFloatArray(PVStructure *parent,ScalarArrayConstPtr scalar)
: PVScalarArray(parent,scalar) {}
class BasePVFloatArray : public PVFloatArray {
public:
BasePVFloatArray(PVStructure *parent,ScalarArrayConstPtr scalarArray);
@@ -191,4 +183,3 @@ namespace epics { namespace pvData {
return !(getConvert()->equals(this, &pv));
}
}}
#endif /* BASEPVFLOATARRAY_H */

View File

@@ -1,11 +1,9 @@
/*BasePVInt.h*/
/*PVInt.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVINT_H
#define BASEPVINT_H
#include <cstddef>
#include <cstdlib>
#include <string>
@@ -13,13 +11,10 @@
#include "pvData.h"
#include "convert.h"
#include "factory.h"
#include "AbstractPVField.h"
#include "byteBuffer.h"
namespace epics { namespace pvData {
PVInt::~PVInt() {}
class BasePVInt : public PVInt {
public:
BasePVInt(PVStructure *parent,ScalarConstPtr scalar);
@@ -69,4 +64,3 @@ namespace epics { namespace pvData {
}
}}
#endif /* BASEPVINT_H */

View File

@@ -1,29 +1,21 @@
/*BasePVIntArray.h*/
/*PVIntArray.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVINTARRAY_H
#define BASEPVINTARRAY_H
#include <cstddef>
#include <cstdlib>
#include <string>
#include <cstdio>
#include "pvData.h"
#include "factory.h"
#include "AbstractPVScalarArray.h"
#include "serializeHelper.h"
using std::min;
namespace epics { namespace pvData {
PVIntArray::~PVIntArray() {}
PVIntArray::PVIntArray(PVStructure *parent,ScalarArrayConstPtr scalar)
: PVScalarArray(parent,scalar) {}
class BasePVIntArray : public PVIntArray {
public:
BasePVIntArray(PVStructure *parent,ScalarArrayConstPtr scalarArray);
@@ -191,4 +183,3 @@ namespace epics { namespace pvData {
return !(getConvert()->equals(this, &pv));
}
}}
#endif /* BASEPVINTARRAY_H */

View File

@@ -1,11 +1,9 @@
/*BasePVLong.h*/
/*PVLong.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVLONG_H
#define BASEPVLONG_H
#include <cstddef>
#include <cstdlib>
#include <string>
@@ -13,13 +11,10 @@
#include "pvData.h"
#include "convert.h"
#include "factory.h"
#include "AbstractPVField.h"
#include "byteBuffer.h"
namespace epics { namespace pvData {
PVLong::~PVLong() {}
class BasePVLong : public PVLong {
public:
BasePVLong(PVStructure *parent,ScalarConstPtr scalar);
@@ -69,4 +64,3 @@ namespace epics { namespace pvData {
}
}}
#endif /* BASEPVLONG_H */

View File

@@ -1,29 +1,21 @@
/*BasePVLongArray.h*/
/*PVLongArray.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVLONGARRAY_H
#define BASEPVLONGARRAY_H
#include <cstddef>
#include <cstdlib>
#include <string>
#include <cstdio>
#include "pvData.h"
#include "factory.h"
#include "AbstractPVScalarArray.h"
#include "serializeHelper.h"
using std::min;
namespace epics { namespace pvData {
PVLongArray::~PVLongArray() {}
PVLongArray::PVLongArray(PVStructure *parent,ScalarArrayConstPtr scalar)
: PVScalarArray(parent,scalar) {}
class BasePVLongArray : public PVLongArray {
public:
BasePVLongArray(PVStructure *parent,ScalarArrayConstPtr scalarArray);
@@ -191,4 +183,3 @@ namespace epics { namespace pvData {
return !(getConvert()->equals(this, &pv));
}
}}
#endif /* BASEPVLONGARRAY_H */

View File

@@ -1,11 +1,9 @@
/*BasePVShort.h*/
/*PVShort.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVSHORT_H
#define BASEPVSHORT_H
#include <cstddef>
#include <cstdlib>
#include <string>
@@ -13,13 +11,10 @@
#include "pvData.h"
#include "convert.h"
#include "factory.h"
#include "AbstractPVField.h"
#include "byteBuffer.h"
namespace epics { namespace pvData {
PVShort::~PVShort() {}
class BasePVShort : public PVShort {
public:
BasePVShort(PVStructure *parent,ScalarConstPtr scalar);
@@ -69,4 +64,3 @@ namespace epics { namespace pvData {
}
}}
#endif /* BASEPVSHORT_H */

View File

@@ -1,29 +1,21 @@
/*BasePVShortArray.h*/
/*PVShortArray.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVSHORTARRAY_H
#define BASEPVSHORTARRAY_H
#include <cstddef>
#include <cstdlib>
#include <string>
#include <cstdio>
#include "pvData.h"
#include "factory.h"
#include "AbstractPVScalarArray.h"
#include "serializeHelper.h"
using std::min;
namespace epics { namespace pvData {
PVShortArray::~PVShortArray() {}
PVShortArray::PVShortArray(PVStructure *parent,ScalarArrayConstPtr scalar)
: PVScalarArray(parent,scalar) {}
class BasePVShortArray : public PVShortArray {
public:
BasePVShortArray(PVStructure *parent,ScalarArrayConstPtr scalarArray);
@@ -191,4 +183,3 @@ namespace epics { namespace pvData {
return !(getConvert()->equals(this, &pv));
}
}}
#endif /* BASEPVSHORTARRAY_H */

View File

@@ -1,11 +1,9 @@
/*BasePVString.h*/
/*PVString.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVSTRING_H
#define BASEPVSTRING_H
#include <cstddef>
#include <cstdlib>
#include <string>
@@ -13,14 +11,11 @@
#include "pvData.h"
#include "convert.h"
#include "factory.h"
#include "AbstractPVField.h"
#include "byteBuffer.h"
#include "serializeHelper.h"
namespace epics { namespace pvData {
PVString::~PVString() {}
class BasePVString : public PVString {
public:
BasePVString(PVStructure *parent,ScalarConstPtr scalar);
@@ -68,4 +63,3 @@ namespace epics { namespace pvData {
}
}}
#endif /* BASEPVSTRING_H */

View File

@@ -1,27 +1,19 @@
/*BasePVStringArray.h*/
/*PVStringArray.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVSTRINGARRAY_H
#define BASEPVSTRINGARRAY_H
#include <cstddef>
#include <cstdlib>
#include <string>
#include <cstdio>
#include "pvData.h"
#include "factory.h"
#include "AbstractPVScalarArray.h"
#include "serializeHelper.h"
namespace epics { namespace pvData {
PVStringArray::~PVStringArray() {}
PVStringArray::PVStringArray(PVStructure *parent,ScalarArrayConstPtr scalar)
: PVScalarArray(parent,scalar) {}
class BasePVStringArray : public PVStringArray {
public:
BasePVStringArray(PVStructure *parent,ScalarArrayConstPtr scalarArray);
@@ -171,4 +163,3 @@ namespace epics { namespace pvData {
return !(getConvert()->equals(this, &pv));
}
}}
#endif /* BASEPVSTRINGARRAY_H */

View File

@@ -1,11 +1,9 @@
/*BasePVStructureArray.h*/
/*PVStructureArray.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVSTRUCTUREARRAY_H
#define BASEPVSTRUCTUREARRAY_H
#include <cstddef>
#include <cstdlib>
#include <string>
@@ -16,13 +14,6 @@
namespace epics { namespace pvData {
PVStructureArray::PVStructureArray(PVStructure *parent,
StructureArrayConstPtr structureArray)
: PVArray(parent,structureArray)
{}
PVStructureArray::~PVStructureArray() {}
class BasePVStructureArray : public PVStructureArray {
public:
BasePVStructureArray(PVStructure *parent,
@@ -31,6 +22,7 @@ namespace epics { namespace pvData {
virtual StructureArrayConstPtr getStructureArray();
virtual int append(int number);
virtual bool remove(int offset,int number);
virtual void compress();
virtual void setCapacity(int capacity);
virtual int get(int offset, int length,
StructureArrayData *data);
@@ -96,15 +88,36 @@ namespace epics { namespace pvData {
value[i] = 0;
}
}
// move any at end up
int nToMove = length - (offset+number);
for(int i=0; i<nToMove; i++) {
value[i+offset] = value[i+length];
value[i+length] = 0;
}
return true;
}
void BasePVStructureArray::compress() {
int length = getCapacity();
int newLength = 0;
for(int i=0; i<length; i++) {
if(value[i]!=0) {
newLength++;
continue;
}
// find first non 0
int notNull = 0;
for(int j=i+1;j<length;j++) {
if(value[j]!=0) {
notNull = j;
break;
}
}
if(notNull!=0) {
value[i] = value[notNull];
value[notNull] = 0;
newLength++;
continue;
}
break;
}
setCapacity(newLength);
}
void BasePVStructureArray::setCapacity(int capacity) {
if(getCapacity()==capacity) return;
if(!isCapacityMutable()) {
@@ -273,4 +286,3 @@ namespace epics { namespace pvData {
}
}}
#endif /* BASEPVSTRUCTUREARRAY_H */

View File

@@ -1,12 +1,10 @@
/*AbstractPVArray.h*/
/*PVArray.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef ABSTRACTPVARRAY_H
#define ABSTRACTPVARRAY_H
#include <cstddef>
#include <cstdlib>
#include <string>
@@ -89,4 +87,3 @@ namespace epics { namespace pvData {
}
}}
#endif /* ABSTRACTPVARRAY_H */

View File

@@ -13,29 +13,28 @@
#include "pvData.h"
#include "convert.h"
#include "factory.h"
#include "AbstractPVField.h"
#include "AbstractPVScalar.h"
#include "AbstractPVArray.h"
#include "AbstractPVScalarArray.h"
#include "BasePVBoolean.h"
#include "BasePVByte.h"
#include "BasePVShort.h"
#include "BasePVInt.h"
#include "BasePVLong.h"
#include "BasePVFloat.h"
#include "BasePVDouble.h"
#include "BasePVString.h"
#include "AbstractPVArray.h"
#include "BasePVBooleanArray.h"
#include "BasePVByteArray.h"
#include "BasePVShortArray.h"
#include "BasePVIntArray.h"
#include "BasePVLongArray.h"
#include "BasePVFloatArray.h"
#include "BasePVDoubleArray.h"
#include "BasePVStringArray.h"
#include "BasePVStructure.h"
#include "BasePVStructureArray.h"
#include "PVField.cpp"
#include "PVScalar.cpp"
#include "PVArray.cpp"
#include "PVScalarArray.cpp"
#include "PVStructure.cpp"
#include "DefaultPVBoolean.cpp"
#include "DefaultPVByte.cpp"
#include "DefaultPVShort.cpp"
#include "DefaultPVInt.cpp"
#include "DefaultPVLong.cpp"
#include "DefaultPVFloat.cpp"
#include "DefaultPVDouble.cpp"
#include "DefaultPVString.cpp"
#include "DefaultPVBooleanArray.cpp"
#include "DefaultPVByteArray.cpp"
#include "DefaultPVShortArray.cpp"
#include "DefaultPVIntArray.cpp"
#include "DefaultPVLongArray.cpp"
#include "DefaultPVFloatArray.cpp"
#include "DefaultPVDoubleArray.cpp"
#include "DefaultPVStringArray.cpp"
#include "DefaultPVStructureArray.cpp"
namespace epics { namespace pvData {
@@ -144,7 +143,7 @@ PVScalarArray *PVDataCreate::createPVScalarArray(PVStructure *parent,
{
switch(scalarArray->getElementType()) {
case pvBoolean:
return new BasePVBooleanArray(parent,scalarArray);
return new DefaultPVBooleanArray(parent,scalarArray);
case pvByte:
return new BasePVByteArray(parent,scalarArray);
case pvShort:

View File

@@ -1,11 +1,9 @@
/*AbstractPVField.h*/
/*PVField.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef ABSTRACTPVFIELD_H
#define ABSTRACTPVFIELD_H
#include <cstddef>
#include <cstdlib>
#include <string>
@@ -259,4 +257,3 @@ void PVField::computeOffset(PVField * pvField,int offset) {
}
}}
#endif /* ABSTRACTPVFIELD_H */

View File

@@ -1,18 +1,15 @@
/*AbstractPVScalar.h*/
/*PVScalar.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef ABSTRACTPVSCALAR_H
#define ABSTRACTPVSCALAR_H
#include <cstddef>
#include <cstdlib>
#include <string>
#include <cstdio>
#include "pvData.h"
#include "factory.h"
#include "AbstractPVField.h"
namespace epics { namespace pvData {
@@ -27,4 +24,3 @@ namespace epics { namespace pvData {
}
}}
#endif /* ABSTRACTPVSCALAR_H */

View File

@@ -1,18 +1,15 @@
/*AbstractPVScalarArray.h*/
/*PVScalarArray.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef ABSTRACTPVSCALARARRAY_H
#define ABSTRACTPVSCALARARRAY_H
#include <cstddef>
#include <cstdlib>
#include <string>
#include <cstdio>
#include "pvData.h"
#include "factory.h"
#include "AbstractPVArray.h"
namespace epics { namespace pvData {
@@ -28,4 +25,3 @@ namespace epics { namespace pvData {
}
}}
#endif /* ABSTRACTPVSCALARARRAY_H */

View File

@@ -1,11 +1,9 @@
/*BasePVStructure.h*/
/*PVStructure.cpp*/
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#ifndef BASEPVSTRUCTURE_H
#define BASEPVSTRUCTURE_H
#include <cstddef>
#include <cstdlib>
#include <string>
@@ -571,4 +569,3 @@ namespace epics { namespace pvData {
BasePVStructure::~BasePVStructure() {}
}}
#endif /* BASEPVSTRUCTURE_H */

View File

@@ -160,10 +160,11 @@ public:
class PVStructureArray : public PVArray {
public:
virtual ~PVStructureArray();
virtual ~PVStructureArray() {}
virtual StructureArrayConstPtr getStructureArray() = 0;
virtual int append(int number) = 0;
virtual bool remove(int offset,int number) = 0;
virtual void compress() = 0;
virtual void setCapacity(int capacity) = 0;
virtual int get(int offset, int length,
StructureArrayData *data) = 0;
@@ -177,8 +178,8 @@ public:
virtual void serialize(ByteBuffer *pbuffer,
SerializableControl *pflusher, int offset, int count) = 0;
protected:
PVStructureArray(PVStructure *parent,
StructureArrayConstPtr structureArray);
PVStructureArray(PVStructure *parent, StructureArrayConstPtr structureArray)
: PVArray(parent,structureArray) {}
private:
};
@@ -228,7 +229,7 @@ private:
class PVBoolean : public PVScalar {
public:
virtual ~PVBoolean();
virtual ~PVBoolean() {}
virtual bool get() = 0;
virtual void put(bool value) = 0;
protected:
@@ -239,7 +240,7 @@ private:
class PVByte : public PVScalar {
public:
virtual ~PVByte();
virtual ~PVByte() {}
virtual int8 get() = 0;
virtual void put(int8 value) = 0;
protected:
@@ -250,7 +251,7 @@ private:
class PVShort : public PVScalar {
public:
virtual ~PVShort();
virtual ~PVShort() {}
virtual int16 get() = 0;
virtual void put(int16 value) = 0;
protected:
@@ -261,7 +262,7 @@ private:
class PVInt : public PVScalar{
public:
virtual ~PVInt();
virtual ~PVInt() {}
virtual int32 get() = 0;
virtual void put(int32 value) = 0;
protected:
@@ -272,7 +273,7 @@ private:
class PVLong : public PVScalar {
public:
virtual ~PVLong();
virtual ~PVLong() {}
virtual int64 get() = 0;
virtual void put(int64 value) = 0;
protected:
@@ -283,7 +284,7 @@ private:
class PVFloat : public PVScalar {
public:
virtual ~PVFloat();
virtual ~PVFloat() {}
virtual float get() = 0;
virtual void put(float value) = 0;
protected:
@@ -294,7 +295,7 @@ private:
class PVDouble : public PVScalar {
public:
virtual ~PVDouble();
virtual ~PVDouble() {}
virtual double get() = 0;
virtual void put(double value) = 0;
protected:
@@ -305,7 +306,7 @@ private:
class PVString : public PVScalar {
public:
virtual ~PVString();
virtual ~PVString() {}
virtual String get() = 0;
virtual void put(String value) = 0;
protected:
@@ -322,7 +323,7 @@ public:
class PVBooleanArray : public PVScalarArray {
public:
virtual ~PVBooleanArray();
virtual ~PVBooleanArray() {}
virtual void setCapacity(int capacity) = 0;
virtual int get(int offset, int length, BooleanArrayData *data) = 0;
virtual int put(int offset,int length, BooleanArray from, int fromOffset) = 0;
@@ -330,7 +331,8 @@ public:
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) = 0;
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher) = 0;
protected:
PVBooleanArray(PVStructure *parent,ScalarArrayConstPtr scalar);
PVBooleanArray(PVStructure *parent,ScalarArrayConstPtr scalar)
: PVScalarArray(parent,scalar) {}
private:
};
@@ -343,7 +345,7 @@ public:
class PVByteArray : public PVScalarArray {
public:
virtual ~PVByteArray();
virtual ~PVByteArray() {}
virtual void setCapacity(int capacity) = 0;
virtual int get(int offset, int length, ByteArrayData *data) = 0;
virtual int put(int offset,int length, ByteArray from, int fromOffset) = 0;
@@ -351,7 +353,8 @@ public:
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) = 0;
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher) = 0;
protected:
PVByteArray(PVStructure *parent,ScalarArrayConstPtr scalar);
PVByteArray(PVStructure *parent,ScalarArrayConstPtr scalar)
: PVScalarArray(parent,scalar) {}
private:
};
@@ -363,7 +366,7 @@ public:
class PVShortArray : public PVScalarArray {
public:
virtual ~PVShortArray();
virtual ~PVShortArray() {}
virtual void setCapacity(int capacity) = 0;
virtual int get(int offset, int length, ShortArrayData *data) = 0;
virtual int put(int offset,int length, ShortArray from, int fromOffset) = 0;
@@ -371,7 +374,8 @@ public:
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) = 0;
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher) = 0;
protected:
PVShortArray(PVStructure *parent,ScalarArrayConstPtr scalar);
PVShortArray(PVStructure *parent,ScalarArrayConstPtr scalar)
: PVScalarArray(parent,scalar) {}
private:
};
@@ -383,7 +387,7 @@ public:
class PVIntArray : public PVScalarArray {
public:
virtual ~PVIntArray();
virtual ~PVIntArray() {}
virtual void setCapacity(int capacity) = 0;
virtual int get(int offset, int length, IntArrayData *data) = 0;
virtual int put(int offset,int length, IntArray from, int fromOffset)= 0;
@@ -391,7 +395,8 @@ public:
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) = 0;
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher)= 0;
protected:
PVIntArray(PVStructure *parent,ScalarArrayConstPtr scalar);
PVIntArray(PVStructure *parent,ScalarArrayConstPtr scalar)
: PVScalarArray(parent,scalar) {}
private:
};
@@ -403,7 +408,7 @@ public:
class PVLongArray : public PVScalarArray {
public:
virtual ~PVLongArray();
virtual ~PVLongArray() {}
virtual void setCapacity(int capacity) = 0;
virtual int get(int offset, int length, LongArrayData *data) = 0;
virtual int put(int offset,int length, LongArray from, int fromOffset)= 0;
@@ -411,7 +416,8 @@ public:
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) = 0;
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher)= 0;
protected:
PVLongArray(PVStructure *parent,ScalarArrayConstPtr scalar);
PVLongArray(PVStructure *parent,ScalarArrayConstPtr scalar)
: PVScalarArray(parent,scalar) {}
private:
};
@@ -424,7 +430,7 @@ public:
class PVFloatArray : public PVScalarArray {
public:
virtual ~PVFloatArray();
virtual ~PVFloatArray() {}
virtual void setCapacity(int capacity) = 0;
virtual int get(int offset, int length, FloatArrayData *data) = 0;
virtual int put(int offset,int length, FloatArray from, int fromOffset)= 0;
@@ -432,7 +438,8 @@ public:
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) = 0;
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher)= 0;
protected:
PVFloatArray(PVStructure *parent,ScalarArrayConstPtr scalar);
PVFloatArray(PVStructure *parent,ScalarArrayConstPtr scalar)
: PVScalarArray(parent,scalar) {}
private:
};
@@ -447,7 +454,7 @@ public:
class PVDoubleArray : public PVScalarArray {
public:
virtual ~PVDoubleArray();
virtual ~PVDoubleArray() {}
virtual void setCapacity(int capacity) = 0;
virtual int get(int offset, int length, DoubleArrayData *data) = 0;
virtual int put(int offset,int length, DoubleArray from, int fromOffset) = 0;
@@ -455,7 +462,8 @@ public:
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) = 0;
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher) = 0;
protected:
PVDoubleArray(PVStructure *parent,ScalarArrayConstPtr scalar);
PVDoubleArray(PVStructure *parent,ScalarArrayConstPtr scalar)
: PVScalarArray(parent,scalar) {}
private:
};
@@ -468,7 +476,7 @@ public:
class PVStringArray : public PVScalarArray {
public:
virtual ~PVStringArray();
virtual ~PVStringArray() {}
virtual void setCapacity(int capacity) = 0;
virtual int get(int offset, int length, StringArrayData *data) = 0;
virtual int put(int offset,int length, StringArray from, int fromOffset)= 0;
@@ -476,7 +484,8 @@ public:
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) = 0;
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher)= 0;
protected:
PVStringArray(PVStructure *parent,ScalarArrayConstPtr scalar);
PVStringArray(PVStructure *parent,ScalarArrayConstPtr scalar)
: PVScalarArray(parent,scalar) {}
private:
};

View File

@@ -1,20 +1,20 @@
Time test
diff 24.740621 milliSeconds
time per iteration 24.740621 microseconds
time per addTail/removeHead 0.012370 microseconds
diff 24.890191 milliSeconds
time per iteration 24.890191 microseconds
time per addTail/removeHead 0.012445 microseconds
Time test locked
diff 188.817816 milliSeconds
time per iteration 188.817816 microseconds
time per addTail/removeHead 0.094409 microseconds
diff 188.108610 milliSeconds
time per iteration 188.108610 microseconds
time per addTail/removeHead 0.094054 microseconds
Time std::list test
diff 629.679579 milliSeconds
time per iteration 629.679579 microseconds
time per addTail/removeHead 0.314840 microseconds
diff 668.831984 milliSeconds
time per iteration 668.831984 microseconds
time per addTail/removeHead 0.334416 microseconds
Time std::list test locked
diff 787.049712 milliSeconds
time per iteration 787.049712 microseconds
time per addTail/removeHead 0.393525 microseconds
diff 780.392611 milliSeconds
time per iteration 780.392611 microseconds
time per addTail/removeHead 0.390196 microseconds

View File

@@ -1,3 +1,4 @@
after append 5
structure powerSupply
structure[] value
structure powerSupply
@@ -48,6 +49,121 @@ structure powerSupply
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 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
timeStamp timeStamp
long secondsPastEpoch 0
int nanoSeconds 0
after remove 0,1,3structure powerSupply
structure[] value
null
null
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
null
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
timeStamp timeStamp
long secondsPastEpoch 0
int nanoSeconds 0
after compressstructure powerSupply
structure[] 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
alarm alarm
int severity 0
string message
@@ -55,6 +171,6 @@ structure powerSupply
long secondsPastEpoch 0
int nanoSeconds 0
field: totalConstruct 102 totalDestruct 102
pvField: totalConstruct 56 totalDestruct 56
pvField: totalConstruct 88 totalDestruct 88
linkedListNode: totalConstruct 5 totalDestruct 5
linkedList: totalConstruct 1 totalDestruct 1

View File

@@ -1,57 +0,0 @@
56a57,112
> reference counts powerSupply referenceCount 1
> value referenceCount 1
> alarm referenceCount 14
> severity referenceCount 14
> message referenceCount 14
> timeStamp referenceCount 2
> secondsPastEpoch referenceCount 2
> nanoSeconds referenceCount 2
> before incReferenceCount reference counts powerSupply referenceCount 4
> voltage referenceCount 4
> value referenceCount 4
> alarm referenceCount 14
> severity referenceCount 14
> message referenceCount 14
> power referenceCount 4
> value referenceCount 4
> alarm referenceCount 14
> severity referenceCount 14
> message referenceCount 14
> current referenceCount 4
> value referenceCount 4
> alarm referenceCount 14
> severity referenceCount 14
> message referenceCount 14
> after incReferenceCount reference counts powerSupply referenceCount 5
> voltage referenceCount 5
> value referenceCount 5
> alarm referenceCount 17
> severity referenceCount 17
> message referenceCount 17
> power referenceCount 5
> value referenceCount 5
> alarm referenceCount 17
> severity referenceCount 17
> message referenceCount 17
> current referenceCount 5
> value referenceCount 5
> alarm referenceCount 17
> severity referenceCount 17
> message referenceCount 17
> after decReferenceCount reference counts powerSupply referenceCount 4
> voltage referenceCount 4
> value referenceCount 4
> alarm referenceCount 14
> severity referenceCount 14
> message referenceCount 14
> power referenceCount 4
> value referenceCount 4
> alarm referenceCount 14
> severity referenceCount 14
> message referenceCount 14
> current referenceCount 4
> value referenceCount 4
> alarm referenceCount 14
> severity referenceCount 14
> message referenceCount 14

View File

@@ -1,3 +1,4 @@
after append 5
structure powerSupply
structure[] value
structure powerSupply
@@ -48,69 +49,128 @@ structure powerSupply
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 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
timeStamp timeStamp
long secondsPastEpoch 0
int nanoSeconds 0
after remove 0,1,3structure powerSupply
structure[] value
null
null
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
null
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
timeStamp timeStamp
long secondsPastEpoch 0
int nanoSeconds 0
after compressstructure powerSupply
structure[] 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
alarm alarm
int severity 0
string message
timeStamp timeStamp
long secondsPastEpoch 0
int nanoSeconds 0
reference counts powerSupply referenceCount 1
value referenceCount 1
alarm referenceCount 14
severity referenceCount 14
message referenceCount 14
timeStamp referenceCount 2
secondsPastEpoch referenceCount 2
nanoSeconds referenceCount 2
before incReferenceCount reference counts powerSupply referenceCount 4
voltage referenceCount 4
value referenceCount 4
alarm referenceCount 14
severity referenceCount 14
message referenceCount 14
power referenceCount 4
value referenceCount 4
alarm referenceCount 14
severity referenceCount 14
message referenceCount 14
current referenceCount 4
value referenceCount 4
alarm referenceCount 14
severity referenceCount 14
message referenceCount 14
after incReferenceCount reference counts powerSupply referenceCount 5
voltage referenceCount 5
value referenceCount 5
alarm referenceCount 17
severity referenceCount 17
message referenceCount 17
power referenceCount 5
value referenceCount 5
alarm referenceCount 17
severity referenceCount 17
message referenceCount 17
current referenceCount 5
value referenceCount 5
alarm referenceCount 17
severity referenceCount 17
message referenceCount 17
after decReferenceCount reference counts powerSupply referenceCount 4
voltage referenceCount 4
value referenceCount 4
alarm referenceCount 14
severity referenceCount 14
message referenceCount 14
power referenceCount 4
value referenceCount 4
alarm referenceCount 14
severity referenceCount 14
message referenceCount 14
current referenceCount 4
value referenceCount 4
alarm referenceCount 14
severity referenceCount 14
message referenceCount 14
field: totalConstruct 102 totalDestruct 102
pvField: totalConstruct 56 totalDestruct 56
pvField: totalConstruct 88 totalDestruct 88
linkedListNode: totalConstruct 5 totalDestruct 5
linkedList: totalConstruct 1 totalDestruct 1

View File

@@ -1 +1 @@
time per call 30.779267 microseconds
time per call 41.431581 microseconds

View File

@@ -1,5 +1,5 @@
current 1296220855 236718062 milliSec 1296220855236
2011.01.28 08:20:55 236718062 nanoSeconds isDst false
current 1296556183 151053711 milliSec 1296556183151
2011.02.01 05:29:43 151053711 nanoSeconds isDst false
fromTime_t
current 1296220855 0 milliSec 1296220855000
2011.01.28 08:20:55 0 nanoSeconds isDst false
current 1296556183 0 milliSec 1296556183000
2011.02.01 05:29:43 0 nanoSeconds isDst false

View File

@@ -1,6 +1,6 @@
one requested 0.400000 diff 0.400272 seconds
two requested 0.200000 diff 0.200259 seconds
one requested 0.200000 diff 0.200247 seconds
two requested 0.400000 diff 0.400347 seconds
one requested 0.000000 diff 0.000073 seconds
two requested 0.000000 diff 0.000098 seconds
one requested 0.400000 diff 0.400276 seconds
two requested 0.200000 diff 0.200325 seconds
one requested 0.200000 diff 0.200255 seconds
two requested 0.400000 diff 0.400288 seconds
one requested 0.000000 diff 0.000027 seconds
two requested 0.000000 diff 0.000087 seconds

View File

@@ -49,13 +49,20 @@ void testPowerSupplyArray(FILE * fd) {
PVStructureArray * powerSupplyArray =
powerSupplyArrayStruct->getStructureArrayField(String("value"));
assert(powerSupplyArray!=0);
int offset = powerSupplyArray->append(3);
int offset = powerSupplyArray->append(5);
powerSupplyArray->setLength(offset);
buffer.clear();
powerSupplyArrayStruct->toString(&buffer);
fprintf(fd,"%s\n",buffer.c_str());
StructureConstPtr structure =
powerSupplyArray->getStructureArray()->getStructure();
fprintf(fd,"after append 5\n%s\n",buffer.c_str());
powerSupplyArray->remove(0,2);
powerSupplyArray->remove(3,1);
buffer.clear();
powerSupplyArrayStruct->toString(&buffer);
fprintf(fd,"after remove 0,1,3%s\n",buffer.c_str());
powerSupplyArray->compress();
buffer.clear();
powerSupplyArrayStruct->toString(&buffer);
fprintf(fd,"after compress%s\n",buffer.c_str());
delete powerSupplyArrayStruct;
}