Inheriting from generated C++ classes for adding Qt QString accessors. Problems expected?

2009-03-09 Thread bart van deenen

Hi all

I'd like to add some Qt specific addditions to some generated gpb
classes, but I note the warning on the first C++ page of the
documentation:

You should not create your own Foo subclasses. If you subclass this
class and override a virtual method, the override may be ignored, as
many generated method calls are de-virtualized to improve performance.


I should be fine as long as I don't use any of the already defined
member names shouldn't I?

Bart
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: Inheriting from generated C++ classes for adding Qt QString accessors. Problems expected?

2009-03-09 Thread Kenton Varda
If you are OK with the possibility that future versions of protocol buffers
may break your code (probably in minor ways), then you can do whatever you
want.  If you aren't OK with that, then you should not subclass protocol
buffer types.  There are tons of ways that future changes to the
implementation could break you.  This is known generally as the fragile
base class problem.
On Mon, Mar 9, 2009 at 3:00 AM, bart van deenen bart.vandee...@gmail.comwrote:


 Hi all

 I'd like to add some Qt specific addditions to some generated gpb
 classes, but I note the warning on the first C++ page of the
 documentation:

 You should not create your own Foo subclasses. If you subclass this
 class and override a virtual method, the override may be ignored, as
 many generated method calls are de-virtualized to improve performance.
 

 I should be fine as long as I don't use any of the already defined
 member names shouldn't I?

 Bart
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---