Overview
Features
Download
Documentation
Community
Add-Ons & Services

Adding Subsystem Options in Poco::Util::Application

Please post support and help requests here.

Adding Subsystem Options in Poco::Util::Application

Postby danielwidyanto » 17 Jan 2014, 06:26

Hi all,

I'm using Poco::Util::Application for my app's base class. I also have subsystem (subclass of Poco::Util::Subsystem) to be included, that has its own command line options. I've been tracking Poco::Util::Application, and I notice that there's no way the Poco::Util::Subsystem subclass options can be added into Poco::Util::Application.

Here's the stack trace of the Poco::Util::Application:
- App constructor
- Poco::Util::Application constructor
- setup()
- init(argc, argv)
- init(args)
- init()
- processOptions()
- defineOptions -> implemented in the App class
- Application::defineOptions(options) -> To call the subclass defineOptions(). However, the addSubclass() is not called yet. Hence there's no subclass' defineOptions() to be called.

I found it quite weird to call Application::instance().addSubclass() inside the App's defineOptions(). It should be called inside the App's initialize().

I'm using "poco-1.4.6p2", VC-2013 Express.
danielwidyanto
 
Posts: 2
Joined: 17 Jan 2014, 06:13

[CLOSED] Re: Adding Subsystem Options in Poco::Util::Applica

Postby danielwidyanto » 22 Jan 2014, 08:57

Nevermind..I've added constructor on my Poco::Util::Application subclass to add my custom subsystem.
danielwidyanto
 
Posts: 2
Joined: 17 Jan 2014, 06:13

Re: Adding Subsystem Options in Poco::Util::Application

Postby guenter » 22 Jan 2014, 10:10

And that, in fact, is how it's supposed to work.
guenter
 
Posts: 1138
Joined: 11 Jul 2006, 16:27
Location: Austria


Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests