Re: [Cppcms-users] How to get attached applications?
Brought to you by:
artyom-beilis
|
From: sergey l. <ccp...@gm...> - 2012-10-20 09:15:40
|
Dear Artyom, thanks for quick reply!
Yes your approach is obviously but is it some method in cppcms to get
pointer of attached application (attached_app) and not creating member in
main application class and storing pointer in it?
Thanks in advance!
On Sat, Oct 20, 2012 at 1:01 PM, Artyom Beilis <art...@ya...> wrote:
> Obviously... keep a pointer on it?
>
> this->my_attached_app = new attached_app(service);
> attach(this->my_attached_app, "index", "{1}", "^(.*)$", 1);
>
> Artyom Beilis
> --------------
> CppCMS - C++ Web Framework: http://cppcms.com/
> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
>
> ------------------------------
> *From:* sergey lavrov <ccp...@gm...>
> *To:* cpp...@li...
> *Sent:* Saturday, October 20, 2012 10:25 AM
> *Subject:* [Cppcms-users] How to get attached applications?
>
> Dear All!
>
> How can I get attached application (attached_app) from main application
> (main_app)?
> I need to call some functions (for example attached_app::check())
> from attached application (attached_app) in main application
> (main_app) before redirect to another page or process further.
>
> For example my application consist of:
>
> int main() {
> ...
>
> service.applications_pool().mount(cppcms::applications_factory<main_app>());
> ...
> }
>
> bool attached_app::check() {
> return true;
> }
>
> main_app::main_app(cppcms::service &service) :
> cppcms::application(service) {
> ...
> attach(new attached_app(service), "index", "{1}", "^(.*)$", 1);
> ...
> }
>
> main_app::main(std::string url) {
> /* There I need to call attached_app::check() first to check user
> session variables and url before redirect to another page or
> process further. */
> }
>
> Thanks in advance!
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
|