[Live-devel] Public vs Protected of StopPlaying()

Ross Finlayson finlayson at live555.com
Sat Nov 22 22:48:28 PST 2008


>While writing code using the library I ran through a minor 
>compilation problem where the compiler would complain about member 
>function StopPlaying() being protected.
>
>The issue I got was causing by the library having class MediaSink 
>declares virtual member function StopPlaying() as public member. 
>However in derived class MultiFramedRTPSink it is being declared as 
>protected. Since the method is virtual I would have expected the 
>method being declared as public also in class MultiFramedRTPSink.

I generally like to declare subclass implementations of virtual 
functions as "private" (or "protected"), to encourage programmers to 
write code that's more generic - by using the base class whenever 
possible.  I'm not strict about this, though, and will gladly change 
the declaration of subclass implementations whenever someone 
complains, as you did.

Therefore, I have changed the declaration of "stopPlaying()" to 
"public" in "MultiFramedRTPSink".  It will appear in the next release 
of the code.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20081122/4af6ddf7/attachment.html>


More information about the live-devel mailing list