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:
Michael Davidsaver
2011-02-15 11:39:38 -05:00
parent 67ae45521b
commit bb6cf7c00b
2 changed files with 2 additions and 2 deletions

View File

@@ -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;

View File

@@ -58,7 +58,7 @@ public:
class PVField
: public Requester,
public Serializable,
virtual public Serializable,
private NoDefaultMethods
{
public: