avoid method resolution problem from diamond inheritance
Serializable -> SerializableArray Serializable -> PVField SerializableArray -> PVArray PVField -> PVArray Thus for PVArray the members of SerializeSerializable are reachable by two paths. This means that The vtable for PVArray has two seperate entries for serialize. Correct resolution is to use virtual inheritance to avoid the ambiguity.
This commit is contained in:
@@ -44,7 +44,7 @@ namespace epics { namespace pvData {
|
||||
};
|
||||
|
||||
|
||||
class SerializableArray : public Serializable {
|
||||
class SerializableArray : virtual public Serializable {
|
||||
public:
|
||||
virtual void serialize(ByteBuffer *buffer,
|
||||
SerializableControl *flusher, int offset, int count) = 0;
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
|
||||
class PVField
|
||||
: public Requester,
|
||||
public Serializable,
|
||||
virtual public Serializable,
|
||||
private NoDefaultMethods
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user