diff options
-rw-r--r-- | icespider/compile/routeCompiler.cpp | 2 | ||||
-rw-r--r-- | icespider/core/core.cpp | 2 | ||||
-rw-r--r-- | icespider/core/irouteHandler.cpp | 2 | ||||
-rw-r--r-- | icespider/core/irouteHandler.h | 4 |
4 files changed, 6 insertions, 4 deletions
diff --git a/icespider/compile/routeCompiler.cpp b/icespider/compile/routeCompiler.cpp index e2ab8a1..99771aa 100644 --- a/icespider/compile/routeCompiler.cpp +++ b/icespider/compile/routeCompiler.cpp @@ -294,7 +294,7 @@ namespace IceSpider { fprintbf(1, output, "// path: %s\n", r->path); fprintbf(1, output, "class %s : public IceSpider::IRouteHandler {\n", r->name); fprintbf(2, output, "public:\n"); - fprintbf(3, output, "%s() :\n", r->name); + fprintbf(3, output, "%s(const IceSpider::Core *) :\n", r->name); fprintbf(4, output, "IceSpider::IRouteHandler(IceSpider::HttpMethod::%s, \"%s\")", methodName, r->path); for (const auto & p : r->params) { if (p->hasUserSource) { diff --git a/icespider/core/core.cpp b/icespider/core/core.cpp index cb0c671..6a44523 100644 --- a/icespider/core/core.cpp +++ b/icespider/core/core.cpp @@ -11,7 +11,7 @@ namespace IceSpider { routes.resize(HttpMethod::OPTIONS + 1, {{ }}); // Initialize routes for (const auto & rp : AdHoc::PluginManager::getDefault()->getAll<RouteHandlerFactory>()) { - auto r = rp->implementation()->create(); + auto r = rp->implementation()->create(this); auto & mroutes = routes[r->method]; if (mroutes.size() <= r->pathElementCount()) { mroutes.resize(r->pathElementCount() + 1); diff --git a/icespider/core/irouteHandler.cpp b/icespider/core/irouteHandler.cpp index 172c77d..ca9cb94 100644 --- a/icespider/core/irouteHandler.cpp +++ b/icespider/core/irouteHandler.cpp @@ -2,7 +2,7 @@ #include "core.h" #include <factory.impl.h> -INSTANTIATEVOIDFACTORY(IceSpider::IRouteHandler); +INSTANTIATEFACTORY(IceSpider::IRouteHandler, const IceSpider::Core *); namespace IceSpider { IRouteHandler::IRouteHandler(HttpMethod m, const std::string & p) : diff --git a/icespider/core/irouteHandler.h b/icespider/core/irouteHandler.h index 4832bdb..ffbde36 100644 --- a/icespider/core/irouteHandler.h +++ b/icespider/core/irouteHandler.h @@ -10,6 +10,8 @@ #include <boost/lexical_cast.hpp> namespace IceSpider { + class Core; + class DLL_PUBLIC IRouteHandler : public Path { public: IRouteHandler(HttpMethod, const std::string & path); @@ -44,7 +46,7 @@ namespace IceSpider { void addRouteSerializer(const MimeType &, StreamSerializerFactoryPtr); void removeRouteSerializer(const MimeType &); }; - typedef AdHoc::Factory<IRouteHandler> RouteHandlerFactory; + typedef AdHoc::Factory<IRouteHandler, const Core *> RouteHandlerFactory; } #endif |