Encoding/decoding protocol messages to/from various bits of hardware
OK. I doubt it is irrelevant.

//ref_type is a smart pointers class - not really so relevant to my question


Also smart pointers are very hard to get perfectly correct. The standard ones took years and thousands of people looking at them to get correct. So It is usually preferable to use one of the standard smart pointers rather than a home grown one (especially one that is not being reviewed).

So who owns this pointer?

    virtual const char* ProtocolName() const = 0;


There are no ownership semantics associated with pointers. So After I call this I am not sure who is responsible for deleting it. Use a std::string internally and return a const reference to the string.

Not sure why you would want two methods that look like they do the same thing.

    //for binary protocols
    virtual void getMessage(unsigned char*&amp; serialised, size_t&amp; length) {}; 
    //for text/xml protocols
    virtual void getMessage(std::string&amp; serialised) {}


Both are going to be inefficient as you are copying across multiple buffers (input stream buffer into this buffer which is then returned and read again to build an object). What you really want is a getMessage() method that returns a fully constructed object from the stream.

This calss:

class ABCMessage : public BaseMessage {


Is totally broken as it contains an owned RAW pointer but does not implement the rule of three.