Overview
Features
Download
Documentation
Community
Add-Ons & Services

Application::initialize not virtual??

Please post support and help requests here.

Application::initialize not virtual??

Postby enkuklios » 22 Oct 2009, 06:42

Hello,

I just started using Poco and really like everything that it has, however I believe I found a bug on the Application class in the latest stable release.

Application::initialize(Application& self), uninitialize() and reinitialize(Application& self) are not virtual, but it is implied in both documentation and in code comments that they should be, having them virtual would make more sense as it gives an opportunity to load plugins using SharedLibrary and such inside of these functions.

Is this a bug, or am I not understanding the paradigm here?

Thank you very much.
Last edited by enkuklios on 22 Oct 2009, 16:40, edited 1 time in total.
enkuklios
 
Posts: 3
Joined: 22 Oct 2009, 06:37

Re: Application::initialize not virtual??

Postby guenter » 22 Oct 2009, 08:23

initialize() and uninitialize() are defined as virtual in Poco::Util::Subsystem, which is the base class for Application.
guenter
 
Posts: 1135
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Application::initialize not virtual??

Postby enkuklios » 22 Oct 2009, 16:39

Yes but they are non-virtual on the Application class, this means they can not be overridden by any class inheriting from Application. Is this the intended paradigm, that Application makes these interfaces concrete?
enkuklios
 
Posts: 3
Joined: 22 Oct 2009, 06:37

Re: Application::initialize not virtual??

Postby guenter » 22 Oct 2009, 16:47

A virtual function inherited from a base class always remains virtual, no matter whether the virtual keyword is specified in subclasses or not. So you can always override in any subclass of Application.
guenter
 
Posts: 1135
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Application::initialize not virtual??

Postby enkuklios » 22 Oct 2009, 17:27

Ok, thanks for the clarification, I made some test code and figured out i had a syntax error in my inheriting classes initialize() signature and thats why it obviously was not being called.

Thank you, sorry for the support Q on my lack of C++ skills hehe.
enkuklios
 
Posts: 3
Joined: 22 Oct 2009, 06:37


Return to Support

Who is online

Users browsing this forum: No registered users and 4 guests

cron