fix bug in Convert.cpp; In misc add virtual destructor to abstract classes

This commit is contained in:
Marty Kraimer
2011-04-12 08:26:58 -04:00
parent 323a2d7321
commit efdef77461
6 changed files with 14 additions and 2 deletions
+5 -2
View File
@@ -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;
}
+1
View File
@@ -19,6 +19,7 @@ class ExecutorNode;
class Command {
public:
virtual ~Command(){}
virtual void command() = 0;
};
+1
View File
@@ -20,6 +20,7 @@ extern StringArray messageTypeName;
class Requester {
public:
virtual ~Requester(){}
virtual String getRequesterName() = 0;
virtual void message(String message,MessageType messageType) = 0;
};
+5
View File
@@ -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;
};
+1
View File
@@ -13,6 +13,7 @@ namespace epics { namespace pvData {
class TimeFunctionRequester {
public:
virtual ~TimeFunctionRequester(){}
virtual void function() = 0;
};
+1
View File
@@ -23,6 +23,7 @@ class Timer;
class TimerCallback {
public:
virtual ~TimerCallback(){}
virtual void callback() = 0;
virtual void timerStopped() = 0;
};