8 #ifndef CPPCMS_APPLICATIONS_POOL_H
9 #define CPPCMS_APPLICATIONS_POOL_H
11 #include <cppcms/defs.h>
12 #include <booster/noncopyable.h>
13 #include <booster/hold_ptr.h>
14 #include <booster/intrusive_ptr.h>
51 virtual std::auto_ptr<application> operator()(
service &)
const = 0;
61 void mount(std::auto_ptr<factory> aps);
70 void mount(std::auto_ptr<factory> aps,
mount_point const &point);
91 get(
char const *h,
char const *s,
char const *path_info,std::string &match);
100 struct basic_app_data;
102 struct long_running_app_data;
113 std::auto_ptr<application> operator()(
service &s)
const
115 std::auto_ptr<application> app(
new T(s));
119 template<
typename T,
typename P1>
120 struct simple_factory1 :
public applications_pool::factory
122 simple_factory1(P1 p1) : p1_(p1) {}
124 std::auto_ptr<application> operator()(service &s)
const
126 std::auto_ptr<application> app(
new T(s,p1_));
130 template<
typename T,
typename P1,
typename P2>
131 struct simple_factory2 :
public applications_pool::factory
133 simple_factory2(P1 p1,P2 p2) : p1_(p1),p2_(p2) {}
136 std::auto_ptr<application> operator()(service &s)
const
138 std::auto_ptr<application> app(
new T(s,p1_,p2_));
153 std::auto_ptr<applications_pool::factory> f(
new details::simple_factory0<T>);
161 template<
typename T,
typename P1>
164 std::auto_ptr<applications_pool::factory> f(
new details::simple_factory1<T,P1>(p1));
172 template<
typename T,
typename P1,
typename P2>
175 std::auto_ptr<applications_pool::factory> f(
new details::simple_factory2<T,P1,P2>(p1,p2));
a base class for user application factories
Definition: applications_pool.h:47
This class represent the central event loop of the CppCMS applications.
Definition: service.h:59
std::auto_ptr< applications_pool::factory > applications_factory()
Definition: applications_pool.h:151
intrusive_ptr is the class taken as-is from boost.
Definition: intrusive_ptr.h:42
This class represents application's mount point or the rule on which specific application is selected...
Definition: mount_point.h:24
application class is the base class for all user created applications.
Definition: application.h:81
Application pool is the central class that holds user created applications.
Definition: applications_pool.h:41
This class makes impossible to copy any class derived from this one.
Definition: noncopyable.h:15