fix bug in Convert.cpp; In misc add virtual destructor to abstract classes
This commit is contained in:
@@ -416,6 +416,7 @@ int Convert::copyScalarArray(PVScalarArray *from, int offset,
|
||||
length -= n; num -= n; ncopy+=n; offset += n; toOffset += n;
|
||||
}
|
||||
}
|
||||
return ncopy;
|
||||
} else if(toElementType==pvString && fromElementType==pvString) {
|
||||
PVStringArray *pvfrom = static_cast<PVStringArray*>(from);
|
||||
PVStringArray *pvto = static_cast<PVStringArray*>(to);
|
||||
@@ -434,6 +435,7 @@ int Convert::copyScalarArray(PVScalarArray *from, int offset,
|
||||
length -= n; num -= n; ncopy+=n; offset += n; toOffset += n;
|
||||
}
|
||||
}
|
||||
return ncopy;
|
||||
} else if(toElementType==pvString) {
|
||||
PVStringArray *pvto = static_cast<PVStringArray*>(to);
|
||||
ncopy = from->getLength();
|
||||
@@ -463,6 +465,7 @@ int Convert::copyScalarArray(PVScalarArray *from, int offset,
|
||||
length -= n; num -= n; ncopy+=n; offset += n; toOffset += n;
|
||||
}
|
||||
}
|
||||
return ncopy;
|
||||
}
|
||||
String message("Convert::copyScalarArray should not get here");
|
||||
throw std::logic_error(message);
|
||||
@@ -533,7 +536,7 @@ void Convert::copyStructure(PVStructure *from, PVStructure *to)
|
||||
FieldConstPtr fieldIndex = fromDatas[0]->getField();
|
||||
FieldConstPtr fieldChoices = fromDatas[1]->getField();
|
||||
if(fieldIndex->getType()==scalar
|
||||
&& fieldChoices->getFieldName().compare("choices")
|
||||
&& (fieldChoices->getFieldName().compare("choices")==0)
|
||||
&& fieldChoices->getType()==scalarArray) {
|
||||
PVScalar *pvScalar = static_cast<PVScalar*>(fromDatas[0]);
|
||||
PVScalarArray *pvArray =
|
||||
@@ -543,7 +546,7 @@ void Convert::copyStructure(PVStructure *from, PVStructure *to)
|
||||
PVScalarArray* toArray =
|
||||
static_cast<PVScalarArray*>(toDatas[1]);
|
||||
copyScalarArray(pvArray,0,toArray,0,pvArray->getLength());
|
||||
PVScalar *toScalar = (PVScalar*)toDatas[0];
|
||||
PVScalar *toScalar = static_cast<PVScalar*>(toDatas[0]);
|
||||
copyScalar(pvScalar,toScalar);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ class ExecutorNode;
|
||||
|
||||
class Command {
|
||||
public:
|
||||
virtual ~Command(){}
|
||||
virtual void command() = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ extern StringArray messageTypeName;
|
||||
|
||||
class Requester {
|
||||
public:
|
||||
virtual ~Requester(){}
|
||||
virtual String getRequesterName() = 0;
|
||||
virtual void message(String message,MessageType messageType) = 0;
|
||||
};
|
||||
|
||||
@@ -18,17 +18,20 @@ namespace epics { namespace pvData {
|
||||
|
||||
class SerializableControl {
|
||||
public:
|
||||
virtual ~SerializableControl(){}
|
||||
virtual void flushSerializeBuffer() =0;
|
||||
virtual void ensureBuffer(int size) =0;
|
||||
};
|
||||
|
||||
class DeserializableControl {
|
||||
public:
|
||||
virtual ~DeserializableControl(){}
|
||||
virtual void ensureData(int size) =0;
|
||||
};
|
||||
|
||||
class Serializable {
|
||||
public:
|
||||
virtual ~Serializable(){}
|
||||
virtual void serialize(ByteBuffer *buffer,
|
||||
SerializableControl *flusher) const = 0;
|
||||
virtual void deserialize(ByteBuffer *buffer,
|
||||
@@ -37,6 +40,7 @@ namespace epics { namespace pvData {
|
||||
|
||||
class BitSetSerializable {
|
||||
public:
|
||||
virtual ~BitSetSerializable(){}
|
||||
virtual void serialize(ByteBuffer *buffer,
|
||||
SerializableControl *flusher,BitSet *bitSet) const = 0;
|
||||
virtual void deserialize(ByteBuffer *buffer,
|
||||
@@ -46,6 +50,7 @@ namespace epics { namespace pvData {
|
||||
|
||||
class SerializableArray : virtual public Serializable {
|
||||
public:
|
||||
virtual ~SerializableArray(){}
|
||||
virtual void serialize(ByteBuffer *buffer,
|
||||
SerializableControl *flusher, int offset, int count) const = 0;
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace epics { namespace pvData {
|
||||
|
||||
class TimeFunctionRequester {
|
||||
public:
|
||||
virtual ~TimeFunctionRequester(){}
|
||||
virtual void function() = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ class Timer;
|
||||
|
||||
class TimerCallback {
|
||||
public:
|
||||
virtual ~TimerCallback(){}
|
||||
virtual void callback() = 0;
|
||||
virtual void timerStopped() = 0;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user