Fixed const mess
This commit is contained in:
@@ -28,9 +28,11 @@ namespace epics { namespace pvData {
|
||||
delete pImpl;
|
||||
}
|
||||
|
||||
int PVArray::getLength() const {return pImpl->length;}
|
||||
int PVArray::getLength() {return pImpl->length;}
|
||||
|
||||
static StringConst fieldImmutable("field is immutable");
|
||||
int PVArray::getCapacity() {return pImpl->capacity;}
|
||||
|
||||
static String fieldImmutable("field is immutable");
|
||||
|
||||
void PVArray::setLength(int length) {
|
||||
if(PVField::isImmutable()) {
|
||||
@@ -43,7 +45,7 @@ namespace epics { namespace pvData {
|
||||
}
|
||||
|
||||
|
||||
epicsBoolean PVArray::isCapacityImmutable() const
|
||||
epicsBoolean PVArray::isCapacityImmutable()
|
||||
{
|
||||
if(PVField::isImmutable()) {
|
||||
return epicsFalse;
|
||||
@@ -60,7 +62,7 @@ namespace epics { namespace pvData {
|
||||
pImpl->capacityMutable = isMutable;
|
||||
}
|
||||
|
||||
static StringConst capacityImmutable("capacity is immutable");
|
||||
static String capacityImmutable("capacity is immutable");
|
||||
|
||||
void PVArray::setCapacity(int capacity) {
|
||||
if(PVField::isImmutable()) {
|
||||
@@ -74,9 +76,9 @@ namespace epics { namespace pvData {
|
||||
pImpl->capacity = capacity;
|
||||
}
|
||||
|
||||
void PVArray::toString(StringBuilder buf) const {toString(buf,0);}
|
||||
void PVArray::toString(StringBuilder buf) {toString(buf,0);}
|
||||
|
||||
void PVArray::toString(StringBuilder buf, int indentLevel) const
|
||||
void PVArray::toString(StringBuilder buf, int indentLevel)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
|
||||
static StringConst notImplemented("not implemented");
|
||||
static String notImplemented("not implemented");
|
||||
|
||||
static Convert *convert = 0;
|
||||
|
||||
@@ -60,14 +60,14 @@ static StringConst notImplemented("not implemented");
|
||||
delete pImpl;
|
||||
}
|
||||
|
||||
StringConst PVField::getRequesterName() const
|
||||
String PVField::getRequesterName()
|
||||
{
|
||||
static StringConst none("none");
|
||||
static String none("none");
|
||||
if(pImpl->requester!=0) return pImpl->requester->getRequesterName();
|
||||
return none;
|
||||
}
|
||||
|
||||
void PVField::message(StringConst message,MessageType messageType) const
|
||||
void PVField::message(String message,MessageType messageType)
|
||||
{
|
||||
if(pImpl->requester) {
|
||||
pImpl->requester->message(message,messageType);
|
||||
@@ -80,7 +80,7 @@ static StringConst notImplemented("not implemented");
|
||||
}
|
||||
void PVField::setRequester(Requester *prequester)
|
||||
{
|
||||
static StringConst requesterPresent =
|
||||
static String requesterPresent =
|
||||
"Logic Error. requester is already present";
|
||||
if(pImpl->requester==0) {
|
||||
pImpl->requester = prequester;
|
||||
@@ -89,19 +89,19 @@ static StringConst notImplemented("not implemented");
|
||||
throw std::logic_error(requesterPresent);
|
||||
}
|
||||
|
||||
int PVField::getFieldOffset() const
|
||||
int PVField::getFieldOffset()
|
||||
{
|
||||
if(pImpl->nextFieldOffset==0) computeOffset(this);
|
||||
return pImpl->fieldOffset;
|
||||
}
|
||||
|
||||
int PVField::getNextFieldOffset() const
|
||||
int PVField::getNextFieldOffset()
|
||||
{
|
||||
if(pImpl->nextFieldOffset==0) computeOffset(this);
|
||||
return pImpl->nextFieldOffset;
|
||||
}
|
||||
|
||||
int PVField::getNumberFields() const
|
||||
int PVField::getNumberFields()
|
||||
{
|
||||
if(pImpl->nextFieldOffset==0) computeOffset(this);
|
||||
return (pImpl->nextFieldOffset - pImpl->fieldOffset);
|
||||
@@ -114,25 +114,25 @@ static StringConst notImplemented("not implemented");
|
||||
return pImpl->pvAuxInfo;
|
||||
}
|
||||
|
||||
epicsBoolean PVField::isImmutable() const {return pImpl->immutable;}
|
||||
epicsBoolean PVField::isImmutable() {return pImpl->immutable;}
|
||||
|
||||
void PVField::setImmutable() {pImpl->immutable = epicsTrue;}
|
||||
|
||||
FieldConstPtr PVField::getField() const {return pImpl->field;}
|
||||
FieldConstPtr PVField::getField() {return pImpl->field;}
|
||||
|
||||
PVStructure * PVField::getParent() const {return pImpl->parent;}
|
||||
PVStructure * PVField::getParent() {return pImpl->parent;}
|
||||
|
||||
void PVField::replacePVField(PVField * newPVField)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
void PVField::renameField(StringConst newName)
|
||||
void PVField::renameField(String newName)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
void PVField::postPut() const
|
||||
void PVField::postPut()
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
@@ -142,14 +142,14 @@ static StringConst notImplemented("not implemented");
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
void PVField::toString(StringBuilder buf) const {toString(buf,0);}
|
||||
void PVField::toString(StringBuilder buf) {toString(buf,0);}
|
||||
|
||||
void PVField::toString(StringBuilder buf,int indentLevel) const
|
||||
void PVField::toString(StringBuilder buf,int indentLevel)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
void PVField::computeOffset(PVField const * const pvField) {
|
||||
void PVField::computeOffset(PVField * pvField) {
|
||||
PVStructure *pvTop = pvField->getParent();
|
||||
if(pvTop==0) {
|
||||
pvTop = (PVStructure *)pvField;
|
||||
@@ -160,7 +160,7 @@ static StringConst notImplemented("not implemented");
|
||||
}
|
||||
int offset = 0;
|
||||
int nextOffset = 1;
|
||||
PVFieldArrayPtr pvFields = pvTop->getPVFields();
|
||||
PVFieldPtrArray pvFields = pvTop->getPVFields();
|
||||
for(int i=0; i < pvTop->getStructure()->getNumberFields(); i++) {
|
||||
offset = nextOffset;
|
||||
PVField *pvField = pvFields[i];
|
||||
@@ -185,11 +185,11 @@ static StringConst notImplemented("not implemented");
|
||||
top->pImpl->nextFieldOffset = nextOffset;
|
||||
}
|
||||
|
||||
void PVField::computeOffset(PVField const * const pvField,int offset) {
|
||||
void PVField::computeOffset(PVField * pvField,int offset) {
|
||||
int beginOffset = offset;
|
||||
int nextOffset = offset + 1;
|
||||
PVStructure *pvStructure = (PVStructure *)pvField;
|
||||
PVFieldArrayPtr pvFields = pvStructure->getPVFields();
|
||||
PVFieldPtrArray pvFields = pvStructure->getPVFields();
|
||||
for(int i=0; i < pvStructure->getStructure()->getNumberFields(); i++) {
|
||||
offset = nextOffset;
|
||||
PVField *pvSubField = pvFields[i];
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace epics { namespace pvData {
|
||||
PVScalar::PVScalar(PVStructure *parent,ScalarConstPtr scalar)
|
||||
: PVField(parent,scalar) {}
|
||||
|
||||
ScalarConstPtr PVScalar::getScalar() const
|
||||
ScalarConstPtr PVScalar::getScalar()
|
||||
{
|
||||
return (ScalarConstPtr) PVField::getField();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace epics { namespace pvData {
|
||||
ScalarArrayConstPtr scalarArray)
|
||||
: PVArray(parent,scalarArray) {}
|
||||
|
||||
ScalarArrayConstPtr PVScalarArray::getScalarArray() const
|
||||
ScalarArrayConstPtr PVScalarArray::getScalarArray()
|
||||
{
|
||||
return (ScalarArrayConstPtr) PVField::getField();
|
||||
}
|
||||
|
||||
@@ -18,14 +18,15 @@ namespace epics { namespace pvData {
|
||||
public:
|
||||
BasePVDouble(PVStructure *parent,ScalarConstPtr scalar);
|
||||
virtual ~BasePVDouble();
|
||||
virtual double get()const;
|
||||
virtual double get();
|
||||
virtual void put(double val);
|
||||
virtual void serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher) const;
|
||||
SerializableControl *pflusher) ;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,
|
||||
DeserializableControl *pflusher);
|
||||
virtual void toString(StringBuilder buf)const;
|
||||
virtual void toString(StringBuilder buf,int indentLevel)const;
|
||||
virtual void toString(StringBuilder buf);
|
||||
virtual void toString(StringBuilder buf,int indentLevel);
|
||||
virtual epicsBoolean equals(PVField *pv) ;
|
||||
private:
|
||||
double value;
|
||||
};
|
||||
@@ -36,12 +37,12 @@ namespace epics { namespace pvData {
|
||||
|
||||
BasePVDouble::~BasePVDouble() {}
|
||||
|
||||
double BasePVDouble::get()const { return value;}
|
||||
double BasePVDouble::get() { return value;}
|
||||
|
||||
void BasePVDouble::put(double val){value = val;}
|
||||
|
||||
void BasePVDouble::serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher) const
|
||||
SerializableControl *pflusher)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
@@ -52,13 +53,18 @@ namespace epics { namespace pvData {
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
void BasePVDouble::toString(StringBuilder buf)const {toString(buf,0);}
|
||||
void BasePVDouble::toString(StringBuilder buf) {toString(buf,0);}
|
||||
|
||||
void BasePVDouble::toString(StringBuilder buf,int indentLevel) const
|
||||
void BasePVDouble::toString(StringBuilder buf,int indentLevel)
|
||||
{
|
||||
convert->getString(buf,this,indentLevel);
|
||||
PVField::toString(buf,indentLevel);
|
||||
}
|
||||
|
||||
epicsBoolean BasePVDouble::equals(PVField *)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
}}
|
||||
#endif /* BASEPVDOUBLE_H */
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
#include <epicsTypes.h>
|
||||
#include "pvData.h"
|
||||
#include "factory.h"
|
||||
#include "AbstractPVScalarArray.h"
|
||||
@@ -21,17 +22,18 @@ namespace epics { namespace pvData {
|
||||
BasePVDoubleArray(PVStructure *parent,ScalarArrayConstPtr scalarArray);
|
||||
virtual ~BasePVDoubleArray();
|
||||
virtual void setCapacity(int capacity);
|
||||
virtual int get(int offset, int length, DoubleArrayData *data) const;
|
||||
virtual int put(int offset,int length,DoubleArrayPtr from,
|
||||
virtual int get(int offset, int length, DoubleArrayData *data) ;
|
||||
virtual int put(int offset,int length,DoubleArray from,
|
||||
int fromOffset);
|
||||
virtual void shareData(DoubleArrayPtr from);
|
||||
// from Serializable
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) const;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher);
|
||||
virtual void serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher, int offset, int count) const;
|
||||
virtual void toString(StringBuilder buf)const;
|
||||
virtual void toString(StringBuilder buf,int indentLevel)const;
|
||||
virtual void shareData(DoubleArrayData *from);
|
||||
// from Serializable
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) ;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher);
|
||||
virtual void serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher, int offset, int count) ;
|
||||
virtual void toString(StringBuilder buf);
|
||||
virtual void toString(StringBuilder buf,int indentLevel);
|
||||
virtual epicsBoolean equals(PVField *pv) ;
|
||||
private:
|
||||
double *doubleArray;
|
||||
};
|
||||
@@ -52,25 +54,25 @@ namespace epics { namespace pvData {
|
||||
}
|
||||
|
||||
int BasePVDoubleArray::get(int offset, int length,
|
||||
DoubleArrayData *data) const
|
||||
DoubleArrayData *data)
|
||||
{
|
||||
data->data = doubleArray;
|
||||
return getLength();
|
||||
}
|
||||
|
||||
int BasePVDoubleArray::put(int offset,int length,
|
||||
DoubleArrayPtr from,int fromOffset)
|
||||
DoubleArray from,int fromOffset)
|
||||
{
|
||||
return getLength();
|
||||
}
|
||||
|
||||
void BasePVDoubleArray::shareData(DoubleArrayPtr from)
|
||||
void BasePVDoubleArray::shareData(DoubleArrayData *from)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
void BasePVDoubleArray::serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher) const
|
||||
SerializableControl *pflusher)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
@@ -82,21 +84,25 @@ namespace epics { namespace pvData {
|
||||
}
|
||||
|
||||
void BasePVDoubleArray::serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher, int offset, int count) const
|
||||
SerializableControl *pflusher, int offset, int count)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
void BasePVDoubleArray::toString(StringBuilder buf)const
|
||||
void BasePVDoubleArray::toString(StringBuilder buf)
|
||||
{
|
||||
toString(buf,1);
|
||||
}
|
||||
|
||||
void BasePVDoubleArray::toString(StringBuilder buf,int indentLevel)const
|
||||
void BasePVDoubleArray::toString(StringBuilder buf,int indentLevel)
|
||||
{
|
||||
convert->getString(buf,this,indentLevel);
|
||||
PVArray::toString(buf,indentLevel);
|
||||
}
|
||||
|
||||
epicsBoolean BasePVDoubleArray::equals(PVField *pv)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
}}
|
||||
#endif /* BASEPVDOUBLEARRAY_H */
|
||||
|
||||
@@ -16,8 +16,8 @@ namespace epics { namespace pvData {
|
||||
~PVStructurePvt();
|
||||
|
||||
int numberFields;
|
||||
PVFieldArrayPtr pvFields;
|
||||
StringConst const extendsStructureName;
|
||||
PVFieldPtrArray pvFields;
|
||||
String extendsStructureName;
|
||||
};
|
||||
|
||||
PVStructurePvt::PVStructurePvt()
|
||||
@@ -53,12 +53,12 @@ namespace epics { namespace pvData {
|
||||
return (StructureConstPtr)PVField::getField();
|
||||
}
|
||||
|
||||
PVFieldArrayPtr PVStructure::getPVFields()
|
||||
PVFieldPtrArray PVStructure::getPVFields()
|
||||
{
|
||||
return pImpl->pvFields;
|
||||
}
|
||||
|
||||
PVFieldPtr PVStructure::getSubField(StringConst fieldName)
|
||||
PVFieldPtr PVStructure::getSubField(String fieldName)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
@@ -73,93 +73,93 @@ namespace epics { namespace pvData {
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
void PVStructure::appendPVFields(PVFieldArrayPtr pvFields)
|
||||
void PVStructure::appendPVFields(PVFieldPtrArray pvFields)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
void PVStructure::removePVField(StringConst fieldName)
|
||||
void PVStructure::removePVField(String fieldName)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVBoolean *PVStructure::getBooleanField(StringConst fieldName)
|
||||
PVBoolean *PVStructure::getBooleanField(String fieldName)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVByte *PVStructure::getByteField(StringConst fieldName)
|
||||
PVByte *PVStructure::getByteField(String fieldName)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVShort *PVStructure::getShortField(StringConst fieldName)
|
||||
PVShort *PVStructure::getShortField(String fieldName)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVInt *PVStructure::getIntField(StringConst fieldName)
|
||||
PVInt *PVStructure::getIntField(String fieldName)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVLong *PVStructure::getLongField(StringConst fieldName)
|
||||
PVLong *PVStructure::getLongField(String fieldName)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVFloat *PVStructure::getFloatField(StringConst fieldName)
|
||||
PVFloat *PVStructure::getFloatField(String fieldName)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVDouble *PVStructure::getDoubleField(StringConst fieldName)
|
||||
PVDouble *PVStructure::getDoubleField(String fieldName)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVString *PVStructure::getStringField(StringConst fieldName)
|
||||
PVString *PVStructure::getStringField(String fieldName)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVStructure *PVStructure::getStructureField(StringConst fieldName)
|
||||
PVStructure *PVStructure::getStructureField(String fieldName)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVScalarArray *PVStructure::getScalarArrayField(
|
||||
StringConst fieldName,ScalarType elementType)
|
||||
String fieldName,ScalarType elementType)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVStructureArray *PVStructure::getStructureArrayField(
|
||||
StringConst fieldName)
|
||||
String fieldName)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
StringConst PVStructure::getExtendsStructureName()
|
||||
String PVStructure::getExtendsStructureName()
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
epicsBoolean PVStructure::putExtendsStructureName(
|
||||
StringConst extendsStructureName)
|
||||
String extendsStructureName)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
void PVStructure::toString(StringBuilder buf) const {toString(buf,0);}
|
||||
void PVStructure::toString(StringBuilder buf) {toString(buf,0);}
|
||||
|
||||
void PVStructure::toString(StringBuilder buf,int indentLevel) const
|
||||
void PVStructure::toString(StringBuilder buf,int indentLevel)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
void PVStructure::serialize(
|
||||
ByteBuffer *pbuffer,SerializableControl *pflusher) const
|
||||
ByteBuffer *pbuffer,SerializableControl *pflusher)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
@@ -171,13 +171,13 @@ namespace epics { namespace pvData {
|
||||
}
|
||||
|
||||
void PVStructure::serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher, int offset, int count) const
|
||||
SerializableControl *pflusher, int offset, int count)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
void PVStructure::serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher,BitSet *pbitSet) const
|
||||
SerializableControl *pflusher,BitSet *pbitSet)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
@@ -188,6 +188,11 @@ namespace epics { namespace pvData {
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
epicsBoolean PVStructure::equals(PVField *pv)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
class BasePVStructure : public PVStructure {
|
||||
public:
|
||||
BasePVStructure(PVStructure *parent,StructureConstPtr structure);
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace epics { namespace pvData {
|
||||
|
||||
StructureArrayConstPtr structureArray;
|
||||
StructureArrayData *structureArrayData;
|
||||
PVStructureArrayPtr pvStructureArray;
|
||||
PVStructurePtrArray pvStructureArray;
|
||||
};
|
||||
PVStructureArrayPvt::PVStructureArrayPvt(
|
||||
StructureArrayConstPtr structureArray)
|
||||
@@ -45,30 +45,30 @@ namespace epics { namespace pvData {
|
||||
delete pImpl;
|
||||
}
|
||||
|
||||
StructureArrayConstPtr PVStructureArray::getStructureArray() const
|
||||
StructureArrayConstPtr PVStructureArray::getStructureArray()
|
||||
{
|
||||
return pImpl->structureArray;
|
||||
}
|
||||
|
||||
int PVStructureArray::get(
|
||||
int offset, int length, StructureArrayData *data) const
|
||||
int offset, int length, StructureArrayData *data)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
int PVStructureArray::put(int offset,int length,
|
||||
PVStructureArrayPtr from, int fromOffset)
|
||||
PVStructurePtrArray from, int fromOffset)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
void PVStructureArray::shareData(PVStructureArrayPtr from)
|
||||
void PVStructureArray::shareData(StructureArrayData *from)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
void PVStructureArray::serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher) const
|
||||
SerializableControl *pflusher)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
@@ -80,14 +80,19 @@ namespace epics { namespace pvData {
|
||||
}
|
||||
|
||||
void PVStructureArray::serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher, int offset, int count) const
|
||||
SerializableControl *pflusher, int offset, int count)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
void PVStructureArray::toString(StringBuilder buf) const {toString(buf,0);}
|
||||
void PVStructureArray::toString(StringBuilder buf) {toString(buf,0);}
|
||||
|
||||
void PVStructureArray::toString(StringBuilder buf,int indentLevel) const
|
||||
void PVStructureArray::toString(StringBuilder buf,int indentLevel)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
epicsBoolean PVStructureArray::equals(PVField *pv)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -20,22 +20,22 @@ namespace epics { namespace pvData {
|
||||
|
||||
class BaseField : public Field {
|
||||
public:
|
||||
BaseField(StringConst fieldName,Type type);
|
||||
BaseField(String fieldName,Type type);
|
||||
virtual ~BaseField();
|
||||
virtual void decReferenceCount() const;
|
||||
virtual void incReferenceCount() const {referenceCount++;}
|
||||
virtual int getReferenceCount() const {return referenceCount;}
|
||||
virtual StringConst getFieldName() const {return fieldName;}
|
||||
virtual String getFieldName() const {return fieldName;}
|
||||
virtual Type getType() const {return type;}
|
||||
virtual void toString(StringBuilder buf) const {return toString(buf,0);}
|
||||
virtual void toString(StringBuilder buf,int indentLevel) const;
|
||||
private:
|
||||
StringConst fieldName;
|
||||
String fieldName;
|
||||
Type type;
|
||||
mutable volatile int referenceCount;
|
||||
};
|
||||
|
||||
BaseField::BaseField(StringConst fieldName,Type type)
|
||||
BaseField::BaseField(String fieldName,Type type)
|
||||
:fieldName(fieldName),type(type), referenceCount(0){}
|
||||
|
||||
BaseField::~BaseField() {
|
||||
@@ -65,12 +65,12 @@ namespace epics { namespace pvData {
|
||||
|
||||
class BaseScalar: private BaseField,public Scalar {
|
||||
public:
|
||||
BaseScalar(StringConst fieldName,ScalarType scalarType);
|
||||
BaseScalar(String fieldName,ScalarType scalarType);
|
||||
virtual ~BaseScalar();
|
||||
virtual void incReferenceCount() const {BaseField::incReferenceCount();}
|
||||
virtual void decReferenceCount() const {BaseField::decReferenceCount();}
|
||||
virtual int getReferenceCount() const {return BaseField::getReferenceCount();}
|
||||
virtual StringConst getFieldName() const{ return BaseField::getFieldName(); }
|
||||
virtual String getFieldName() const{ return BaseField::getFieldName(); }
|
||||
virtual Type getType() const{return BaseField::getType();}
|
||||
virtual ScalarType getScalarType() const { return scalarType;}
|
||||
virtual void toString(StringBuilder buf) const {toString(buf,0);}
|
||||
@@ -79,7 +79,7 @@ namespace epics { namespace pvData {
|
||||
ScalarType scalarType;
|
||||
};
|
||||
|
||||
BaseScalar::BaseScalar(StringConst fieldName,ScalarType scalarType)
|
||||
BaseScalar::BaseScalar(String fieldName,ScalarType scalarType)
|
||||
: BaseField(fieldName,scalar),scalarType(scalarType){}
|
||||
BaseScalar::~BaseScalar() {}
|
||||
|
||||
@@ -94,12 +94,12 @@ namespace epics { namespace pvData {
|
||||
|
||||
class BaseScalarArray: private BaseField,public ScalarArray {
|
||||
public:
|
||||
BaseScalarArray(StringConst fieldName,ScalarType elementType);
|
||||
BaseScalarArray(String fieldName,ScalarType elementType);
|
||||
virtual ~BaseScalarArray();
|
||||
virtual void incReferenceCount() const {BaseField::incReferenceCount();}
|
||||
virtual void decReferenceCount() const {BaseField::decReferenceCount();}
|
||||
virtual int getReferenceCount() const {return BaseField::getReferenceCount();}
|
||||
virtual StringConst getFieldName() const{ return BaseField::getFieldName(); }
|
||||
virtual String getFieldName() const{ return BaseField::getFieldName(); }
|
||||
virtual Type getType() const{return BaseField::getType();}
|
||||
virtual ScalarType getElementType() const { return elementType;}
|
||||
virtual void toString(StringBuilder buf) const {toString(buf,0);}
|
||||
@@ -109,7 +109,7 @@ namespace epics { namespace pvData {
|
||||
};
|
||||
|
||||
BaseScalarArray::BaseScalarArray
|
||||
(StringConst fieldName,ScalarType elementType)
|
||||
(String fieldName,ScalarType elementType)
|
||||
: BaseField(fieldName,scalar),elementType(elementType){}
|
||||
BaseScalarArray::~BaseScalarArray() {}
|
||||
|
||||
@@ -124,16 +124,16 @@ namespace epics { namespace pvData {
|
||||
|
||||
class BaseStructure: private BaseField,public Structure {
|
||||
public:
|
||||
BaseStructure(StringConst fieldName, int numberFields,FieldConstPtrArray fields);
|
||||
BaseStructure(String fieldName, int numberFields,FieldConstPtrArray fields);
|
||||
virtual ~BaseStructure();
|
||||
virtual void incReferenceCount() const {BaseField::incReferenceCount();}
|
||||
virtual void decReferenceCount() const {BaseField::decReferenceCount();}
|
||||
virtual int getReferenceCount() const {return BaseField::getReferenceCount();}
|
||||
virtual StringConst getFieldName() const{ return BaseField::getFieldName(); }
|
||||
virtual String getFieldName() const{ return BaseField::getFieldName(); }
|
||||
virtual Type getType() const{return BaseField::getType();}
|
||||
virtual int const getNumberFields() const {return numberFields;}
|
||||
virtual FieldConstPtr getField(StringConst fieldName) const;
|
||||
virtual int getFieldIndex(StringConst fieldName) const;
|
||||
virtual FieldConstPtr getField(String fieldName) const;
|
||||
virtual int getFieldIndex(String fieldName) const;
|
||||
virtual FieldConstPtrArray getFields() const { return fields;}
|
||||
virtual void toString(StringBuilder buf) const {toString(buf,0);}
|
||||
virtual void toString(StringBuilder buf,int indentLevel) const;
|
||||
@@ -142,17 +142,17 @@ namespace epics { namespace pvData {
|
||||
FieldConstPtrArray fields;
|
||||
};
|
||||
|
||||
BaseStructure::BaseStructure (StringConst fieldName,
|
||||
BaseStructure::BaseStructure (String fieldName,
|
||||
int numberFields, FieldConstPtrArray fields)
|
||||
: BaseField(fieldName,structure),
|
||||
numberFields(numberFields),
|
||||
fields(fields)
|
||||
{
|
||||
for(int i=0; i<numberFields; i++) {
|
||||
StringConst name = fields[i]->getFieldName();
|
||||
String name = fields[i]->getFieldName();
|
||||
// look for duplicates
|
||||
for(int j=i+1; j<numberFields; j++) {
|
||||
StringConst otherName = fields[j]->getFieldName();
|
||||
String otherName = fields[j]->getFieldName();
|
||||
int result = name.compare(otherName);
|
||||
if(result==0) {
|
||||
String message("duplicate fieldName ");
|
||||
@@ -172,7 +172,7 @@ namespace epics { namespace pvData {
|
||||
}
|
||||
}
|
||||
|
||||
FieldConstPtr BaseStructure::getField(StringConst fieldName) const {
|
||||
FieldConstPtr BaseStructure::getField(String fieldName) const {
|
||||
for(int i=0; i<numberFields; i++) {
|
||||
FieldConstPtr pfield = fields[i];
|
||||
int result = fieldName.compare(pfield->getFieldName());
|
||||
@@ -181,7 +181,7 @@ namespace epics { namespace pvData {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int BaseStructure::getFieldIndex(StringConst fieldName) const {
|
||||
int BaseStructure::getFieldIndex(String fieldName) const {
|
||||
for(int i=0; i<numberFields; i++) {
|
||||
FieldConstPtr pfield = fields[i];
|
||||
int result = fieldName.compare(pfield->getFieldName());
|
||||
@@ -205,12 +205,12 @@ namespace epics { namespace pvData {
|
||||
|
||||
class BaseStructureArray: private BaseField,public StructureArray {
|
||||
public:
|
||||
BaseStructureArray(StringConst fieldName,StructureConstPtr structure);
|
||||
BaseStructureArray(String fieldName,StructureConstPtr structure);
|
||||
virtual ~BaseStructureArray();
|
||||
virtual void incReferenceCount() const {BaseField::incReferenceCount();}
|
||||
virtual void decReferenceCount() const {BaseField::decReferenceCount();}
|
||||
virtual int getReferenceCount() const {return BaseField::getReferenceCount();}
|
||||
virtual StringConst getFieldName() const{
|
||||
virtual String getFieldName() const{
|
||||
return BaseField::getFieldName();
|
||||
}
|
||||
virtual Type getType() const{return BaseField::getType();}
|
||||
@@ -221,7 +221,7 @@ namespace epics { namespace pvData {
|
||||
StructureConstPtr pstructure;
|
||||
};
|
||||
|
||||
BaseStructureArray::BaseStructureArray(StringConst fieldName,StructureConstPtr structure)
|
||||
BaseStructureArray::BaseStructureArray(String fieldName,StructureConstPtr structure)
|
||||
: BaseField(fieldName,structureArray),pstructure(structure)
|
||||
{
|
||||
pstructure->incReferenceCount();
|
||||
@@ -241,7 +241,7 @@ namespace epics { namespace pvData {
|
||||
|
||||
FieldCreate::FieldCreate(){};
|
||||
|
||||
ScalarConstPtr FieldCreate::createScalar(StringConst fieldName,
|
||||
ScalarConstPtr FieldCreate::createScalar(String fieldName,
|
||||
ScalarType scalarType) const
|
||||
{
|
||||
BaseScalar *baseScalar = new BaseScalar(fieldName,scalarType);
|
||||
@@ -249,13 +249,13 @@ namespace epics { namespace pvData {
|
||||
}
|
||||
|
||||
ScalarArrayConstPtr FieldCreate::createScalarArray(
|
||||
StringConst fieldName,ScalarType elementType) const
|
||||
String fieldName,ScalarType elementType) const
|
||||
{
|
||||
BaseScalarArray *baseScalarArray = new BaseScalarArray(fieldName,elementType);
|
||||
return baseScalarArray;
|
||||
}
|
||||
StructureConstPtr FieldCreate::createStructure (
|
||||
StringConst fieldName,int numberFields,
|
||||
String fieldName,int numberFields,
|
||||
FieldConstPtr fields[]) const
|
||||
{
|
||||
BaseStructure *baseStructure = new BaseStructure(
|
||||
@@ -263,13 +263,13 @@ namespace epics { namespace pvData {
|
||||
return baseStructure;
|
||||
}
|
||||
StructureArrayConstPtr FieldCreate::createStructureArray(
|
||||
StringConst fieldName,StructureConstPtr structure) const
|
||||
String fieldName,StructureConstPtr structure) const
|
||||
{
|
||||
BaseStructureArray *baseStructureArray = new BaseStructureArray(fieldName,structure);
|
||||
return baseStructureArray;
|
||||
}
|
||||
|
||||
FieldConstPtr FieldCreate::create(StringConst fieldName,
|
||||
FieldConstPtr FieldCreate::create(String fieldName,
|
||||
FieldConstPtr pfield) const
|
||||
{
|
||||
Type type = pfield->getType();
|
||||
|
||||
@@ -17,6 +17,7 @@ LIBSRCS += PVAuxInfoImpl.cpp
|
||||
LIBSRCS += FieldCreateFactory.cpp
|
||||
LIBSRCS += PVDataCreateFactory.cpp
|
||||
LIBSRCS += Convert.cpp
|
||||
LIBSRCS += StandardField.cpp
|
||||
|
||||
LIBRARY=pvFactory
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@ namespace epics { namespace pvData {
|
||||
public:
|
||||
PVAuxInfoPvt(PVField *pvField)
|
||||
: pvField(pvField),
|
||||
theMap(std::map<StringConst, PVScalar * >())
|
||||
theMap(std::map<String, PVScalar * >())
|
||||
{}
|
||||
PVField *pvField;
|
||||
std::map<StringConst, PVScalar * > theMap;
|
||||
std::map<String, PVScalar * > theMap;
|
||||
};
|
||||
|
||||
PVAuxInfo::PVAuxInfo(PVField *pvField)
|
||||
@@ -35,9 +35,9 @@ namespace epics { namespace pvData {
|
||||
return pImpl->pvField;
|
||||
}
|
||||
|
||||
typedef std::map<StringConst,PVScalar * >::const_iterator map_iterator;
|
||||
typedef std::map<String,PVScalar * >::const_iterator map_iterator;
|
||||
|
||||
PVScalar * PVAuxInfo::createInfo(StringConst key,ScalarType scalarType)
|
||||
PVScalar * PVAuxInfo::createInfo(String key,ScalarType scalarType)
|
||||
{
|
||||
map_iterator i = pImpl->theMap.find(key);
|
||||
if(i!=pImpl->theMap.end()) {
|
||||
@@ -48,17 +48,17 @@ namespace epics { namespace pvData {
|
||||
pImpl->pvField->message(message,errorMessage);
|
||||
}
|
||||
PVScalar *pvScalar = pvDataCreate->createPVScalar(0,key,scalarType);
|
||||
pImpl->theMap.insert(std::pair<StringConst,PVScalar * >(key, pvScalar));
|
||||
pImpl->theMap.insert(std::pair<String,PVScalar * >(key, pvScalar));
|
||||
return pvScalar;
|
||||
|
||||
}
|
||||
|
||||
std::map<StringConst, PVScalar * > *PVAuxInfo::getInfos()
|
||||
std::map<String, PVScalar * > *PVAuxInfo::getInfos()
|
||||
{
|
||||
return &pImpl->theMap;
|
||||
}
|
||||
|
||||
PVScalar * PVAuxInfo::getInfo(StringConst key)
|
||||
PVScalar * PVAuxInfo::getInfo(String key)
|
||||
{
|
||||
map_iterator i = pImpl->theMap.find(key);
|
||||
if(i!=pImpl->theMap.end()) return i->second;
|
||||
@@ -74,7 +74,7 @@ namespace epics { namespace pvData {
|
||||
{
|
||||
map_iterator i = pImpl->theMap.begin();
|
||||
while(i!=pImpl->theMap.end()) {
|
||||
StringConst key = i->first;
|
||||
String key = i->first;
|
||||
PVScalar *value = i->second;
|
||||
*buf += " ";
|
||||
*buf += key.c_str();
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
#include <lock.h>
|
||||
#include "lock.h"
|
||||
#include "pvIntrospect.h"
|
||||
#include "pvData.h"
|
||||
#include "convert.h"
|
||||
#include "factory.h"
|
||||
@@ -45,7 +46,7 @@ namespace epics { namespace pvData {
|
||||
};
|
||||
|
||||
PVField *PVDataCreate::createPVField(PVStructure *parent,
|
||||
StringConst fieldName,PVField * fieldToClone)
|
||||
String fieldName,PVField * fieldToClone)
|
||||
{
|
||||
switch(fieldToClone->getField()->getType()) {
|
||||
case scalar:
|
||||
@@ -78,7 +79,7 @@ namespace epics { namespace pvData {
|
||||
};
|
||||
|
||||
PVScalar *PVDataCreate::createPVScalar(PVStructure *parent,
|
||||
StringConst fieldName,ScalarType scalarType)
|
||||
String fieldName,ScalarType scalarType)
|
||||
{
|
||||
if(fieldCreate==0) fieldCreate = getFieldCreate();
|
||||
ScalarConstPtr scalar = fieldCreate->createScalar(fieldName,scalarType);
|
||||
@@ -86,7 +87,7 @@ namespace epics { namespace pvData {
|
||||
};
|
||||
|
||||
PVScalar *PVDataCreate::createPVScalar(PVStructure *parent,
|
||||
StringConst fieldName,PVScalar * scalarToClone)
|
||||
String fieldName,PVScalar * scalarToClone)
|
||||
{
|
||||
PVScalar *pvScalar = createPVScalar(parent,fieldName,
|
||||
scalarToClone->getScalar()->getScalarType());
|
||||
@@ -114,13 +115,13 @@ namespace epics { namespace pvData {
|
||||
};
|
||||
|
||||
PVScalarArray *PVDataCreate::createPVScalarArray(PVStructure *parent,
|
||||
StringConst fieldName,ScalarType elementType)
|
||||
String fieldName,ScalarType elementType)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
};
|
||||
|
||||
PVScalarArray *PVDataCreate::createPVScalarArray(PVStructure *parent,
|
||||
StringConst fieldName,PVScalarArray * scalarArrayToClone)
|
||||
String fieldName,PVScalarArray * scalarArrayToClone)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
};
|
||||
@@ -138,13 +139,13 @@ namespace epics { namespace pvData {
|
||||
};
|
||||
|
||||
PVStructure *PVDataCreate::createPVStructure(PVStructure *parent,
|
||||
StringConst fieldName,FieldConstPtrArray fields)
|
||||
String fieldName,FieldConstPtrArray fields)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
};
|
||||
|
||||
PVStructure *PVDataCreate::createPVStructure(PVStructure *parent,
|
||||
StringConst fieldName,PVStructure *structToClone)
|
||||
String fieldName,PVStructure *structToClone)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
};
|
||||
|
||||
75
pvDataApp/factory/StandardField.cpp
Normal file
75
pvDataApp/factory/StandardField.cpp
Normal file
@@ -0,0 +1,75 @@
|
||||
/* StandardField.cpp */
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <lock.h>
|
||||
#include "convert.h"
|
||||
#include "standardField.h"
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
static String notImplemented("not implemented");
|
||||
|
||||
StandardField::StandardField(){}
|
||||
|
||||
StandardField::~StandardField(){}
|
||||
|
||||
PVScalar * StandardField::scalarValue(ScalarType type)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVScalarArray * StandardField::scalarArrayValue(ScalarType elementType)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVStructure * StandardField::scalarValue(ScalarType type,String properties)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVStructure * StandardField::scalarArrayValue(ScalarType elementType,
|
||||
String properties)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVStructure * StandardField::enumeratedValue(StringArray choices)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVStructure * StandardField::enumeratedValue(StringArray choices,
|
||||
String properties)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVStructure * StandardField::alarm()
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
PVStructure * StandardField::timeStamp()
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
}
|
||||
|
||||
|
||||
static StandardField* instance = 0;
|
||||
|
||||
|
||||
class StandardFieldExt : public StandardField {
|
||||
public:
|
||||
StandardFieldExt(): StandardField(){};
|
||||
};
|
||||
|
||||
StandardField * getStandardField() {
|
||||
static Mutex *mutex = new Mutex();
|
||||
Lock xx(mutex);
|
||||
|
||||
if(instance==0) instance = new StandardFieldExt();
|
||||
return instance;
|
||||
}
|
||||
|
||||
}}
|
||||
@@ -3,13 +3,14 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
#include <epicsTypes.h>
|
||||
|
||||
#include "pvIntrospect.h"
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
void TypeFunc::toString(StringBuilder buf,const Type type) {
|
||||
static StringConst unknownString = "logic error unknown Type";
|
||||
static String unknownString = "logic error unknown Type";
|
||||
switch(type) {
|
||||
case scalar : *buf += "scalar"; break;
|
||||
case scalarArray : *buf += "scalarArray"; break;
|
||||
@@ -21,24 +22,24 @@ namespace epics { namespace pvData {
|
||||
}
|
||||
|
||||
|
||||
bool ScalarTypeFunc::isInteger(ScalarType type) {
|
||||
if(type>=pvByte && type<=pvLong) return true;
|
||||
return false;
|
||||
epicsBoolean ScalarTypeFunc::isInteger(ScalarType type) {
|
||||
if(type>=pvByte && type<=pvLong) return epicsTrue;
|
||||
return epicsFalse;
|
||||
}
|
||||
|
||||
bool ScalarTypeFunc::isNumeric(ScalarType type) {
|
||||
if(type>=pvByte && type<=pvDouble) return true;
|
||||
return false;
|
||||
epicsBoolean ScalarTypeFunc::isNumeric(ScalarType type) {
|
||||
if(type>=pvByte && type<=pvDouble) return epicsTrue;
|
||||
return epicsFalse;
|
||||
}
|
||||
|
||||
bool ScalarTypeFunc::isPrimitive(ScalarType type) {
|
||||
if(type>=pvBoolean && type<=pvDouble) return true;
|
||||
return false;
|
||||
epicsBoolean ScalarTypeFunc::isPrimitive(ScalarType type) {
|
||||
if(type>=pvBoolean && type<=pvDouble) return epicsTrue;
|
||||
return epicsFalse;
|
||||
}
|
||||
|
||||
ScalarType ScalarTypeFunc::getScalarType(StringConst pvalue) {
|
||||
static StringConst unknownString = "error unknown ScalarType";
|
||||
if(pvalue.compare("boolean")==0) return pvBoolean;
|
||||
ScalarType ScalarTypeFunc::getScalarType(String pvalue) {
|
||||
static String unknownString = "error unknown ScalarType";
|
||||
if(pvalue.compare("epicsBooleanean")==0) return pvBoolean;
|
||||
if(pvalue.compare("byte")==0) return pvByte;
|
||||
if(pvalue.compare("short")==0) return pvShort;
|
||||
if(pvalue.compare("int")==0) return pvInt;
|
||||
@@ -49,7 +50,7 @@ namespace epics { namespace pvData {
|
||||
throw std::invalid_argument(unknownString);
|
||||
}
|
||||
void ScalarTypeFunc::toString(StringBuilder buf,const ScalarType scalarType) {
|
||||
static StringConst unknownString = "logic error unknown ScalarType";
|
||||
static String unknownString = "logic error unknown ScalarType";
|
||||
switch(scalarType) {
|
||||
case pvBoolean : *buf += "pvBoolean"; return;
|
||||
case pvByte : *buf += "pvByte"; return;;
|
||||
|
||||
@@ -5,6 +5,6 @@ namespace epics { namespace pvData {
|
||||
|
||||
class BitSet;
|
||||
// must be defined and implemented
|
||||
|
||||
|
||||
}}
|
||||
#endif /* BITSET_H */
|
||||
|
||||
@@ -8,27 +8,29 @@ namespace epics { namespace pvData {
|
||||
// not sure why I have to define epicsInt64
|
||||
typedef long long epicsInt64;
|
||||
|
||||
class ByteBuffer;
|
||||
|
||||
class ByteBuffer {
|
||||
public:
|
||||
virtual ~ByteBuffer();
|
||||
virtual int getSize() const = 0;
|
||||
virtual int getArrayOffset() const = 0;
|
||||
virtual epicsBoolean getBoolean() const = 0;
|
||||
virtual epicsInt8 getByte() const = 0;
|
||||
virtual epicsInt16 geShort() const = 0;
|
||||
virtual epicsInt32 getInt() const = 0;
|
||||
virtual epicsInt64 getLong() const = 0;
|
||||
virtual float getFloat() const = 0;
|
||||
virtual double getDouble() const = 0;
|
||||
virtual StringConst getString() const = 0;
|
||||
virtual ByteBuffer * putBoolean(epicsBoolean value) const = 0;
|
||||
virtual ByteBuffer * putByte(epicsInt8 value) const = 0;
|
||||
virtual ByteBuffer * geShort(epicsInt16 value) const = 0;
|
||||
virtual ByteBuffer * putInt(epicsInt32 value) const = 0;
|
||||
virtual ByteBuffer * putLong(epicsInt64 value) const = 0;
|
||||
virtual ByteBuffer * putFloat(float value) const = 0;
|
||||
virtual ByteBuffer * putDouble(double value) const = 0;
|
||||
virtual ByteBuffer * putString(StringConst value) const = 0;
|
||||
virtual int getSize() = 0;
|
||||
virtual int getArrayOffset() = 0;
|
||||
virtual epicsBoolean getBoolean() = 0;
|
||||
virtual epicsInt8 getByte() = 0;
|
||||
virtual epicsInt16 geShort() = 0;
|
||||
virtual epicsInt32 getInt() = 0;
|
||||
virtual epicsInt64 getLong() = 0;
|
||||
virtual float getFloat() = 0;
|
||||
virtual double getDouble() = 0;
|
||||
virtual String getString() = 0;
|
||||
virtual ByteBuffer *putBoolean(epicsBoolean value) = 0;
|
||||
virtual ByteBuffer *putByte(epicsInt8 value) = 0;
|
||||
virtual ByteBuffer *geShort(epicsInt16 value) = 0;
|
||||
virtual ByteBuffer *putInt(epicsInt32 value) = 0;
|
||||
virtual ByteBuffer *putLong(epicsInt64 value) = 0;
|
||||
virtual ByteBuffer *putFloat(float value) = 0;
|
||||
virtual ByteBuffer *putDouble(double value) = 0;
|
||||
virtual ByteBuffer *putString(String value) = 0;
|
||||
// Must define arrays
|
||||
};
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace epics { namespace pvData {
|
||||
epicsMutex *lockPtr;
|
||||
};
|
||||
|
||||
|
||||
class Lock : private NoDefaultMethods {
|
||||
public:
|
||||
explicit Lock(Mutex *pm)
|
||||
|
||||
@@ -3,15 +3,22 @@
|
||||
#ifndef REQUESTER_H
|
||||
#define REQUESTER_H
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
enum MessageType {infoMessage,warningMessage,errorMessage,fatalErrorMessage};
|
||||
|
||||
static std::string messageTypeName[] = {"info","warning","error","fatalError"};
|
||||
class Requester;
|
||||
|
||||
enum MessageType {
|
||||
infoMessage,warningMessage,errorMessage,fatalErrorMessage
|
||||
};
|
||||
|
||||
static std::string messageTypeName[] = {
|
||||
"info","warning","error","fatalError"
|
||||
};
|
||||
|
||||
class Requester {
|
||||
public:
|
||||
virtual StringConst getRequesterName() const = 0;
|
||||
virtual void message(StringConst message,MessageType messageType) const = 0;
|
||||
virtual String getRequesterName() = 0;
|
||||
virtual void message(String message,MessageType messageType) = 0;
|
||||
};
|
||||
|
||||
}}
|
||||
#endif /* REQUESTER_H */
|
||||
|
||||
@@ -5,10 +5,15 @@
|
||||
#include "byteBuffer.h"
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
class SerializableControl;
|
||||
class DeserializableControl;
|
||||
class Serializable;
|
||||
class BitSetSerializable;
|
||||
class SerializableArray;
|
||||
|
||||
class SerializableControl {
|
||||
virtual void flushSerializeBuffer() const =0;
|
||||
virtual void ensureBuffer(int size) const =0;
|
||||
virtual void flushSerializeBuffer() =0;
|
||||
virtual void ensureBuffer(int size) =0;
|
||||
};
|
||||
|
||||
class DeserializableControl {
|
||||
@@ -17,25 +22,25 @@ namespace epics { namespace pvData {
|
||||
|
||||
class Serializable {
|
||||
public:
|
||||
virtual void serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher) const = 0;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,
|
||||
DeserializableControl *pflusher) = 0;
|
||||
virtual void serialize(ByteBuffer *buffer,
|
||||
SerializableControl *flusher) = 0;
|
||||
virtual void deserialize(ByteBuffer *buffer,
|
||||
DeserializableControl *flusher) = 0;
|
||||
};
|
||||
|
||||
class BitSetSerializable {
|
||||
public:
|
||||
virtual void serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher,BitSet *pbitSet) const = 0;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,
|
||||
DeserializableControl*pflusher,BitSet *pbitSet) = 0;
|
||||
virtual void serialize(ByteBuffer *buffer,
|
||||
SerializableControl *flusher,BitSet *bitSet) = 0;
|
||||
virtual void deserialize(ByteBuffer *buffer,
|
||||
DeserializableControl *flusher,BitSet *bitSet) = 0;
|
||||
};
|
||||
|
||||
|
||||
class SerializableArray : public Serializable {
|
||||
public:
|
||||
virtual void serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher, int offset, int count) const = 0;
|
||||
virtual void serialize(ByteBuffer *buffer,
|
||||
SerializableControl *flusher, int offset, int count) = 0;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
@@ -5,6 +5,7 @@ include $(TOP)/configure/CONFIG
|
||||
INC += pvIntrospect.h
|
||||
INC += pvData.h
|
||||
INC += convert.h
|
||||
INC += standardField.h
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
#----------------------------------------
|
||||
|
||||
@@ -8,58 +8,58 @@
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
class Convert {
|
||||
class Convert : NoDefaultMethods {
|
||||
public:
|
||||
Convert();
|
||||
~Convert();
|
||||
void getFullName(StringConst buf,PVField const *pvField);
|
||||
void getString(StringBuilder buf,PVField const * pvField,int indentLevel);
|
||||
void getString(StringBuilder buf,PVField const * pvField);
|
||||
void fromString(PVScalar *pv, StringConst from);
|
||||
int fromString(PVScalarArray *pv, StringConst from);
|
||||
void getFullName(StringBuilder buf,PVField *pvField);
|
||||
void getString(StringBuilder buf,PVField * pvField,int indentLevel);
|
||||
void getString(StringBuilder buf,PVField *pvField);
|
||||
void fromString(PVScalar *pv, String from);
|
||||
int fromString(PVScalarArray *pv, String from);
|
||||
int fromStringArray(PVScalarArray *pv, int offset, int length,
|
||||
StringConstArray from, int fromOffset);
|
||||
int toStringArray(PVScalarArray const *pv, int offset, int length,
|
||||
StringConstArray to, int fromOffset);
|
||||
StringArray from, int fromOffset);
|
||||
int toStringArray(PVScalarArray *pv, int offset, int length,
|
||||
StringArray to, int toOffset);
|
||||
epicsBoolean isCopyCompatible(FieldConstPtr from, FieldConstPtr to);
|
||||
void copy(PVField const *from,PVField *to);
|
||||
void copy(PVField *from,PVField *to);
|
||||
epicsBoolean isCopyScalarCompatible(
|
||||
ScalarConstPtr from, ScalarConstPtr to);
|
||||
void copyScalar(PVScalar const *from, PVScalar *to);
|
||||
void copyScalar(PVScalar *from, PVScalar *to);
|
||||
epicsBoolean isCopyScalarArrayCompatible(ScalarArrayConstPtr from,
|
||||
ScalarArrayConstPtr to);
|
||||
int copyScalarArray(PVScalarArray const *from, int offset,
|
||||
int copyScalarArray(PVScalarArray *from, int offset,
|
||||
PVScalarArray *to, int toOffset, int length);
|
||||
epicsBoolean isCopyStructureCompatible(
|
||||
StructureConstPtr from, StructureConstPtr to);
|
||||
void copyStructure(PVStructure const *from, PVStructure *to);
|
||||
void copyStructure(PVStructure *from, PVStructure *to);
|
||||
epicsBoolean isCopyStructureArrayCompatible(
|
||||
StructureArrayConstPtr from, StructureArrayConstPtr to);
|
||||
void copyStructureArray(
|
||||
PVStructureArray const *from, PVStructureArray *to);
|
||||
epicsInt8 toByte(PVScalar const *pv);
|
||||
epicsInt16 toShort(PVScalar const *pv);
|
||||
epicsInt32 toInt(PVScalar const *pv);
|
||||
epicsInt64 toLong(PVScalar const *pv);
|
||||
float toFloat(PVScalar const *pv);
|
||||
double toDouble(PVScalar const *pv);
|
||||
PVStructureArray *from, PVStructureArray *to);
|
||||
epicsInt8 toByte(PVScalar *pv);
|
||||
epicsInt16 toShort(PVScalar *pv);
|
||||
epicsInt32 toInt(PVScalar *pv);
|
||||
epicsInt64 toLong(PVScalar *pv);
|
||||
float toFloat(PVScalar *pv);
|
||||
double toDouble(PVScalar *pv);
|
||||
void fromByte(PVScalar *pv,epicsInt8 from);
|
||||
void fromShort(PVScalar *pv,epicsInt16 from);
|
||||
void fromInt(PVScalar *pv, epicsInt32 from);
|
||||
void fromLong(PVScalar *pv, epicsInt64 from);
|
||||
void fromFloat(PVScalar* pv, float from);
|
||||
void fromDouble(PVScalar *pv, double from);
|
||||
int toByteArray(PVScalarArray const *pv, int offset, int length,
|
||||
int toByteArray(PVScalarArray *pv, int offset, int length,
|
||||
epicsInt8 to[], int toOffset);
|
||||
int toShortArray(PVScalarArray const *pv, int offset, int length,
|
||||
int toShortArray(PVScalarArray *pv, int offset, int length,
|
||||
epicsInt16 to[], int toOffset);
|
||||
int toIntArray(PVScalarArray const *pv, int offset, int length,
|
||||
int toIntArray(PVScalarArray *pv, int offset, int length,
|
||||
epicsInt32 to[], int toOffset);
|
||||
int toLongArray(PVScalarArray const *pv, int offset, int length,
|
||||
int toLongArray(PVScalarArray *pv, int offset, int length,
|
||||
epicsInt64 to[], int toOffset);
|
||||
int toFloatArray(PVScalarArray const *pv, int offset, int length,
|
||||
int toFloatArray(PVScalarArray *pv, int offset, int length,
|
||||
float to[], int toOffset);
|
||||
int toDoubleArray(PVScalarArray const *pv, int offset, int length,
|
||||
int toDoubleArray(PVScalarArray *pv, int offset, int length,
|
||||
double to[], int toOffset);
|
||||
int fromByteArray(PVScalarArray *pv, int offset, int length,
|
||||
epicsInt8 from[], int fromOffset);
|
||||
@@ -74,10 +74,6 @@ namespace epics { namespace pvData {
|
||||
int fromDoubleArray(PVScalarArray *pv, int offset, int length,
|
||||
double from[], int fromOffset);
|
||||
void newLine(StringBuilder buf, int indentLevel);
|
||||
|
||||
private:
|
||||
Convert(Convert const & ); // not implemented
|
||||
Convert & operator=(Convert const &); //not implemented
|
||||
};
|
||||
|
||||
extern Convert * getConvert();
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
#include "serialize.h"
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
class PVAuxInfo;
|
||||
class PostHandler;
|
||||
|
||||
class PVField;
|
||||
class PVScalar;
|
||||
class PVBoolean;
|
||||
@@ -35,6 +38,8 @@ namespace epics { namespace pvData {
|
||||
class PVStructure;
|
||||
class PVStructureArray;
|
||||
|
||||
|
||||
|
||||
// NOTE this prevents compiler from generating default methods for this and
|
||||
// derived classes
|
||||
class PVAuxInfo : private NoDefaultMethods {
|
||||
@@ -42,9 +47,9 @@ namespace epics { namespace pvData {
|
||||
PVAuxInfo(PVField *pvField);
|
||||
~PVAuxInfo();
|
||||
PVField * getPVField();
|
||||
PVScalar * createInfo(StringConst key,ScalarType scalarType);
|
||||
std::map<StringConst, PVScalar * > *getInfos();
|
||||
PVScalar * getInfo(StringConst key);
|
||||
PVScalar * createInfo(String key,ScalarType scalarType);
|
||||
std::map<String, PVScalar * > *getInfos();
|
||||
PVScalar * getInfo(String key);
|
||||
void toString(StringBuilder buf);
|
||||
void toString(StringBuilder buf,int indentLevel);
|
||||
private:
|
||||
@@ -59,38 +64,39 @@ namespace epics { namespace pvData {
|
||||
class PVField : public Requester, public Serializable ,private NoDefaultMethods{
|
||||
public:
|
||||
virtual ~PVField();
|
||||
StringConst getRequesterName() const;
|
||||
virtual void message(StringConst message,MessageType messageType) const;
|
||||
String getRequesterName() ;
|
||||
virtual void message(String message,MessageType messageType) ;
|
||||
virtual void setRequester(Requester *prequester);
|
||||
int getFieldOffset() const;
|
||||
int getNextFieldOffset() const;
|
||||
int getNumberFields() const;
|
||||
int getFieldOffset() ;
|
||||
int getNextFieldOffset() ;
|
||||
int getNumberFields() ;
|
||||
PVAuxInfo * getPVAuxInfo();
|
||||
epicsBoolean isImmutable() const;
|
||||
epicsBoolean isImmutable() ;
|
||||
void setImmutable();
|
||||
FieldConstPtr getField() const;
|
||||
PVStructure * getParent() const;
|
||||
FieldConstPtr getField() ;
|
||||
PVStructure * getParent() ;
|
||||
void replacePVField(PVField * newPVField);
|
||||
void renameField(StringConst newName);
|
||||
void postPut() const;
|
||||
void renameField(String newName);
|
||||
void postPut() ;
|
||||
void setPostHandler(PostHandler *postHandler);
|
||||
virtual void toString(StringBuilder buf) const;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) const;
|
||||
virtual void toString(StringBuilder buf) ;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) ;
|
||||
virtual epicsBoolean equals(PVField *pv) = 0;
|
||||
protected:
|
||||
PVField(PVStructure *parent,FieldConstPtr field);
|
||||
void replaceStructure();
|
||||
private:
|
||||
class PVFieldPvt *pImpl;
|
||||
static void computeOffset(const PVField * const pvField);
|
||||
static void computeOffset(const PVField * const pvField,int offset);
|
||||
static void computeOffset(PVField *pvField);
|
||||
static void computeOffset(PVField *pvField,int offset);
|
||||
};
|
||||
|
||||
class PVScalar : public PVField {
|
||||
public:
|
||||
virtual ~PVScalar();
|
||||
ScalarConstPtr getScalar() const;
|
||||
virtual void toString(StringBuilder buf) const = 0;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) const = 0;
|
||||
ScalarConstPtr getScalar() ;
|
||||
virtual void toString(StringBuilder buf) = 0;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) = 0;
|
||||
protected:
|
||||
PVScalar(PVStructure *parent,ScalarConstPtr scalar);
|
||||
};
|
||||
@@ -98,131 +104,129 @@ namespace epics { namespace pvData {
|
||||
class PVArray : public PVField, public SerializableArray {
|
||||
public:
|
||||
virtual ~PVArray();
|
||||
int getLength() const;
|
||||
int getLength() ;
|
||||
void setLength(int length);
|
||||
int getCapacity() const;
|
||||
epicsBoolean isCapacityImmutable() const;
|
||||
int getCapacity() ;
|
||||
epicsBoolean isCapacityImmutable() ;
|
||||
void setCapacityImmutable(epicsBoolean isMutable);
|
||||
virtual void setCapacity(int capacity) = 0;
|
||||
virtual void serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher) const = 0;
|
||||
SerializableControl *pflusher) = 0;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,
|
||||
DeserializableControl *pflusher) = 0;
|
||||
virtual void serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher, int offset, int count) const = 0;
|
||||
virtual void toString(StringBuilder buf) const;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) const = 0;
|
||||
SerializableControl *pflusher, int offset, int count) = 0;
|
||||
virtual void toString(StringBuilder buf) ;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) = 0;
|
||||
protected:
|
||||
PVArray(PVStructure *parent,FieldConstPtr field);
|
||||
private:
|
||||
class PVArrayPvt *pImpl;
|
||||
class PVArrayPvt * pImpl;
|
||||
};
|
||||
|
||||
|
||||
class PVScalarArray : public PVArray {
|
||||
public:
|
||||
virtual ~PVScalarArray();
|
||||
ScalarArrayConstPtr getScalarArray() const;
|
||||
ScalarArrayConstPtr getScalarArray() ;
|
||||
virtual void setCapacity(int capacity) = 0;
|
||||
virtual void serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher) const = 0;
|
||||
SerializableControl *pflusher) = 0;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,
|
||||
DeserializableControl *pflusher) = 0;
|
||||
virtual void serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher, int offset, int count) const = 0;
|
||||
virtual void toString(StringBuilder buf) const = 0;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) const = 0;
|
||||
SerializableControl *pflusher, int offset, int count) = 0;
|
||||
virtual void toString(StringBuilder buf) = 0;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) = 0;
|
||||
protected:
|
||||
PVScalarArray(PVStructure *parent,ScalarArrayConstPtr scalarArray);
|
||||
private:
|
||||
};
|
||||
|
||||
typedef PVStructure * PVStructurePtr;
|
||||
typedef PVStructurePtr * PVStructureArrayPtr;
|
||||
|
||||
typedef PVStructurePtr* PVStructurePtrArray;
|
||||
class StructureArrayData {
|
||||
public:
|
||||
PVStructureArrayPtr data;
|
||||
PVStructurePtrArray data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVStructureArray : public PVArray {
|
||||
public:
|
||||
virtual ~PVStructureArray();
|
||||
virtual StructureArrayConstPtr getStructureArray() const;
|
||||
virtual StructureArrayConstPtr getStructureArray() ;
|
||||
virtual int get(int offset, int length,
|
||||
StructureArrayData *data) const;
|
||||
StructureArrayData *data) ;
|
||||
virtual int put(int offset,int length,
|
||||
PVStructureArrayPtr from, int fromOffset);
|
||||
virtual void shareData(PVStructureArrayPtr from);
|
||||
PVStructurePtrArray from, int fromOffset);
|
||||
virtual void shareData(StructureArrayData *from);
|
||||
virtual void serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher) const;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher) ;
|
||||
virtual void deserialize(ByteBuffer *buffer,
|
||||
DeserializableControl *pflusher);
|
||||
virtual void serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher, int offset, int count) const;
|
||||
virtual void toString(StringBuilder buf) const;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) const;
|
||||
SerializableControl *pflusher, int offset, int count) ;
|
||||
virtual void toString(StringBuilder buf) ;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) ;
|
||||
virtual epicsBoolean equals(PVField *pv) ;
|
||||
protected:
|
||||
PVStructureArray(PVStructure *parent,
|
||||
StructureArrayConstPtr structureArray);
|
||||
private:
|
||||
PVStructureArray(); // not implemented
|
||||
PVStructureArray(PVStructureArray const & ); // not implemented
|
||||
PVStructureArray & operator=(PVStructureArray const &); //not implemented
|
||||
class PVStructureArrayPvt *pImpl;
|
||||
};
|
||||
|
||||
typedef PVField * PVFieldPtr;
|
||||
typedef PVFieldPtr * PVFieldArrayPtr;
|
||||
typedef PVField* PVFieldPtr;
|
||||
typedef PVFieldPtr * PVFieldPtrArray;
|
||||
|
||||
class PVStructure : public PVField,public BitSetSerializable {
|
||||
public:
|
||||
virtual ~PVStructure();
|
||||
StructureConstPtr getStructure();
|
||||
PVFieldArrayPtr getPVFields();
|
||||
PVFieldPtr getSubField(StringConst fieldName);
|
||||
PVFieldPtr getSubField(int fieldOffset);
|
||||
void appendPVField(PVField * pvField);
|
||||
void appendPVFields(PVFieldArrayPtr pvFields);
|
||||
void removePVField(StringConst fieldName);
|
||||
PVBoolean *getBooleanField(StringConst fieldName);
|
||||
PVByte *getByteField(StringConst fieldName);
|
||||
PVShort *getShortField(StringConst fieldName);
|
||||
PVInt *getIntField(StringConst fieldName);
|
||||
PVLong *getLongField(StringConst fieldName);
|
||||
PVFloat *getFloatField(StringConst fieldName);
|
||||
PVDouble *getDoubleField(StringConst fieldName);
|
||||
PVString *getStringField(StringConst fieldName);
|
||||
PVStructure *getStructureField(StringConst fieldName);
|
||||
PVFieldPtrArray getPVFields();
|
||||
PVField *getSubField(String fieldName);
|
||||
PVField *getSubField(int fieldOffset);
|
||||
void appendPVField(PVField *pvField);
|
||||
void appendPVFields(PVFieldPtrArray pvFields);
|
||||
void removePVField(String fieldName);
|
||||
PVBoolean *getBooleanField(String fieldName);
|
||||
PVByte *getByteField(String fieldName);
|
||||
PVShort *getShortField(String fieldName);
|
||||
PVInt *getIntField(String fieldName);
|
||||
PVLong *getLongField(String fieldName);
|
||||
PVFloat *getFloatField(String fieldName);
|
||||
PVDouble *getDoubleField(String fieldName);
|
||||
PVString *getStringField(String fieldName);
|
||||
PVStructure *getStructureField(String fieldName);
|
||||
PVScalarArray *getScalarArrayField(
|
||||
StringConst fieldName,ScalarType elementType);
|
||||
PVStructureArray *getStructureArrayField(StringConst fieldName);
|
||||
StringConst getExtendsStructureName();
|
||||
String fieldName,ScalarType elementType);
|
||||
PVStructureArray *getStructureArrayField(String fieldName);
|
||||
String getExtendsStructureName();
|
||||
epicsBoolean putExtendsStructureName(
|
||||
StringConst extendsStructureName);
|
||||
virtual void toString(StringBuilder buf) const;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) const;
|
||||
String extendsStructureName);
|
||||
virtual void toString(StringBuilder buf) ;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) ;
|
||||
virtual epicsBoolean equals(PVField *pv) ;
|
||||
virtual void serialize(
|
||||
ByteBuffer *pbuffer,SerializableControl *pflusher) const;
|
||||
ByteBuffer *pbuffer,SerializableControl *pflusher) ;
|
||||
virtual void deserialize(
|
||||
ByteBuffer *pbuffer,DeserializableControl *pflusher);
|
||||
virtual void serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher, int offset, int count) const;
|
||||
SerializableControl *pflusher, int offset, int count) ;
|
||||
virtual void serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher,BitSet *pbitSet) const;
|
||||
SerializableControl *pflusher,BitSet *pbitSet) ;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,
|
||||
DeserializableControl*pflusher,BitSet *pbitSet);
|
||||
protected:
|
||||
PVStructure(PVStructure *parent,StructureConstPtr structure);
|
||||
private:
|
||||
class PVStructurePvt *pImpl;
|
||||
class PVStructurePvt * pImpl;
|
||||
};
|
||||
|
||||
class PVBoolean : public PVScalar {
|
||||
public:
|
||||
virtual ~PVBoolean();
|
||||
virtual epicsBoolean get() const = 0;
|
||||
virtual epicsBoolean get() = 0;
|
||||
virtual void put(epicsBoolean value) = 0;
|
||||
protected:
|
||||
PVBoolean(PVStructure *parent,ScalarConstPtr scalar)
|
||||
@@ -233,7 +237,7 @@ namespace epics { namespace pvData {
|
||||
class PVByte : public PVScalar {
|
||||
public:
|
||||
virtual ~PVByte();
|
||||
virtual epicsInt8 get() const = 0;
|
||||
virtual epicsInt8 get() = 0;
|
||||
virtual void put(epicsInt8 value) = 0;
|
||||
protected:
|
||||
PVByte(PVStructure *parent,ScalarConstPtr scalar)
|
||||
@@ -244,7 +248,7 @@ namespace epics { namespace pvData {
|
||||
class PVShort : public PVScalar {
|
||||
public:
|
||||
virtual ~PVShort();
|
||||
virtual epicsInt16 get() const = 0;
|
||||
virtual epicsInt16 get() = 0;
|
||||
virtual void put(epicsInt16 value) = 0;
|
||||
protected:
|
||||
PVShort(PVStructure *parent,ScalarConstPtr scalar)
|
||||
@@ -255,7 +259,7 @@ namespace epics { namespace pvData {
|
||||
class PVInt : public PVScalar{
|
||||
public:
|
||||
virtual ~PVInt();
|
||||
virtual epicsInt32 get() const = 0;
|
||||
virtual epicsInt32 get() = 0;
|
||||
virtual void put(epicsInt32 value) = 0;
|
||||
protected:
|
||||
PVInt(PVStructure *parent,ScalarConstPtr scalar)
|
||||
@@ -266,7 +270,7 @@ namespace epics { namespace pvData {
|
||||
class PVLong : public PVScalar {
|
||||
public:
|
||||
virtual ~PVLong();
|
||||
virtual epicsInt64 get() const = 0;
|
||||
virtual epicsInt64 get() = 0;
|
||||
virtual void put(epicsInt64 value) = 0;
|
||||
protected:
|
||||
PVLong(PVStructure *parent,ScalarConstPtr scalar)
|
||||
@@ -277,7 +281,7 @@ namespace epics { namespace pvData {
|
||||
class PVFloat : public PVScalar {
|
||||
public:
|
||||
virtual ~PVFloat();
|
||||
virtual float get() const = 0;
|
||||
virtual float get() = 0;
|
||||
virtual void put(float value) = 0;
|
||||
protected:
|
||||
PVFloat(PVStructure *parent,ScalarConstPtr scalar)
|
||||
@@ -288,7 +292,7 @@ namespace epics { namespace pvData {
|
||||
class PVDouble : public PVScalar {
|
||||
public:
|
||||
virtual ~PVDouble();
|
||||
virtual double get() const = 0;
|
||||
virtual double get() = 0;
|
||||
virtual void put(double value) = 0;
|
||||
protected:
|
||||
PVDouble(PVStructure *parent,ScalarConstPtr scalar)
|
||||
@@ -299,123 +303,122 @@ namespace epics { namespace pvData {
|
||||
class PVString : public PVScalar {
|
||||
public:
|
||||
virtual ~PVString();
|
||||
virtual StringConst get() const = 0;
|
||||
virtual void put(StringConst value) = 0;
|
||||
virtual String get() = 0;
|
||||
virtual void put(String value) = 0;
|
||||
protected:
|
||||
PVString(PVStructure *parent,ScalarConstPtr scalar)
|
||||
: PVScalar(parent,scalar) {}
|
||||
private:
|
||||
};
|
||||
|
||||
typedef epicsBoolean * EpicsBooleanArrayPtr;
|
||||
|
||||
typedef epicsBoolean * BooleanArray;
|
||||
class BooleanArrayData {
|
||||
public:
|
||||
EpicsBooleanArrayPtr data;
|
||||
BooleanArray data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVBooleanArray : public PVScalarArray {
|
||||
public:
|
||||
virtual ~PVBooleanArray();
|
||||
virtual void toString(StringBuilder buf) const;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) const;
|
||||
virtual int get(int offset, int length, BooleanArrayData *data) const;
|
||||
virtual int put(int offset,int length, EpicsBooleanArrayPtr from, int fromOffset);
|
||||
virtual void shareData(EpicsBooleanArrayPtr from);
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) const;
|
||||
virtual void toString(StringBuilder buf) ;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) ;
|
||||
virtual int get(int offset, int length, BooleanArrayData *data) ;
|
||||
virtual int put(int offset,int length, BooleanArray from, int fromOffset);
|
||||
virtual void shareData(BooleanArrayData *from);
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) ;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher);
|
||||
protected:
|
||||
PVBooleanArray(PVStructure *parent,ScalarConstPtr scalar);
|
||||
private:
|
||||
};
|
||||
|
||||
typedef signed char * ByteArrayPtr;
|
||||
|
||||
typedef epicsInt8 * ByteArray;
|
||||
class ByteArrayData {
|
||||
public:
|
||||
ByteArrayPtr data;
|
||||
ByteArray data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVByteArray : public PVScalarArray {
|
||||
public:
|
||||
virtual ~PVByteArray();
|
||||
virtual void toString(StringBuilder buf) const;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) const;
|
||||
virtual int get(int offset, int length, ByteArrayData *data) const;
|
||||
virtual int put(int offset,int length, ByteArrayPtr from, int fromOffset);
|
||||
virtual void shareData(ByteArrayPtr from);
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) const;
|
||||
virtual void toString(StringBuilder buf) ;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) ;
|
||||
virtual int get(int offset, int length, ByteArrayData *data) ;
|
||||
virtual int put(int offset,int length, ByteArray from, int fromOffset);
|
||||
virtual void shareData(ByteArrayData *from);
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) ;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher);
|
||||
protected:
|
||||
PVByteArray(PVStructure *parent,ScalarConstPtr scalar);
|
||||
private:
|
||||
};
|
||||
|
||||
typedef short * ShortArrayPtr;
|
||||
|
||||
typedef epicsInt16 * ShortArray;
|
||||
class ShortArrayData {
|
||||
public:
|
||||
ShortArrayPtr data;
|
||||
ShortArray data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVShortArray : public PVScalarArray {
|
||||
public:
|
||||
virtual ~PVShortArray();
|
||||
virtual void toString(StringBuilder buf) const;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) const;
|
||||
virtual int get(int offset, int length, ShortArrayData *data) const;
|
||||
virtual int put(int offset,int length, ShortArrayPtr from, int fromOffset);
|
||||
virtual void shareData(ShortArrayPtr from);
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) const;
|
||||
virtual void toString(StringBuilder buf) ;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) ;
|
||||
virtual int get(int offset, int length, ShortArrayData *data) ;
|
||||
virtual int put(int offset,int length, ShortArray from, int fromOffset);
|
||||
virtual void shareData(ShortArrayData *from);
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) ;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher);
|
||||
protected:
|
||||
PVShortArray(PVStructure *parent,ScalarConstPtr scalar);
|
||||
private:
|
||||
};
|
||||
|
||||
typedef int * IntArrayPtr;
|
||||
|
||||
typedef epicsInt32 * IntArray;
|
||||
class IntArrayData {
|
||||
public:
|
||||
IntArrayPtr data;
|
||||
IntArray data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVIntArray : public PVScalarArray {
|
||||
public:
|
||||
virtual ~PVIntArray();
|
||||
virtual void toString(StringBuilder buf) const;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) const;
|
||||
virtual int get(int offset, int length, IntArrayData *data) const;
|
||||
virtual int put(int offset,int length, IntArrayPtr from, int fromOffset);
|
||||
virtual void shareData(IntArrayPtr from);
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) const;
|
||||
virtual void toString(StringBuilder buf) ;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) ;
|
||||
virtual int get(int offset, int length, IntArrayData *data) ;
|
||||
virtual int put(int offset,int length, IntArray from, int fromOffset);
|
||||
virtual void shareData(IntArrayData *from);
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) ;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher);
|
||||
protected:
|
||||
PVIntArray(PVStructure *parent,ScalarConstPtr scalar);
|
||||
private:
|
||||
};
|
||||
|
||||
typedef long * LongArrayPtr;
|
||||
|
||||
typedef epicsInt64 * LongArray;
|
||||
class LongArrayData {
|
||||
public:
|
||||
LongArrayPtr data;
|
||||
LongArray data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVLongArray : public PVScalarArray {
|
||||
public:
|
||||
virtual ~PVLongArray();
|
||||
virtual void toString(StringBuilder buf) const;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) const;
|
||||
virtual int get(int offset, int length, LongArrayData *data) const;
|
||||
virtual int put(int offset,int length, LongArrayPtr from, int fromOffset);
|
||||
virtual void shareData(LongArrayPtr from);
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) const;
|
||||
virtual void toString(StringBuilder buf) ;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) ;
|
||||
virtual int get(int offset, int length, LongArrayData *data) ;
|
||||
virtual int put(int offset,int length, LongArray from, int fromOffset);
|
||||
virtual void shareData(LongArrayData *from);
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) ;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher);
|
||||
protected:
|
||||
PVLongArray(PVStructure *parent,ScalarConstPtr scalar);
|
||||
@@ -423,69 +426,68 @@ namespace epics { namespace pvData {
|
||||
};
|
||||
|
||||
|
||||
typedef float * FloatArrayPtr;
|
||||
|
||||
typedef float * FloatArray;
|
||||
class FloatArrayData {
|
||||
public:
|
||||
FloatArrayPtr data;
|
||||
FloatArray data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVFloatArray : public PVScalarArray {
|
||||
public:
|
||||
virtual ~PVFloatArray();
|
||||
virtual void toString(StringBuilder buf) const;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) const;
|
||||
virtual int get(int offset, int length, FloatArrayData *data) const;
|
||||
virtual int put(int offset,int length, FloatArrayPtr from, int fromOffset);
|
||||
virtual void shareData(FloatArrayPtr from);
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) const;
|
||||
virtual void toString(StringBuilder buf) ;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) ;
|
||||
virtual int get(int offset, int length, FloatArrayData *data) ;
|
||||
virtual int put(int offset,int length, FloatArray from, int fromOffset);
|
||||
virtual void shareData(FloatArrayData *from);
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) ;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher);
|
||||
protected:
|
||||
PVFloatArray(PVStructure *parent,ScalarConstPtr scalar);
|
||||
private:
|
||||
};
|
||||
|
||||
typedef double * DoubleArrayPtr;
|
||||
|
||||
typedef double * DoubleArray;
|
||||
class DoubleArrayData {
|
||||
public:
|
||||
DoubleArrayPtr data;
|
||||
DoubleArray data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVDoubleArray : public PVScalarArray {
|
||||
public:
|
||||
virtual ~PVDoubleArray();
|
||||
virtual void toString(StringBuilder buf) const = 0;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) const = 0;
|
||||
virtual int get(int offset, int length, DoubleArrayData *data) const = 0;
|
||||
virtual int put(int offset,int length, DoubleArrayPtr from, int fromOffset) = 0;
|
||||
virtual void shareData(DoubleArrayPtr from) = 0;
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) const = 0;
|
||||
virtual void toString(StringBuilder buf) = 0;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) = 0;
|
||||
virtual int get(int offset, int length, DoubleArrayData *data) = 0;
|
||||
virtual int put(int offset,int length, DoubleArray from, int fromOffset) = 0;
|
||||
virtual void shareData(DoubleArrayData *from) = 0;
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) = 0;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher) = 0;
|
||||
protected:
|
||||
PVDoubleArray(PVStructure *parent,ScalarArrayConstPtr scalar);
|
||||
private:
|
||||
};
|
||||
|
||||
typedef std::string * StringArrayPtr;
|
||||
|
||||
typedef String * StringPtrArray;
|
||||
class StringArrayData {
|
||||
public:
|
||||
StringArrayPtr data;
|
||||
StringPtrArray data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVStringArray : public PVScalarArray {
|
||||
public:
|
||||
virtual ~PVStringArray();
|
||||
virtual void toString(StringBuilder buf) const;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) const;
|
||||
virtual int get(int offset, int length, StringArrayData *data) const;
|
||||
virtual int put(int offset,int length, StringArrayPtr from, int fromOffset);
|
||||
virtual void shareData(StringArrayPtr from);
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) const;
|
||||
virtual void toString(StringBuilder buf) ;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) ;
|
||||
virtual int get(int offset, int length, StringArrayData *data) ;
|
||||
virtual int put(int offset,int length, StringArray from, int fromOffset);
|
||||
virtual void shareData(StringArrayData from);
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) ;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher);
|
||||
protected:
|
||||
PVStringArray(PVStructure *parent,ScalarConstPtr scalar);
|
||||
@@ -497,26 +499,26 @@ namespace epics { namespace pvData {
|
||||
PVField *createPVField(PVStructure *parent,
|
||||
FieldConstPtr field);
|
||||
PVField *createPVField(PVStructure *parent,
|
||||
StringConst fieldName,PVField * fieldToClone);
|
||||
String fieldName,PVField * fieldToClone);
|
||||
PVScalar *createPVScalar(PVStructure *parent,ScalarConstPtr scalar);
|
||||
PVScalar *createPVScalar(PVStructure *parent,
|
||||
StringConst fieldName,ScalarType scalarType);
|
||||
String fieldName,ScalarType scalarType);
|
||||
PVScalar *createPVScalar(PVStructure *parent,
|
||||
StringConst fieldName,PVScalar * scalarToClone);
|
||||
String fieldName,PVScalar * scalarToClone);
|
||||
PVScalarArray *createPVScalarArray(PVStructure *parent,
|
||||
ScalarArrayConstPtr scalarArray);
|
||||
PVScalarArray *createPVScalarArray(PVStructure *parent,
|
||||
StringConst fieldName,ScalarType elementType);
|
||||
String fieldName,ScalarType elementType);
|
||||
PVScalarArray *createPVScalarArray(PVStructure *parent,
|
||||
StringConst fieldName,PVScalarArray * scalarArrayToClone);
|
||||
String fieldName,PVScalarArray * scalarArrayToClone);
|
||||
PVStructureArray *createPVStructureArray(PVStructure *parent,
|
||||
StructureArrayConstPtr structureArray);
|
||||
PVStructure *createPVStructure(PVStructure *parent,
|
||||
StructureConstPtr structure);
|
||||
PVStructure *createPVStructure(PVStructure *parent,
|
||||
StringConst fieldName,FieldConstPtrArray fields);
|
||||
String fieldName,FieldConstPtrArray fields);
|
||||
PVStructure *createPVStructure(PVStructure *parent,
|
||||
StringConst fieldName,PVStructure *structToClone);
|
||||
String fieldName,PVStructure *structToClone);
|
||||
protected:
|
||||
PVDataCreate();
|
||||
};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* pvIntrospect.h */
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <epicsTypes.h>
|
||||
#ifndef PVINTROSPECT_H
|
||||
#define PVINTROSPECT_H
|
||||
#include "noDefaultMethods.h"
|
||||
@@ -13,8 +14,7 @@ namespace epics { namespace pvData {
|
||||
|
||||
typedef std::string String;
|
||||
typedef std::string * StringBuilder;
|
||||
typedef std::string const StringConst;
|
||||
typedef StringConst * StringConstArray;
|
||||
typedef String* StringArray;
|
||||
|
||||
typedef Field const * FieldConstPtr;
|
||||
typedef FieldConstPtr * FieldConstPtrArray;
|
||||
@@ -48,18 +48,18 @@ namespace epics { namespace pvData {
|
||||
|
||||
class ScalarTypeFunc {
|
||||
public:
|
||||
static bool isInteger(ScalarType type);
|
||||
static bool isNumeric(ScalarType type);
|
||||
static bool isPrimitive(ScalarType type);
|
||||
static ScalarType getScalarType(StringConst value);
|
||||
static void toString(StringBuilder buf,const ScalarType scalarType);
|
||||
static epicsBoolean isInteger(ScalarType type);
|
||||
static epicsBoolean isNumeric(ScalarType type);
|
||||
static epicsBoolean isPrimitive(ScalarType type);
|
||||
static ScalarType getScalarType(String value);
|
||||
static void toString(StringBuilder buf,ScalarType scalarType);
|
||||
};
|
||||
|
||||
class Field : private NoDefaultMethods {
|
||||
public:
|
||||
virtual ~Field();
|
||||
virtual int getReferenceCount() const = 0;
|
||||
virtual StringConst getFieldName() const = 0;
|
||||
virtual String getFieldName() const = 0;
|
||||
virtual Type getType() const = 0;
|
||||
virtual void toString(StringBuilder buf) const = 0;
|
||||
virtual void toString(StringBuilder buf,int indentLevel) const = 0;
|
||||
@@ -89,8 +89,8 @@ namespace epics { namespace pvData {
|
||||
public:
|
||||
virtual ~Structure();
|
||||
virtual int const getNumberFields() const = 0;
|
||||
virtual FieldConstPtr getField(StringConst fieldName) const = 0;
|
||||
virtual int getFieldIndex(StringConst fieldName) const = 0;
|
||||
virtual FieldConstPtr getField(String fieldName) const = 0;
|
||||
virtual int getFieldIndex(String fieldName) const = 0;
|
||||
virtual FieldConstPtrArray getFields() const = 0;
|
||||
};
|
||||
|
||||
@@ -103,13 +103,13 @@ namespace epics { namespace pvData {
|
||||
|
||||
class FieldCreate {
|
||||
public:
|
||||
FieldConstPtr create(StringConst fieldName,FieldConstPtr field) const;
|
||||
ScalarConstPtr createScalar(StringConst fieldName,ScalarType scalarType) const;
|
||||
ScalarArrayConstPtr createScalarArray(StringConst fieldName,
|
||||
FieldConstPtr create(String fieldName,FieldConstPtr field) const;
|
||||
ScalarConstPtr createScalar(String fieldName,ScalarType scalarType) const;
|
||||
ScalarArrayConstPtr createScalarArray(String fieldName,
|
||||
ScalarType elementType) const;
|
||||
StructureConstPtr createStructure (StringConst fieldName,
|
||||
StructureConstPtr createStructure (String fieldName,
|
||||
int numberFields,FieldConstPtrArray fields) const;
|
||||
StructureArrayConstPtr createStructureArray(StringConst fieldName,
|
||||
StructureArrayConstPtr createStructureArray(String fieldName,
|
||||
StructureConstPtr structure) const;
|
||||
protected:
|
||||
FieldCreate();
|
||||
|
||||
30
pvDataApp/pv/standardField.h
Normal file
30
pvDataApp/pv/standardField.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/* standardField.h */
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#ifndef STANDARDFIELD_H
|
||||
#define STANDARDFIELD_H
|
||||
#include "pvIntrospect.h"
|
||||
#include "pvData.h"
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
class StandardField : private NoDefaultMethods {
|
||||
public:
|
||||
StandardField();
|
||||
~StandardField();
|
||||
PVScalar * scalarValue(ScalarType type);
|
||||
PVScalarArray * scalarArrayValue(ScalarType elementType);
|
||||
PVStructure * scalarValue(ScalarType type,String properties);
|
||||
PVStructure * scalarArrayValue(ScalarType elementType,
|
||||
String properties);
|
||||
PVStructure * enumeratedValue(StringArray choices);
|
||||
PVStructure * enumeratedValue(StringArray choices,
|
||||
String properties);
|
||||
PVStructure * alarm();
|
||||
PVStructure * timeStamp();
|
||||
};
|
||||
|
||||
extern StandardField * getStandardField();
|
||||
|
||||
}}
|
||||
#endif /* STANDARDFIELD_H */
|
||||
@@ -24,7 +24,7 @@ int main(int argc,char *argv[])
|
||||
ScalarTypeFunc::toString(&myString,scalarType);
|
||||
printf("%s\n",myString.c_str());
|
||||
FieldCreate * pfieldCreate = getFieldCreate();
|
||||
StringConst valueName("value");
|
||||
String valueName("value");
|
||||
ScalarConstPtr pscalar = pfieldCreate->createScalar(valueName,scalarType);
|
||||
type = pscalar->getType();
|
||||
myString.clear();
|
||||
@@ -33,7 +33,7 @@ int main(int argc,char *argv[])
|
||||
printf("%s\n",myString.c_str());
|
||||
myString.clear();
|
||||
myString += "fieldName ";
|
||||
StringConst fieldName = pscalar->getFieldName();
|
||||
String fieldName = pscalar->getFieldName();
|
||||
myString += fieldName;
|
||||
printf("%s\n",myString.c_str());
|
||||
myString.clear();
|
||||
@@ -45,8 +45,8 @@ int main(int argc,char *argv[])
|
||||
printf("%s\n",myString.c_str());
|
||||
int numberFields = 2;
|
||||
FieldConstPtr fields[numberFields];
|
||||
StringConst name0("high");
|
||||
StringConst name1("low");
|
||||
String name0("high");
|
||||
String name1("low");
|
||||
fields[0] = pfieldCreate->createScalar(name0,pvDouble);
|
||||
fields[1] = pfieldCreate->createScalar(name1,pvDouble);
|
||||
StructureConstPtr pstructure = pfieldCreate->createStructure(
|
||||
|
||||
@@ -17,7 +17,7 @@ static String buffer("");
|
||||
|
||||
void testDouble() {
|
||||
printf("\ntestDouble\n");
|
||||
StringConst valueName("value");
|
||||
String valueName("value");
|
||||
ScalarConstPtr pscalar = fieldCreate->createScalar(valueName,pvDouble);
|
||||
PVScalar *pvScalar = pvDataCreate->createPVScalar(0,pscalar);
|
||||
PVDouble *pvValue = dynamic_cast<PVDouble *>(pvScalar);
|
||||
@@ -28,7 +28,7 @@ void testDouble() {
|
||||
fprintf(stderr,"ERROR getValue put %f get %f\n",value,getValue);
|
||||
}
|
||||
PVAuxInfo *auxInfo = pvValue->getPVAuxInfo();
|
||||
StringConst stringName("string");
|
||||
String stringName("string");
|
||||
pvScalar = auxInfo->createInfo(stringName,pvDouble);
|
||||
PVDouble *doubleInfo = dynamic_cast<PVDouble *>(pvScalar);
|
||||
doubleInfo->put(100.0);
|
||||
|
||||
@@ -17,7 +17,7 @@ static String buffer("");
|
||||
|
||||
void testDouble() {
|
||||
printf("\ntestDouble\n");
|
||||
StringConst valueName("value");
|
||||
String valueName("value");
|
||||
ScalarConstPtr pscalar = pfieldCreate->createScalar(valueName,pvDouble);
|
||||
PVScalar *pvScalar = pvDataCreate->createPVScalar(0,pscalar);
|
||||
PVDouble *pvValue = (PVDouble *)pvScalar;
|
||||
|
||||
Reference in New Issue
Block a user