everything now builds
This commit is contained in:
80
pvDataApp/factory/AbstractPVArray.h
Normal file
80
pvDataApp/factory/AbstractPVArray.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/*AbstractPVArray.h*/
|
||||
#ifndef ABSTRACTPVARRAY_H
|
||||
#define ABSTRACTPVARRAY_H
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
#include "pvData.h"
|
||||
#include "factory.h"
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
class PVArrayPvt {
|
||||
public:
|
||||
PVArrayPvt() : length(0),capacity(0),capacityMutable(epicsTrue)
|
||||
{}
|
||||
int length;
|
||||
int capacity;
|
||||
epicsBoolean capacityMutable;
|
||||
};
|
||||
|
||||
PVArray::PVArray(PVStructure *parent,FieldConstPtr field)
|
||||
: PVField(parent,field),pImpl(new PVArrayPvt())
|
||||
{ }
|
||||
|
||||
PVArray::~PVArray()
|
||||
{
|
||||
delete pImpl;
|
||||
}
|
||||
|
||||
int PVArray::getLength() const {return pImpl->length;}
|
||||
|
||||
static std::string fieldImmutable("field is immutable");
|
||||
|
||||
void PVArray::setLength(int length) {
|
||||
if(PVField::isImmutable()) {
|
||||
PVField::message(&fieldImmutable,errorMessage);
|
||||
return;
|
||||
}
|
||||
if(length>pImpl->capacity) this->setCapacity(length);
|
||||
if(length>pImpl->capacity) length = pImpl->capacity;
|
||||
pImpl->length = length;
|
||||
}
|
||||
|
||||
|
||||
epicsBoolean PVArray::isCapacityImmutable() const
|
||||
{
|
||||
if(PVField::isImmutable()) {
|
||||
return epicsFalse;
|
||||
}
|
||||
return pImpl->capacityMutable;
|
||||
}
|
||||
|
||||
void PVArray::setCapacityImmutable(epicsBoolean isMutable)
|
||||
{
|
||||
if(isMutable && PVField::isImmutable()) {
|
||||
PVField::message(&fieldImmutable,errorMessage);
|
||||
return;
|
||||
}
|
||||
pImpl->capacityMutable = isMutable;
|
||||
}
|
||||
|
||||
static std::string capacityImmutable("capacity is immutable");
|
||||
|
||||
void PVArray::setCapacity(int capacity) {
|
||||
if(PVField::isImmutable()) {
|
||||
PVField::message(&fieldImmutable,errorMessage);
|
||||
return;
|
||||
}
|
||||
if(pImpl->capacityMutable==epicsFalse) {
|
||||
PVField::message(&capacityImmutable,errorMessage);
|
||||
return;
|
||||
}
|
||||
pImpl->capacity = capacity;
|
||||
}
|
||||
|
||||
void PVArray::toString(StringPtr buf) const {toString(buf,0);}
|
||||
|
||||
}}
|
||||
#endif /* ABSTRACTPVARRAY_H */
|
||||
@@ -10,121 +10,191 @@
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
PVField::~PVField(){}
|
||||
|
||||
class AbstractPVField : public PVField {
|
||||
class PVFieldPvt {
|
||||
public:
|
||||
AbstractPVField(PVStructure *parent,FieldConstPtr field);
|
||||
virtual ~AbstractPVField();
|
||||
// from Requester
|
||||
virtual StringConstPtr getRequesterName() const;
|
||||
virtual void message(StringConstPtr message,MessageType messageType) const;
|
||||
// from PVField
|
||||
virtual void setRequester(Requester *prequester);
|
||||
virtual int getFieldOffset() const;
|
||||
virtual int getNextFieldOffset() const;
|
||||
virtual int getNumberFields() const;
|
||||
virtual PVAuxInfo * getPVAuxInfo() const {return pvAuxInfo;}
|
||||
virtual epicsBoolean isImmutable() const {return immutable;}
|
||||
virtual void setImmutable() {immutable = epicsTrue;}
|
||||
virtual FieldConstPtr getField() const {return field;}
|
||||
virtual PVStructure * getParent() const {return parent;}
|
||||
virtual void replacePVField(PVField * newPVField);
|
||||
virtual void renameField(StringConstPtr newName);
|
||||
virtual void postPut() const;
|
||||
virtual void setPostHandler(PostHandler *ppostHandler);
|
||||
virtual void toString(StringPtr buf) const {toString(buf,0);}
|
||||
virtual void toString(StringPtr buf,int indentLevel) const;
|
||||
protected:
|
||||
void replaceStructure();
|
||||
private:
|
||||
AbstractPVField(AbstractPVField const & ); // not implemented
|
||||
AbstractPVField & operator=(AbstractPVField const &); //not implemented
|
||||
PVFieldPvt(PVStructure *parent,FieldConstPtr field);
|
||||
~PVFieldPvt();
|
||||
PVStructure *parent;
|
||||
FieldConstPtr field;
|
||||
int fieldOffset;
|
||||
int nextFieldOffset;
|
||||
PVAuxInfo *pvAuxInfo;
|
||||
epicsBoolean immutable;
|
||||
PVStructure *parent;
|
||||
FieldConstPtr field;
|
||||
Requester *requester;
|
||||
PostHandler *postHandler;
|
||||
};
|
||||
|
||||
AbstractPVField::AbstractPVField(PVStructure *parent,FieldConstPtr field)
|
||||
: fieldOffset(0),nextFieldOffset(0),pvAuxInfo(0),immutable(epicsFalse),
|
||||
parent(parent),field(field),requester(0),postHandler(0)
|
||||
PVFieldPvt::PVFieldPvt(PVStructure *parent,FieldConstPtr field)
|
||||
: parent(parent),field(field),
|
||||
fieldOffset(0), nextFieldOffset(0),
|
||||
pvAuxInfo(0),
|
||||
immutable(epicsFalse),requester(0),postHandler(0)
|
||||
{
|
||||
field->incReferenceCount();
|
||||
}
|
||||
|
||||
AbstractPVField::~AbstractPVField()
|
||||
PVFieldPvt::~PVFieldPvt()
|
||||
{
|
||||
field->decReferenceCount();
|
||||
}
|
||||
|
||||
StringConstPtr AbstractPVField::getRequesterName() const
|
||||
|
||||
PVField::PVField(PVStructure *parent,FieldConstPtr field)
|
||||
: pImpl(new PVFieldPvt(parent,field))
|
||||
{}
|
||||
|
||||
PVField::~PVField()
|
||||
{
|
||||
delete pImpl;
|
||||
}
|
||||
|
||||
StringConstPtr PVField::getRequesterName() const
|
||||
{
|
||||
static std::string none("none");
|
||||
if(requester!=0) return requester->getRequesterName();
|
||||
if(pImpl->requester!=0) return pImpl->requester->getRequesterName();
|
||||
return &none;
|
||||
}
|
||||
|
||||
void AbstractPVField::message(StringConstPtr message,MessageType messageType) const
|
||||
void PVField::message(StringConstPtr message,MessageType messageType) const
|
||||
{
|
||||
if(requester) {
|
||||
requester->message(message,messageType);
|
||||
if(pImpl->requester) {
|
||||
pImpl->requester->message(message,messageType);
|
||||
} else {
|
||||
printf("%s %s %s\n",
|
||||
messageTypeName[messageType].c_str(),
|
||||
field->getFieldName()->c_str(),
|
||||
pImpl->field->getFieldName()->c_str(),
|
||||
message->c_str());
|
||||
}
|
||||
}
|
||||
void AbstractPVField::setRequester(Requester *prequester)
|
||||
void PVField::setRequester(Requester *prequester)
|
||||
{
|
||||
static std::string requesterPresent = "Logic Error. requester is already present";
|
||||
if(requester==0) {
|
||||
requester = prequester;
|
||||
static std::string requesterPresent =
|
||||
"Logic Error. requester is already present";
|
||||
if(pImpl->requester==0) {
|
||||
pImpl->requester = prequester;
|
||||
return;
|
||||
}
|
||||
throw std::logic_error(requesterPresent);
|
||||
}
|
||||
|
||||
int AbstractPVField::getFieldOffset() const
|
||||
int PVField::getFieldOffset() const
|
||||
{
|
||||
return -1;
|
||||
if(pImpl->nextFieldOffset==0) computeOffset(this);
|
||||
return pImpl->fieldOffset;
|
||||
}
|
||||
|
||||
int AbstractPVField::getNextFieldOffset() const
|
||||
int PVField::getNextFieldOffset() const
|
||||
{
|
||||
return -1;
|
||||
if(pImpl->nextFieldOffset==0) computeOffset(this);
|
||||
return pImpl->nextFieldOffset;
|
||||
}
|
||||
|
||||
int AbstractPVField::getNumberFields() const
|
||||
int PVField::getNumberFields() const
|
||||
{
|
||||
return -1;
|
||||
if(pImpl->nextFieldOffset==0) computeOffset(this);
|
||||
return (pImpl->nextFieldOffset - pImpl->fieldOffset);
|
||||
}
|
||||
|
||||
void AbstractPVField::replacePVField(PVField * newPVField)
|
||||
PVAuxInfo * PVField::getPVAuxInfo(){
|
||||
if(pImpl->pvAuxInfo==0) {
|
||||
pImpl->pvAuxInfo = new PVAuxInfo(this);
|
||||
}
|
||||
return pImpl->pvAuxInfo;
|
||||
}
|
||||
|
||||
epicsBoolean PVField::isImmutable() const {return pImpl->immutable;}
|
||||
|
||||
void PVField::setImmutable() {pImpl->immutable = epicsTrue;}
|
||||
|
||||
FieldConstPtr PVField::getField() const {return pImpl->field;}
|
||||
|
||||
PVStructure * PVField::getParent() const {return pImpl->parent;}
|
||||
|
||||
void PVField::replacePVField(PVField * newPVField)
|
||||
{
|
||||
}
|
||||
|
||||
void AbstractPVField::renameField(StringConstPtr newName)
|
||||
void PVField::renameField(StringConstPtr newName)
|
||||
{
|
||||
}
|
||||
|
||||
void AbstractPVField::postPut() const
|
||||
void PVField::postPut() const
|
||||
{
|
||||
}
|
||||
|
||||
void AbstractPVField::setPostHandler(PostHandler *ppostHandler)
|
||||
void PVField::setPostHandler(PostHandler *ppostHandler)
|
||||
{
|
||||
}
|
||||
|
||||
void AbstractPVField::toString(StringPtr buf,int indentLevel) const
|
||||
void PVField::toString(StringPtr buf) const {toString(buf,0);}
|
||||
|
||||
void PVField::toString(StringPtr buf,int indentLevel) const
|
||||
{
|
||||
}
|
||||
|
||||
void PVField::computeOffset(PVField const * const pvField) {
|
||||
PVStructure *pvTop = pvField->getParent();
|
||||
if(pvTop==0) {
|
||||
pvTop = (PVStructure *)pvField;
|
||||
} else {
|
||||
while(pvTop->getParent()!=0) {
|
||||
pvTop = pvTop->getParent();
|
||||
}
|
||||
}
|
||||
int offset = 0;
|
||||
int nextOffset = 1;
|
||||
PVFieldArrayPtr pvFields = pvTop->getPVFields();
|
||||
for(int i=0; i < pvTop->getStructure()->getNumberFields(); i++) {
|
||||
offset = nextOffset;
|
||||
PVField *pvField = pvFields[i];
|
||||
FieldConstPtr field = pvField->getField();
|
||||
switch(field->getType()) {
|
||||
case scalar:
|
||||
case scalarArray:
|
||||
case structureArray:{
|
||||
nextOffset++;
|
||||
pvField->pImpl->fieldOffset = offset;
|
||||
pvField->pImpl->nextFieldOffset = nextOffset;
|
||||
break;
|
||||
}
|
||||
case structure: {
|
||||
pvField->computeOffset(pvField,offset);
|
||||
nextOffset = pvField->getNextFieldOffset();
|
||||
}
|
||||
}
|
||||
}
|
||||
PVField *top = (PVField *)pvTop;
|
||||
top->pImpl->fieldOffset = 0;
|
||||
top->pImpl->nextFieldOffset = nextOffset;
|
||||
}
|
||||
|
||||
void PVField::computeOffset(PVField const * const pvField,int offset) {
|
||||
int beginOffset = offset;
|
||||
int nextOffset = offset + 1;
|
||||
PVStructure *pvStructure = (PVStructure *)pvField;
|
||||
PVFieldArrayPtr pvFields = pvStructure->getPVFields();
|
||||
for(int i=0; i < pvStructure->getStructure()->getNumberFields(); i++) {
|
||||
offset = nextOffset;
|
||||
PVField *pvSubField = pvFields[i];
|
||||
FieldConstPtr field = pvSubField->getField();
|
||||
switch(field->getType()) {
|
||||
case scalar:
|
||||
case scalarArray:
|
||||
case structureArray: {
|
||||
nextOffset++;
|
||||
pvSubField->pImpl->fieldOffset = offset;
|
||||
pvSubField->pImpl->nextFieldOffset = nextOffset;
|
||||
break;
|
||||
}
|
||||
case structure: {
|
||||
pvSubField->computeOffset(pvSubField,offset);
|
||||
nextOffset = pvSubField->getNextFieldOffset();
|
||||
}
|
||||
}
|
||||
}
|
||||
pvField->pImpl->fieldOffset = beginOffset;
|
||||
pvField->pImpl->nextFieldOffset = nextOffset;
|
||||
}
|
||||
|
||||
}}
|
||||
#endif /* ABSTRACTPVFIELD_H */
|
||||
|
||||
@@ -13,16 +13,13 @@ namespace epics { namespace pvData {
|
||||
|
||||
PVScalar::~PVScalar() {}
|
||||
|
||||
class AbstractPVScalar : public AbstractPVField{
|
||||
public:
|
||||
AbstractPVScalar(PVStructure *parent,ScalarConstPtr scalar)
|
||||
: AbstractPVField(parent,scalar) {}
|
||||
virtual ~AbstractPVScalar() {}
|
||||
virtual Scalar *getScalar()const {
|
||||
return (Scalar*)AbstractPVField::getField();
|
||||
}
|
||||
};
|
||||
PVScalar::PVScalar(PVStructure *parent,ScalarConstPtr scalar)
|
||||
: PVField(parent,scalar) {}
|
||||
|
||||
ScalarConstPtr PVScalar::getScalar() const
|
||||
{
|
||||
return (ScalarConstPtr) PVField::getField();
|
||||
}
|
||||
|
||||
}}
|
||||
#endif /* ABSTRACTPVSCALAR_H */
|
||||
|
||||
25
pvDataApp/factory/AbstractPVScalarArray.h
Normal file
25
pvDataApp/factory/AbstractPVScalarArray.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*AbstractPVScalarArray.h*/
|
||||
#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 {
|
||||
|
||||
PVScalarArray::~PVScalarArray() {}
|
||||
|
||||
PVScalarArray::PVScalarArray(PVStructure *parent,ScalarArrayConstPtr scalarArray)
|
||||
: PVArray(parent,scalarArray) {}
|
||||
|
||||
ScalarArrayConstPtr PVScalarArray::getScalarArray() const
|
||||
{
|
||||
return (ScalarArrayConstPtr) PVField::getField();
|
||||
}
|
||||
|
||||
}}
|
||||
#endif /* ABSTRACTPVSCALARARRAY_H */
|
||||
@@ -7,62 +7,25 @@
|
||||
#include <cstdio>
|
||||
#include "pvData.h"
|
||||
#include "factory.h"
|
||||
#include "AbstractPVScalar.h"
|
||||
#include "AbstractPVField.h"
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
PVDouble::~PVDouble() {}
|
||||
|
||||
class BasePVDouble : public AbstractPVScalar, public PVDouble {
|
||||
class BasePVDouble : public PVDouble {
|
||||
public:
|
||||
BasePVDouble(PVStructure *parent,ScalarConstPtr scalar)
|
||||
: AbstractPVScalar(parent,scalar),value(0.0) {}
|
||||
: PVDouble(parent,scalar),value(0.0) {}
|
||||
virtual ~BasePVDouble() {}
|
||||
// from Requester
|
||||
virtual StringConstPtr getRequesterName() const{
|
||||
return AbstractPVField::getRequesterName();}
|
||||
virtual void message(StringConstPtr message,MessageType messageType) const{
|
||||
AbstractPVField::message(message,messageType);}
|
||||
// from PVScalar
|
||||
virtual Scalar *getScalar() const{
|
||||
return (Scalar *)getField();}
|
||||
// from PVField
|
||||
virtual void setRequester(Requester *requester){
|
||||
AbstractPVField::setRequester(requester);}
|
||||
virtual int getFieldOffset() const{
|
||||
return AbstractPVField::getFieldOffset();}
|
||||
virtual int getNextFieldOffset() const{
|
||||
return AbstractPVField::getNextFieldOffset();}
|
||||
virtual int getNumberFields() const{
|
||||
return AbstractPVField::getNumberFields();}
|
||||
virtual PVAuxInfo * getPVAuxInfo() const{
|
||||
return AbstractPVField::getPVAuxInfo();}
|
||||
virtual epicsBoolean isImmutable() const{
|
||||
return AbstractPVField::isImmutable();}
|
||||
virtual void setImmutable(){
|
||||
AbstractPVField::setImmutable();}
|
||||
virtual FieldConstPtr getField() const{
|
||||
return AbstractPVField::getField();}
|
||||
virtual PVStructure * getParent() const{
|
||||
return AbstractPVField::getParent();}
|
||||
virtual void replacePVField(PVField * newPVField){
|
||||
AbstractPVField::replacePVField(newPVField);}
|
||||
virtual void renameField(StringConstPtr newName){
|
||||
AbstractPVField::renameField(newName);}
|
||||
virtual void postPut() const{
|
||||
AbstractPVField::postPut();}
|
||||
virtual void setPostHandler(PostHandler *postHandler){
|
||||
AbstractPVField::setPostHandler(postHandler);}
|
||||
virtual void toString(StringPtr buf) const {toString(buf,0);}
|
||||
virtual void toString(StringPtr buf,int indentLevel) const{
|
||||
AbstractPVField::toString(buf,indentLevel);}
|
||||
// from PVDouble
|
||||
virtual double get()const { return value;}
|
||||
virtual void put(double val){value = val;}
|
||||
// from Serializable
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) const{}
|
||||
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher){}
|
||||
virtual void serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) const{}
|
||||
virtual void deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher){}
|
||||
virtual void toString(StringPtr buf)const {}
|
||||
virtual void toString(StringPtr buf,int indentLevel)const {}
|
||||
private:
|
||||
BasePVDouble(); // not implemented
|
||||
double value;
|
||||
};
|
||||
|
||||
|
||||
94
pvDataApp/factory/BasePVDoubleArray.h
Normal file
94
pvDataApp/factory/BasePVDoubleArray.h
Normal file
@@ -0,0 +1,94 @@
|
||||
/*BasePVDoubleArray.h*/
|
||||
#ifndef BASEPVDOUBLEARRAY_H
|
||||
#define BASEPVDOUBLEARRAY_H
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
#include "pvData.h"
|
||||
#include "factory.h"
|
||||
#include "AbstractPVScalarArray.h"
|
||||
|
||||
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);
|
||||
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,
|
||||
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(StringPtr buf)const;
|
||||
virtual void toString(StringPtr buf,int indentLevel)const;
|
||||
private:
|
||||
BasePVDoubleArray(); // not implemented
|
||||
DoubleArrayPtr doubleArray;
|
||||
};
|
||||
|
||||
BasePVDoubleArray::BasePVDoubleArray(PVStructure *parent,ScalarArrayConstPtr scalarArray)
|
||||
: PVDoubleArray(parent,scalarArray),doubleArray(new double[0])
|
||||
{
|
||||
}
|
||||
|
||||
BasePVDoubleArray::~BasePVDoubleArray()
|
||||
{
|
||||
delete[] doubleArray;
|
||||
}
|
||||
|
||||
void BasePVDoubleArray::setCapacity(int capacity)
|
||||
{
|
||||
}
|
||||
|
||||
int BasePVDoubleArray::get(int offset, int length,
|
||||
DoubleArrayData *data) const
|
||||
{
|
||||
data->data = doubleArray;
|
||||
return getLength();
|
||||
}
|
||||
|
||||
int BasePVDoubleArray::put(int offset,int length,
|
||||
DoubleArrayPtr from,int fromOffset)
|
||||
{
|
||||
return getLength();
|
||||
}
|
||||
|
||||
void BasePVDoubleArray::shareData(DoubleArrayPtr from)
|
||||
{
|
||||
}
|
||||
|
||||
void BasePVDoubleArray::serialize(ByteBuffer *pbuffer,SerializableControl *pflusher) const
|
||||
{
|
||||
}
|
||||
|
||||
void BasePVDoubleArray::deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher)
|
||||
{
|
||||
}
|
||||
|
||||
void BasePVDoubleArray::serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher, int offset, int count) const
|
||||
{
|
||||
}
|
||||
|
||||
void BasePVDoubleArray::toString(StringPtr buf)const
|
||||
{
|
||||
}
|
||||
|
||||
void BasePVDoubleArray::toString(StringPtr buf,int indentLevel)const
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
}}
|
||||
#endif /* BASEPVDOUBLEARRAY_H */
|
||||
199
pvDataApp/factory/BasePVStructure.h
Normal file
199
pvDataApp/factory/BasePVStructure.h
Normal file
@@ -0,0 +1,199 @@
|
||||
/*BasePVStructure.h*/
|
||||
#ifndef BASEPVSTRUCTURE_H
|
||||
#define BASEPVSTRUCTURE_H
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
#include "pvData.h"
|
||||
#include "factory.h"
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
class PVStructurePvt {
|
||||
public:
|
||||
PVStructurePvt();
|
||||
~PVStructurePvt();
|
||||
|
||||
int numberFields;
|
||||
PVFieldArrayPtr pvFields;
|
||||
std::string const extendsStructureName;
|
||||
};
|
||||
|
||||
PVStructurePvt::PVStructurePvt()
|
||||
: numberFields(0), pvFields(0),extendsStructureName(0)
|
||||
{
|
||||
}
|
||||
|
||||
PVStructurePvt::~PVStructurePvt()
|
||||
{
|
||||
for(int i=0; i<numberFields; i++) {
|
||||
delete pvFields[i];
|
||||
}
|
||||
}
|
||||
|
||||
PVStructure::PVStructure(PVStructure *parent,StructureConstPtr structure)
|
||||
: PVField(parent,structure),pImpl(new PVStructurePvt())
|
||||
{
|
||||
int numberFields = structure->getNumberFields();
|
||||
pImpl->numberFields = numberFields;
|
||||
pImpl->pvFields = new PVFieldPtr[numberFields];
|
||||
for(int i=0; i<numberFields; i++) {
|
||||
// MARTY FINISH THIS
|
||||
}
|
||||
}
|
||||
|
||||
PVStructure::~PVStructure()
|
||||
{
|
||||
delete pImpl;
|
||||
}
|
||||
|
||||
StructureConstPtr PVStructure::getStructure()
|
||||
{
|
||||
return (StructureConstPtr)PVField::getField();
|
||||
}
|
||||
|
||||
PVFieldArrayPtr PVStructure::getPVFields()
|
||||
{
|
||||
return pImpl->pvFields;
|
||||
}
|
||||
|
||||
PVFieldPtr PVStructure::getSubField(StringConstPtr fieldName)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
PVFieldPtr PVStructure::getSubField(int fieldOffset)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void PVStructure::appendPVField(PVFieldPtr pvField)
|
||||
{
|
||||
}
|
||||
|
||||
void PVStructure::appendPVFields(PVFieldArrayPtr pvFields)
|
||||
{
|
||||
}
|
||||
|
||||
void PVStructure::removePVField(StringConstPtr fieldName)
|
||||
{
|
||||
}
|
||||
|
||||
PVBoolean *PVStructure::getBooleanField(StringConstPtr fieldName)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
PVByte *PVStructure::getByteField(StringConstPtr fieldName)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
PVShort *PVStructure::getShortField(StringConstPtr fieldName)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
PVInt *PVStructure::getIntField(StringConstPtr fieldName)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
PVLong *PVStructure::getLongField(StringConstPtr fieldName)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
PVFloat *PVStructure::getFloatField(StringConstPtr fieldName)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
PVDouble *PVStructure::getDoubleField(StringConstPtr fieldName)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
PVString *PVStructure::getStringField(StringConstPtr fieldName)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
PVStructure *PVStructure::getStructureField(StringConstPtr fieldName)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
PVScalarArray *PVStructure::getScalarArrayField(
|
||||
StringConstPtr fieldName,ScalarType elementType)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
PVStructureArray *PVStructure::getStructureArrayField(
|
||||
StringConstPtr fieldName)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
StringConstPtr PVStructure::getExtendsStructureName()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
epicsBoolean PVStructure::putExtendsStructureName(
|
||||
StringConstPtr extendsStructureName)
|
||||
{
|
||||
return epicsFalse;
|
||||
}
|
||||
|
||||
void PVStructure::toString(StringPtr buf) const {toString(buf,0);}
|
||||
|
||||
void PVStructure::toString(StringPtr buf,int indentLevel) const
|
||||
{
|
||||
}
|
||||
|
||||
void PVStructure::serialize(
|
||||
ByteBuffer *pbuffer,SerializableControl *pflusher) const
|
||||
{
|
||||
}
|
||||
|
||||
void PVStructure::deserialize(
|
||||
ByteBuffer *pbuffer,DeserializableControl *pflusher)
|
||||
{
|
||||
}
|
||||
|
||||
void PVStructure::serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher, int offset, int count) const
|
||||
{
|
||||
}
|
||||
|
||||
void PVStructure::serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher,BitSet *pbitSet) const
|
||||
{
|
||||
}
|
||||
|
||||
void PVStructure::deserialize(ByteBuffer *pbuffer,
|
||||
DeserializableControl*pflusher,BitSet *pbitSet)
|
||||
{
|
||||
}
|
||||
|
||||
class BasePVStructure : public PVStructure {
|
||||
public:
|
||||
BasePVStructure(PVStructure *parent,StructureConstPtr structure);
|
||||
~BasePVStructure();
|
||||
private:
|
||||
BasePVStructure(); // not implemented
|
||||
BasePVStructure(BasePVStructure const & ); // not implemented
|
||||
BasePVStructure& operator=(BasePVStructure const &); //not implemented
|
||||
|
||||
};
|
||||
|
||||
BasePVStructure::BasePVStructure(PVStructure *parent,StructureConstPtr structure)
|
||||
: PVStructure(parent,structure) {}
|
||||
|
||||
BasePVStructure::~BasePVStructure() {}
|
||||
|
||||
}}
|
||||
#endif /* BASEPVSTRUCTURE_H */
|
||||
95
pvDataApp/factory/BasePVStructureArray.h
Normal file
95
pvDataApp/factory/BasePVStructureArray.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/*BasePVStructureArray.h*/
|
||||
#ifndef BASEPVSTRUCTUREARRAY_H
|
||||
#define BASEPVSTRUCTUREARRAY_H
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
#include "pvData.h"
|
||||
#include "factory.h"
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
class PVStructureArrayPvt {
|
||||
public:
|
||||
PVStructureArrayPvt(StructureArrayConstPtr structureArray);
|
||||
~PVStructureArrayPvt();
|
||||
|
||||
StructureArrayConstPtr structureArray;
|
||||
StructureArrayData *structureArrayData;
|
||||
PVStructureArrayPtr pvStructureArray;
|
||||
};
|
||||
PVStructureArrayPvt::PVStructureArrayPvt(StructureArrayConstPtr structureArray)
|
||||
: structureArray(structureArray),
|
||||
structureArrayData(new StructureArrayData()),
|
||||
pvStructureArray(new PVStructurePtr[0])
|
||||
{}
|
||||
|
||||
PVStructureArrayPvt::~PVStructureArrayPvt()
|
||||
{
|
||||
delete structureArrayData;
|
||||
delete pvStructureArray;
|
||||
}
|
||||
|
||||
|
||||
PVStructureArray::PVStructureArray(PVStructure *parent,StructureArrayConstPtr structureArray)
|
||||
: PVArray(parent,structureArray),pImpl(new PVStructureArrayPvt(structureArray))
|
||||
{
|
||||
}
|
||||
|
||||
PVStructureArray::~PVStructureArray()
|
||||
{
|
||||
delete pImpl;
|
||||
}
|
||||
|
||||
StructureArrayConstPtr PVStructureArray::getStructureArray() const
|
||||
{
|
||||
return pImpl->structureArray;
|
||||
}
|
||||
|
||||
int PVStructureArray::get(int offset, int length, StructureArrayData *data) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int PVStructureArray::put(int offset,int length, PVStructureArrayPtr from, int fromOffset)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void PVStructureArray::shareData(PVStructureArrayPtr from)
|
||||
{
|
||||
}
|
||||
|
||||
void PVStructureArray::serialize(ByteBuffer *pbuffer, SerializableControl *pflusher) const
|
||||
{
|
||||
}
|
||||
|
||||
void PVStructureArray::deserialize(ByteBuffer *pbuffer, DeserializableControl *pflusher)
|
||||
{
|
||||
}
|
||||
|
||||
void PVStructureArray::serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher, int offset, int count) const
|
||||
{
|
||||
}
|
||||
|
||||
void PVStructureArray::toString(StringPtr buf) const {toString(buf,0);}
|
||||
|
||||
void PVStructureArray::toString(StringPtr buf,int indentLevel) const
|
||||
{
|
||||
}
|
||||
|
||||
class BasePVStructureArray : public PVStructureArray {
|
||||
public:
|
||||
BasePVStructureArray(PVStructure *parent,StructureArrayConstPtr structureArray)
|
||||
: PVStructureArray(parent,structureArray) {}
|
||||
~BasePVStructureArray(){}
|
||||
private:
|
||||
BasePVStructureArray(); // not implemented
|
||||
BasePVStructureArray(BasePVStructureArray const & ); // not implemented
|
||||
BasePVStructureArray & operator=(BasePVStructureArray const &); //not implemented
|
||||
};
|
||||
|
||||
}}
|
||||
#endif /* BASEPVSTRUCTUREARRAY_H */
|
||||
@@ -5,8 +5,15 @@ include $(TOP)/configure/CONFIG
|
||||
INC += factory.h
|
||||
INC += AbstractPVField.h
|
||||
INC += AbstractPVScalar.h
|
||||
INC += AbstractPVArray.h
|
||||
INC += AbstractPVScalarArray.h
|
||||
INC += BasePVStructure.h
|
||||
INC += BasePVDouble.h
|
||||
INC += BasePVDoubleArray.h
|
||||
INC += BasePVStructure.h
|
||||
INC += BasePVStructureArray.h
|
||||
LIBSRCS += TypeFunc.cpp
|
||||
LIBSRCS += PVAuxInfoImpl.cpp
|
||||
LIBSRCS += FieldCreateFactory.cpp
|
||||
LIBSRCS += PVDataCreateFactory.cpp
|
||||
|
||||
|
||||
84
pvDataApp/factory/PVAuxInfoImpl.cpp
Normal file
84
pvDataApp/factory/PVAuxInfoImpl.cpp
Normal file
@@ -0,0 +1,84 @@
|
||||
/*AbstractPVScalar.h*/
|
||||
#ifndef ABSTRACTPVSCALAR_H
|
||||
#define ABSTRACTPVSCALAR_H
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
#include "pvData.h"
|
||||
#include "factory.h"
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
static PVDataCreate *pvDataCreate =0;
|
||||
|
||||
class PVAuxInfoPvt {
|
||||
public:
|
||||
PVAuxInfoPvt(PVField *pvField)
|
||||
: pvField(pvField),
|
||||
theMap(std::map<StringConstPtr, PVScalar * >())
|
||||
{}
|
||||
PVField *pvField;
|
||||
std::map<StringConstPtr, PVScalar * > theMap;
|
||||
};
|
||||
|
||||
PVAuxInfo::PVAuxInfo(PVField *pvField)
|
||||
: pImpl(new PVAuxInfoPvt(pvField))
|
||||
{ }
|
||||
|
||||
PVAuxInfo::~PVAuxInfo() { delete pImpl;}
|
||||
|
||||
PVField * PVAuxInfo::getPVField() {
|
||||
return pImpl->pvField;
|
||||
}
|
||||
|
||||
typedef std::map<StringConstPtr,PVScalar * >::const_iterator map_iterator;
|
||||
|
||||
PVScalar * PVAuxInfo::createInfo(StringConstPtr key,ScalarType scalarType)
|
||||
{
|
||||
map_iterator i = pImpl->theMap.find(key);
|
||||
if(i!=pImpl->theMap.end()) {
|
||||
std::string message("AuxoInfo:create key ");
|
||||
message += key->c_str();
|
||||
message += " already exists with scalarType ";
|
||||
ScalarTypeFunc::toString(&message,scalarType);
|
||||
pImpl->pvField->message(&message,errorMessage);
|
||||
}
|
||||
if(pvDataCreate==0) pvDataCreate = getPVDataCreate();
|
||||
PVScalar *pvScalar = pvDataCreate->createPVScalar(0,key,scalarType);
|
||||
pImpl->theMap.insert(std::pair<StringConstPtr,PVScalar * >(key, pvScalar));
|
||||
return pvScalar;
|
||||
|
||||
}
|
||||
|
||||
std::map<StringConstPtr, PVScalar * > *PVAuxInfo::getInfos()
|
||||
{
|
||||
return &pImpl->theMap;
|
||||
}
|
||||
|
||||
PVScalar * PVAuxInfo::getInfo(StringConstPtr key)
|
||||
{
|
||||
map_iterator i = pImpl->theMap.find(key);
|
||||
if(i!=pImpl->theMap.end()) return i->second;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void PVAuxInfo::toString(StringPtr buf)
|
||||
{
|
||||
return PVAuxInfo::toString(buf,0);
|
||||
}
|
||||
|
||||
void PVAuxInfo::toString(StringPtr buf,int indentLevel)
|
||||
{
|
||||
map_iterator i = pImpl->theMap.begin();
|
||||
while(i!=pImpl->theMap.end()) {
|
||||
StringConstPtr key = i->first;
|
||||
PVScalar *value = i->second;
|
||||
*buf += " ";
|
||||
*buf += key->c_str();
|
||||
*buf += " ";
|
||||
value->toString(buf);
|
||||
}
|
||||
}
|
||||
}}
|
||||
#endif /* ABSTRACTPVSCALAR_H */
|
||||
@@ -6,27 +6,66 @@
|
||||
#include "pvData.h"
|
||||
#include "factory.h"
|
||||
#include "AbstractPVField.h"
|
||||
#include "AbstractPVScalar.h"
|
||||
#include "AbstractPVArray.h"
|
||||
#include "AbstractPVScalarArray.h"
|
||||
#include "BasePVDouble.h"
|
||||
#include "AbstractPVArray.h"
|
||||
#include "BasePVDoubleArray.h"
|
||||
#include "BasePVStructure.h"
|
||||
#include "BasePVStructureArray.h"
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
static std::string notImplemented("not implemented");
|
||||
|
||||
static FieldCreate * fieldCreate = 0;
|
||||
static PVDataCreate* pvDataCreate = 0;
|
||||
|
||||
PVDataCreate::PVDataCreate(){};
|
||||
|
||||
PVField *PVDataCreate::createPVField(PVStructure *parent,
|
||||
FieldConstPtr field) const
|
||||
FieldConstPtr field)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
switch(field->getType()) {
|
||||
case scalar:
|
||||
return createPVScalar(parent,(ScalarConstPtr)field);
|
||||
case scalarArray:
|
||||
return (PVField *)createPVScalarArray(parent,
|
||||
(ScalarArrayConstPtr)field);
|
||||
case structure:
|
||||
return (PVField *)createPVStructure(parent,
|
||||
(StructureConstPtr)field);
|
||||
case structureArray:
|
||||
return createPVStructureArray(parent,
|
||||
(StructureArrayConstPtr)field);
|
||||
}
|
||||
std::string message("PVDataCreate::createPVField");
|
||||
throw std::invalid_argument(message);
|
||||
};
|
||||
|
||||
PVField *PVDataCreate::createPVField(PVStructure *parent,
|
||||
StringConstPtr fieldName,FieldConstPtr fieldToClone) const
|
||||
StringConstPtr fieldName,PVField * fieldToClone)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
switch(fieldToClone->getField()->getType()) {
|
||||
case scalar:
|
||||
return createPVScalar(parent,fieldName,(PVScalar*)fieldToClone);
|
||||
case scalarArray:
|
||||
return (PVField *)createPVScalarArray(parent,fieldName,
|
||||
(PVScalarArray *)fieldToClone);
|
||||
case structure:
|
||||
return (PVField *)createPVStructure(parent,fieldName,
|
||||
(PVStructure *)fieldToClone);
|
||||
case structureArray:
|
||||
std::string message(
|
||||
"PVDataCreate::createPVField structureArray not valid fieldToClone");
|
||||
throw std::invalid_argument(message);
|
||||
}
|
||||
std::string message("PVDataCreate::createPVField");
|
||||
throw std::logic_error(message);
|
||||
};
|
||||
|
||||
PVScalar *PVDataCreate::createPVScalar(PVStructure *parent,ScalarConstPtr scalar) const
|
||||
PVScalar *PVDataCreate::createPVScalar(PVStructure *parent,ScalarConstPtr scalar)
|
||||
{
|
||||
ScalarType scalarType = scalar->getScalarType();
|
||||
switch(scalarType) {
|
||||
@@ -41,19 +80,37 @@ namespace epics { namespace pvData {
|
||||
PVScalar *PVDataCreate::createPVScalar(PVStructure *parent,
|
||||
StringConstPtr fieldName,ScalarType scalarType)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
if(fieldCreate==0) fieldCreate = getFieldCreate();
|
||||
ScalarConstPtr scalar = fieldCreate->createScalar(fieldName,scalarType);
|
||||
return createPVScalar(parent,scalar);
|
||||
};
|
||||
|
||||
PVScalar *PVDataCreate::createPVScalar(PVStructure *parent,
|
||||
StringConstPtr fieldName,ScalarConstPtr scalarToClone) const
|
||||
StringConstPtr fieldName,PVScalar * scalarToClone)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
PVScalar *pvScalar = createPVScalar(parent,fieldName,
|
||||
scalarToClone->getScalar()->getScalarType());
|
||||
//MARTY MUST CALL CONVERT
|
||||
//MARTY MUST COPY AUXInfo
|
||||
return pvScalar;
|
||||
};
|
||||
|
||||
PVScalarArray *PVDataCreate::createPVScalarArray(PVStructure *parent,
|
||||
ScalarArrayConstPtr scalarArray) const
|
||||
ScalarArrayConstPtr scalarArray)
|
||||
{
|
||||
switch(scalarArray->getElementType()) {
|
||||
case pvBoolean: break;
|
||||
case pvByte: break;
|
||||
case pvShort: break;
|
||||
case pvInt: break;
|
||||
case pvLong: break;
|
||||
case pvFloat: break;
|
||||
case pvDouble:
|
||||
return new BasePVDoubleArray(parent,scalarArray);
|
||||
case pvString: break;
|
||||
}
|
||||
throw std::logic_error(notImplemented);
|
||||
|
||||
};
|
||||
|
||||
PVScalarArray *PVDataCreate::createPVScalarArray(PVStructure *parent,
|
||||
@@ -63,13 +120,13 @@ namespace epics { namespace pvData {
|
||||
};
|
||||
|
||||
PVScalarArray *PVDataCreate::createPVScalarArray(PVStructure *parent,
|
||||
StringConstPtr fieldName,ScalarArrayConstPtr scalarArrayToClone) const
|
||||
StringConstPtr fieldName,PVScalarArray * scalarArrayToClone)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
};
|
||||
|
||||
PVStructureArray *PVDataCreate::createPVStructureArray(PVStructure *parent,
|
||||
StructureArrayConstPtr structureArray) const
|
||||
StructureArrayConstPtr structureArray)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
};
|
||||
@@ -77,7 +134,7 @@ namespace epics { namespace pvData {
|
||||
PVStructure *PVDataCreate::createPVStructure(PVStructure *parent,
|
||||
StructureConstPtr structure)
|
||||
{
|
||||
throw std::logic_error(notImplemented);
|
||||
return new BasePVStructure(parent,structure);
|
||||
};
|
||||
|
||||
PVStructure *PVDataCreate::createPVStructure(PVStructure *parent,
|
||||
@@ -92,7 +149,6 @@ namespace epics { namespace pvData {
|
||||
throw std::logic_error(notImplemented);
|
||||
};
|
||||
|
||||
static PVDataCreate* instance = 0;
|
||||
|
||||
class PVDataCreateExt : public PVDataCreate {
|
||||
public:
|
||||
@@ -100,8 +156,8 @@ namespace epics { namespace pvData {
|
||||
};
|
||||
|
||||
PVDataCreate * getPVDataCreate() {
|
||||
if(instance==0) instance = new PVDataCreateExt();
|
||||
return instance;
|
||||
if(pvDataCreate==0) pvDataCreate = new PVDataCreateExt();
|
||||
return pvDataCreate;
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
@@ -36,15 +36,19 @@ namespace epics { namespace pvData {
|
||||
|
||||
class PVAuxInfo {
|
||||
public:
|
||||
virtual ~PVAuxInfo();
|
||||
virtual PVField * getPVField() const = 0;
|
||||
virtual PVScalar * createInfo(StringConstPtr key,ScalarType scalarType) = 0;
|
||||
/* following caused compiler error
|
||||
virtual map<std::string, ScalarType> getInfos() = 0;
|
||||
*/
|
||||
virtual PVScalar * getInto(StringConstPtr key) = 0;
|
||||
virtual void toString(StringPtr buf) const = 0;
|
||||
virtual void toString(StringPtr buf,int indentLevel) const = 0;
|
||||
PVAuxInfo(PVField *pvField);
|
||||
~PVAuxInfo();
|
||||
PVField * getPVField();
|
||||
PVScalar * createInfo(StringConstPtr key,ScalarType scalarType);
|
||||
std::map<StringConstPtr, PVScalar * > *getInfos();
|
||||
PVScalar * getInfo(StringConstPtr key);
|
||||
void toString(StringPtr buf);
|
||||
void toString(StringPtr buf,int indentLevel);
|
||||
private:
|
||||
PVAuxInfo(); // not implemented
|
||||
PVAuxInfo(PVAuxInfo const & ); // not implemented
|
||||
PVAuxInfo & operator=(PVAuxInfo const &); //not implemented
|
||||
class PVAuxInfoPvt *pImpl;
|
||||
};
|
||||
|
||||
class PostHandler {
|
||||
@@ -54,27 +58,180 @@ namespace epics { namespace pvData {
|
||||
class PVField : public Requester, public Serializable {
|
||||
public:
|
||||
virtual ~PVField();
|
||||
virtual void setRequester(Requester *prequester) = 0;
|
||||
virtual int getFieldOffset() const = 0;
|
||||
virtual int getNextFieldOffset() const = 0;
|
||||
virtual int getNumberFields() const = 0;
|
||||
virtual PVAuxInfo * getPVAuxInfo() const = 0;
|
||||
virtual epicsBoolean isImmutable() const = 0;
|
||||
virtual void setImmutable() = 0;
|
||||
virtual FieldConstPtr getField() const = 0;
|
||||
virtual PVStructure * getParent() const = 0;
|
||||
virtual void replacePVField(PVField * newPVField) = 0;
|
||||
virtual void renameField(StringConstPtr newName) = 0;
|
||||
virtual void postPut() const = 0;
|
||||
virtual void setPostHandler(PostHandler *ppostHandler) = 0;
|
||||
virtual void toString(StringPtr buf) const = 0;
|
||||
virtual void toString(StringPtr buf,int indentLevel) const = 0;
|
||||
};
|
||||
StringConstPtr getRequesterName() const;
|
||||
virtual void message(StringConstPtr message,MessageType messageType) const;
|
||||
virtual void setRequester(Requester *prequester);
|
||||
int getFieldOffset() const;
|
||||
int getNextFieldOffset() const;
|
||||
int getNumberFields() const;
|
||||
PVAuxInfo * getPVAuxInfo();
|
||||
epicsBoolean isImmutable() const;
|
||||
void setImmutable();
|
||||
FieldConstPtr getField() const;
|
||||
PVStructure * getParent() const;
|
||||
void replacePVField(PVField * newPVField);
|
||||
void renameField(StringConstPtr newName);
|
||||
void postPut() const;
|
||||
void setPostHandler(PostHandler *postHandler);
|
||||
virtual void toString(StringPtr buf) const;
|
||||
virtual void toString(StringPtr buf,int indentLevel) const;
|
||||
protected:
|
||||
PVField(PVStructure *parent,FieldConstPtr field);
|
||||
void replaceStructure();
|
||||
private:
|
||||
PVField();//not implemented
|
||||
PVField(PVField const & ); // not implemented
|
||||
PVField & operator=(PVField const &); //not implemented
|
||||
class PVFieldPvt *pImpl;
|
||||
static void computeOffset(const PVField * const pvField);
|
||||
static void computeOffset(const PVField * const pvField,int offset);
|
||||
};
|
||||
|
||||
class PVScalar : public PVField {
|
||||
public:
|
||||
virtual ~PVScalar();
|
||||
virtual ScalarConstPtr getScalar() const = 0;
|
||||
ScalarConstPtr getScalar() const;
|
||||
virtual void toString(StringPtr buf) const = 0;
|
||||
virtual void toString(StringPtr buf,int indentLevel) const = 0;
|
||||
protected:
|
||||
PVScalar(PVStructure *parent,ScalarConstPtr scalar);
|
||||
private:
|
||||
PVScalar(); // not implemented
|
||||
PVScalar(PVScalar const & ); // not implemented
|
||||
PVScalar & operator=(PVScalar const &); //not implemented
|
||||
};
|
||||
|
||||
class PVArray : public PVField, public SerializableArray {
|
||||
public:
|
||||
virtual ~PVArray();
|
||||
int getLength() const;
|
||||
void setLength(int length);
|
||||
int getCapacity() const;
|
||||
epicsBoolean isCapacityImmutable() const;
|
||||
void setCapacityImmutable(epicsBoolean isMutable);
|
||||
virtual void setCapacity(int capacity) = 0;
|
||||
virtual void serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher) const = 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(StringPtr buf) const;
|
||||
virtual void toString(StringPtr buf,int indentLevel) const = 0;
|
||||
protected:
|
||||
PVArray(PVStructure *parent,FieldConstPtr field);
|
||||
private:
|
||||
PVArray(); // not implemented
|
||||
PVArray(PVArray const & ); // not implemented
|
||||
PVArray & operator=(PVArray const &); //not implemented
|
||||
class PVArrayPvt *pImpl;
|
||||
};
|
||||
|
||||
|
||||
class PVScalarArray : public PVArray {
|
||||
public:
|
||||
virtual ~PVScalarArray();
|
||||
ScalarArrayConstPtr getScalarArray() const;
|
||||
virtual void setCapacity(int capacity) = 0;
|
||||
virtual void serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher) const = 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(StringPtr buf) const = 0;
|
||||
virtual void toString(StringPtr buf,int indentLevel) const = 0;
|
||||
protected:
|
||||
PVScalarArray(PVStructure *parent,ScalarArrayConstPtr scalarArray);
|
||||
private:
|
||||
PVScalarArray(); // not implemented
|
||||
PVScalarArray(PVScalarArray const & ); // not implemented
|
||||
PVScalarArray & operator=(PVScalarArray const &); //not implemented
|
||||
};
|
||||
|
||||
typedef PVStructure * PVStructurePtr;
|
||||
typedef PVStructurePtr * PVStructureArrayPtr;
|
||||
|
||||
class StructureArrayData {
|
||||
public:
|
||||
PVStructureArrayPtr data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVStructureArray : public PVArray {
|
||||
public:
|
||||
virtual ~PVStructureArray();
|
||||
virtual StructureArrayConstPtr getStructureArray() const;
|
||||
virtual int get(int offset, int length,
|
||||
StructureArrayData *data) const;
|
||||
virtual int put(int offset,int length,
|
||||
PVStructureArrayPtr from, int fromOffset);
|
||||
virtual void shareData(PVStructureArrayPtr from);
|
||||
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(StringPtr buf) const;
|
||||
virtual void toString(StringPtr buf,int indentLevel) const;
|
||||
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;
|
||||
|
||||
class PVStructure : public PVField, public BitSetSerializable {
|
||||
public:
|
||||
virtual ~PVStructure();
|
||||
StructureConstPtr getStructure();
|
||||
PVFieldArrayPtr getPVFields();
|
||||
PVFieldPtr getSubField(StringConstPtr fieldName);
|
||||
PVFieldPtr getSubField(int fieldOffset);
|
||||
void appendPVField(PVField * pvField);
|
||||
void appendPVFields(PVFieldArrayPtr pvFields);
|
||||
void removePVField(StringConstPtr fieldName);
|
||||
PVBoolean *getBooleanField(StringConstPtr fieldName);
|
||||
PVByte *getByteField(StringConstPtr fieldName);
|
||||
PVShort *getShortField(StringConstPtr fieldName);
|
||||
PVInt *getIntField(StringConstPtr fieldName);
|
||||
PVLong *getLongField(StringConstPtr fieldName);
|
||||
PVFloat *getFloatField(StringConstPtr fieldName);
|
||||
PVDouble *getDoubleField(StringConstPtr fieldName);
|
||||
PVString *getStringField(StringConstPtr fieldName);
|
||||
PVStructure *getStructureField(StringConstPtr fieldName);
|
||||
PVScalarArray *getScalarArrayField(
|
||||
StringConstPtr fieldName,ScalarType elementType);
|
||||
PVStructureArray *getStructureArrayField(StringConstPtr fieldName);
|
||||
StringConstPtr getExtendsStructureName();
|
||||
epicsBoolean putExtendsStructureName(
|
||||
StringConstPtr extendsStructureName);
|
||||
virtual void toString(StringPtr buf) const;
|
||||
virtual void toString(StringPtr buf,int indentLevel) const;
|
||||
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 serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher,BitSet *pbitSet) const;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,
|
||||
DeserializableControl*pflusher,BitSet *pbitSet);
|
||||
protected:
|
||||
PVStructure(PVStructure *parent,StructureConstPtr structure);
|
||||
private:
|
||||
PVStructure(); // not implemented
|
||||
PVStructure(PVStructure const & ); // not implemented
|
||||
PVStructure& operator=(PVStructure const &); //not implemented
|
||||
class PVStructurePvt *pImpl;
|
||||
};
|
||||
|
||||
class PVBoolean : public PVScalar {
|
||||
@@ -82,6 +239,13 @@ namespace epics { namespace pvData {
|
||||
virtual ~PVBoolean();
|
||||
virtual epicsBoolean get() const = 0;
|
||||
virtual void put(epicsBoolean value) = 0;
|
||||
protected:
|
||||
PVBoolean(PVStructure *parent,ScalarConstPtr scalar)
|
||||
: PVScalar(parent,scalar) {}
|
||||
private:
|
||||
PVBoolean(); // not implemented
|
||||
PVBoolean(PVBoolean const & ); // not implemented
|
||||
PVBoolean & operator=(PVBoolean const &); //not implemented
|
||||
};
|
||||
|
||||
class PVByte : public PVScalar {
|
||||
@@ -89,6 +253,13 @@ namespace epics { namespace pvData {
|
||||
virtual ~PVByte();
|
||||
virtual epicsInt8 get() const = 0;
|
||||
virtual void put(epicsInt8 value) = 0;
|
||||
protected:
|
||||
PVByte(PVStructure *parent,ScalarConstPtr scalar)
|
||||
: PVScalar(parent,scalar) {}
|
||||
private:
|
||||
PVByte(); // not implemented
|
||||
PVByte(PVByte const & ); // not implemented
|
||||
PVByte & operator=(PVByte const &); //not implemented
|
||||
};
|
||||
|
||||
class PVShort : public PVScalar {
|
||||
@@ -96,6 +267,13 @@ namespace epics { namespace pvData {
|
||||
virtual ~PVShort();
|
||||
virtual epicsInt16 get() const = 0;
|
||||
virtual void put(epicsInt16 value) = 0;
|
||||
protected:
|
||||
PVShort(PVStructure *parent,ScalarConstPtr scalar)
|
||||
: PVScalar(parent,scalar) {}
|
||||
private:
|
||||
PVShort(); // not implemented
|
||||
PVShort(PVShort const & ); // not implemented
|
||||
PVShort & operator=(PVShort const &); //not implemented
|
||||
};
|
||||
|
||||
class PVInt : public PVScalar {
|
||||
@@ -103,6 +281,13 @@ namespace epics { namespace pvData {
|
||||
virtual ~PVInt();
|
||||
virtual epicsInt32 get() const = 0;
|
||||
virtual void put(epicsInt32 value) = 0;
|
||||
protected:
|
||||
PVInt(PVStructure *parent,ScalarConstPtr scalar)
|
||||
: PVScalar(parent,scalar) {}
|
||||
private:
|
||||
PVInt(); // not implemented
|
||||
PVInt(PVInt const & ); // not implemented
|
||||
PVInt & operator=(PVInt const &); //not implemented
|
||||
};
|
||||
|
||||
class PVLong : public PVScalar {
|
||||
@@ -110,6 +295,13 @@ namespace epics { namespace pvData {
|
||||
virtual ~PVLong();
|
||||
virtual epicsInt64 get() const = 0;
|
||||
virtual void put(epicsInt64 value) = 0;
|
||||
protected:
|
||||
PVLong(PVStructure *parent,ScalarConstPtr scalar)
|
||||
: PVScalar(parent,scalar) {}
|
||||
private:
|
||||
PVLong(); // not implemented
|
||||
PVLong(PVLong const & ); // not implemented
|
||||
PVLong & operator=(PVLong const &); //not implemented
|
||||
};
|
||||
|
||||
class PVFloat : public PVScalar {
|
||||
@@ -117,6 +309,13 @@ namespace epics { namespace pvData {
|
||||
virtual ~PVFloat();
|
||||
virtual float get() const = 0;
|
||||
virtual void put(float value) = 0;
|
||||
protected:
|
||||
PVFloat(PVStructure *parent,ScalarConstPtr scalar)
|
||||
: PVScalar(parent,scalar) {}
|
||||
private:
|
||||
PVFloat(); // not implemented
|
||||
PVFloat(PVFloat const & ); // not implemented
|
||||
PVFloat & operator=(PVFloat const &); //not implemented
|
||||
};
|
||||
|
||||
class PVDouble : public PVScalar {
|
||||
@@ -124,6 +323,13 @@ namespace epics { namespace pvData {
|
||||
virtual ~PVDouble();
|
||||
virtual double get() const = 0;
|
||||
virtual void put(double value) = 0;
|
||||
protected:
|
||||
PVDouble(PVStructure *parent,ScalarConstPtr scalar)
|
||||
: PVScalar(parent,scalar) {}
|
||||
private:
|
||||
PVDouble(); // not implemented
|
||||
PVDouble(PVScalar const & ); // not implemented
|
||||
PVDouble & operator=(PVScalar const &); //not implemented
|
||||
};
|
||||
|
||||
class PVString : public PVScalar {
|
||||
@@ -131,28 +337,243 @@ namespace epics { namespace pvData {
|
||||
virtual ~PVString();
|
||||
virtual StringConstPtr get() const = 0;
|
||||
virtual void put(StringConstPtr value) = 0;
|
||||
protected:
|
||||
PVString(PVStructure *parent,ScalarConstPtr scalar)
|
||||
: PVScalar(parent,scalar) {}
|
||||
private:
|
||||
PVString(); // not implemented
|
||||
PVString(PVString const & ); // not implemented
|
||||
PVString & operator=(PVString const &); //not implemented
|
||||
};
|
||||
|
||||
typedef epicsBoolean * EpicsBooleanArrayPtr;
|
||||
|
||||
class BooleanArrayData {
|
||||
public:
|
||||
EpicsBooleanArrayPtr data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVBooleanArray : public PVScalarArray {
|
||||
public:
|
||||
virtual ~PVBooleanArray();
|
||||
virtual void toString(StringPtr buf) const;
|
||||
virtual void toString(StringPtr 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 deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher);
|
||||
protected:
|
||||
PVBooleanArray(PVStructure *parent,ScalarConstPtr scalar);
|
||||
private:
|
||||
PVBooleanArray(); // not implemented
|
||||
PVBooleanArray(PVBooleanArray const & ); // not implemented
|
||||
PVBooleanArray & operator=(PVBooleanArray const &); //not implemented
|
||||
};
|
||||
|
||||
typedef signed char * ByteArrayPtr;
|
||||
|
||||
class ByteArrayData {
|
||||
public:
|
||||
ByteArrayPtr data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVByteArray : public PVScalarArray {
|
||||
public:
|
||||
virtual ~PVByteArray();
|
||||
virtual void toString(StringPtr buf) const;
|
||||
virtual void toString(StringPtr 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 deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher);
|
||||
protected:
|
||||
PVByteArray(PVStructure *parent,ScalarConstPtr scalar);
|
||||
private:
|
||||
PVByteArray(); // not implemented
|
||||
PVByteArray(PVByteArray const & ); // not implemented
|
||||
PVByteArray & operator=(PVByteArray const &); //not implemented
|
||||
};
|
||||
|
||||
typedef short * ShortArrayPtr;
|
||||
|
||||
class ShortArrayData {
|
||||
public:
|
||||
ShortArrayPtr data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVShortArray : public PVScalarArray {
|
||||
public:
|
||||
virtual ~PVShortArray();
|
||||
virtual void toString(StringPtr buf) const;
|
||||
virtual void toString(StringPtr 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 deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher);
|
||||
protected:
|
||||
PVShortArray(PVStructure *parent,ScalarConstPtr scalar);
|
||||
private:
|
||||
PVShortArray(); // not implemented
|
||||
PVShortArray(PVShortArray const & ); // not implemented
|
||||
PVShortArray & operator=(PVShortArray const &); //not implemented
|
||||
};
|
||||
|
||||
typedef int * IntArrayPtr;
|
||||
|
||||
class IntArrayData {
|
||||
public:
|
||||
IntArrayPtr data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVIntArray : public PVScalarArray {
|
||||
public:
|
||||
virtual ~PVIntArray();
|
||||
virtual void toString(StringPtr buf) const;
|
||||
virtual void toString(StringPtr 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 deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher);
|
||||
protected:
|
||||
PVIntArray(PVStructure *parent,ScalarConstPtr scalar);
|
||||
private:
|
||||
PVIntArray(); // not implemented
|
||||
PVIntArray(PVIntArray const & ); // not implemented
|
||||
PVIntArray & operator=(PVIntArray const &); //not implemented
|
||||
};
|
||||
|
||||
typedef long * LongArrayPtr;
|
||||
|
||||
class LongArrayData {
|
||||
public:
|
||||
LongArrayPtr data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVLongArray : public PVScalarArray {
|
||||
public:
|
||||
virtual ~PVLongArray();
|
||||
virtual void toString(StringPtr buf) const;
|
||||
virtual void toString(StringPtr 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 deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher);
|
||||
protected:
|
||||
PVLongArray(PVStructure *parent,ScalarConstPtr scalar);
|
||||
private:
|
||||
PVLongArray(); // not implemented
|
||||
PVLongArray(PVLongArray const & ); // not implemented
|
||||
PVLongArray & operator=(PVLongArray const &); //not implemented
|
||||
};
|
||||
|
||||
|
||||
typedef float * FloatArrayPtr;
|
||||
|
||||
class FloatArrayData {
|
||||
public:
|
||||
FloatArrayPtr data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVFloatArray : public PVScalarArray {
|
||||
public:
|
||||
virtual ~PVFloatArray();
|
||||
virtual void toString(StringPtr buf) const;
|
||||
virtual void toString(StringPtr 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 deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher);
|
||||
protected:
|
||||
PVFloatArray(PVStructure *parent,ScalarConstPtr scalar);
|
||||
private:
|
||||
PVFloatArray(); // not implemented
|
||||
PVFloatArray(PVFloatArray const & ); // not implemented
|
||||
PVFloatArray & operator=(PVFloatArray const &); //not implemented
|
||||
};
|
||||
|
||||
typedef double * DoubleArrayPtr;
|
||||
|
||||
class DoubleArrayData {
|
||||
public:
|
||||
DoubleArrayPtr data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVDoubleArray : public PVScalarArray {
|
||||
public:
|
||||
virtual ~PVDoubleArray();
|
||||
virtual void toString(StringPtr buf) const = 0;
|
||||
virtual void toString(StringPtr 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 deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher) = 0;
|
||||
protected:
|
||||
PVDoubleArray(PVStructure *parent,ScalarArrayConstPtr scalar);
|
||||
private:
|
||||
PVDoubleArray(); // not implemented
|
||||
PVDoubleArray(PVDoubleArray const & ); // not implemented
|
||||
PVDoubleArray & operator=(PVDoubleArray const &); //not implemented
|
||||
};
|
||||
|
||||
typedef std::string * StringArrayPtr;
|
||||
|
||||
class StringArrayData {
|
||||
public:
|
||||
StringArrayPtr data;
|
||||
int offset;
|
||||
};
|
||||
|
||||
class PVStringArray : public PVScalarArray {
|
||||
public:
|
||||
virtual ~PVStringArray();
|
||||
virtual void toString(StringPtr buf) const;
|
||||
virtual void toString(StringPtr 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 deserialize(ByteBuffer *pbuffer,DeserializableControl *pflusher);
|
||||
protected:
|
||||
PVStringArray(PVStructure *parent,ScalarConstPtr scalar);
|
||||
private:
|
||||
PVStringArray(); // not implemented
|
||||
PVStringArray(PVStringArray const & ); // not implemented
|
||||
PVStringArray & operator=(PVStringArray const &); //not implemented
|
||||
};
|
||||
|
||||
|
||||
class PVDataCreate {
|
||||
public:
|
||||
PVField *createPVField(PVStructure *parent,
|
||||
FieldConstPtr field) const;
|
||||
FieldConstPtr field);
|
||||
PVField *createPVField(PVStructure *parent,
|
||||
StringConstPtr fieldName,FieldConstPtr fieldToClone) const;
|
||||
PVScalar *createPVScalar(PVStructure *parent,ScalarConstPtr scalar) const;
|
||||
StringConstPtr fieldName,PVField * fieldToClone);
|
||||
PVScalar *createPVScalar(PVStructure *parent,ScalarConstPtr scalar);
|
||||
PVScalar *createPVScalar(PVStructure *parent,
|
||||
StringConstPtr fieldName,ScalarType scalarType);
|
||||
PVScalar *createPVScalar(PVStructure *parent,
|
||||
StringConstPtr fieldName,ScalarConstPtr scalarToClone) const;
|
||||
StringConstPtr fieldName,PVScalar * scalarToClone);
|
||||
PVScalarArray *createPVScalarArray(PVStructure *parent,
|
||||
ScalarArrayConstPtr scalarArray) const;
|
||||
ScalarArrayConstPtr scalarArray);
|
||||
PVScalarArray *createPVScalarArray(PVStructure *parent,
|
||||
StringConstPtr fieldName,ScalarType elementType);
|
||||
PVScalarArray *createPVScalarArray(PVStructure *parent,
|
||||
StringConstPtr fieldName,ScalarArrayConstPtr scalarArrayToClone) const;
|
||||
StringConstPtr fieldName,PVScalarArray * scalarArrayToClone);
|
||||
PVStructureArray *createPVStructureArray(PVStructure *parent,
|
||||
StructureArrayConstPtr structureArray) const;
|
||||
StructureArrayConstPtr structureArray);
|
||||
PVStructure *createPVStructure(PVStructure *parent,
|
||||
StructureConstPtr structure);
|
||||
PVStructure *createPVStructure(PVStructure *parent,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "pvIntrospect.h"
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
enum MessageType {info,warning,error,fatalError};
|
||||
enum MessageType {infoMessage,warningMessage,errorMessage,fatalErrorMessage};
|
||||
|
||||
static std::string messageTypeName[] = {"info","warning","error","fatalError"};
|
||||
|
||||
|
||||
@@ -17,8 +17,10 @@ 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 *pbuffer,
|
||||
SerializableControl *pflusher) const = 0;
|
||||
virtual void deserialize(ByteBuffer *pbuffer,
|
||||
DeserializableControl *pflusher) = 0;
|
||||
};
|
||||
|
||||
class BitSetSerializable {
|
||||
|
||||
@@ -2,7 +2,7 @@ TOP=../..
|
||||
|
||||
include $(TOP)/configure/CONFIG
|
||||
|
||||
PROD_HOST = test
|
||||
PROD_HOST += test
|
||||
test_SRCS += test.cpp
|
||||
test_LIBS += pvFactory
|
||||
|
||||
@@ -10,6 +10,10 @@ PROD_HOST += testDumpStdString
|
||||
testDumpStdString_SRCS += testDumpStdString.cpp
|
||||
testDumpStdString_LIBS += pvFactory
|
||||
|
||||
PROD_HOST += testPVAuxInfo
|
||||
testPVAuxInfo_SRCS += testPVAuxInfo.cpp
|
||||
testPVAuxInfo_LIBS += pvFactory
|
||||
|
||||
PROD_HOST += testPVScalar
|
||||
testPVScalar_SRCS += testPVScalar.cpp
|
||||
testPVScalar_LIBS += pvFactory
|
||||
|
||||
51
pvDataApp/test/testPVAuxInfo.cpp
Normal file
51
pvDataApp/test/testPVAuxInfo.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
/* testPVAuxInfo.cpp */
|
||||
/* Author: Marty Kraimer Date: 2010.09.21 */
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "pvData.h"
|
||||
|
||||
using namespace epics::pvData;
|
||||
|
||||
static FieldCreate * fieldCreate = 0;
|
||||
static PVDataCreate *pvDataCreate = 0;
|
||||
static std::string theBuffer("");
|
||||
static std::string *buffer = &theBuffer;
|
||||
|
||||
void testDouble() {
|
||||
printf("\ntestDouble\n");
|
||||
std::string valueName("value");
|
||||
ScalarConstPtr pscalar = fieldCreate->createScalar(&valueName,pvDouble);
|
||||
PVScalar *pvScalar = pvDataCreate->createPVScalar(0,pscalar);
|
||||
PVDouble *pvValue = dynamic_cast<PVDouble *>(pvScalar);
|
||||
double value = 2;
|
||||
pvValue->put(value);
|
||||
double getValue = pvValue->get();
|
||||
if(value!=getValue) {
|
||||
fprintf(stderr,"ERROR getValue put %f get %f\n",value,getValue);
|
||||
}
|
||||
PVAuxInfo *auxInfo = pvValue->getPVAuxInfo();
|
||||
std::string stringName("string");
|
||||
pvScalar = auxInfo->createInfo(&stringName,pvDouble);
|
||||
PVDouble *doubleInfo = dynamic_cast<PVDouble *>(pvScalar);
|
||||
doubleInfo->put(100.0);
|
||||
pvScalar = auxInfo->getInfo(&stringName);
|
||||
buffer->clear();
|
||||
*buffer += "stringInfo ";
|
||||
pvScalar->toString(buffer);
|
||||
printf("%s\n",buffer->c_str());
|
||||
delete pvValue;
|
||||
}
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
fieldCreate = getFieldCreate();
|
||||
pvDataCreate = getPVDataCreate();
|
||||
testDouble();
|
||||
return(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user