summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-09-02 01:25:37 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-09-02 01:25:37 +0100
commit55c7a6d8211adcbfa053e7ac396774beb1022809 (patch)
tree110d06cd0e5eb231bcb857fb26b579d5b002ef1a
parentInitialize proxies once on start up (diff)
downloadicespider-55c7a6d8211adcbfa053e7ac396774beb1022809.tar.bz2
icespider-55c7a6d8211adcbfa053e7ac396774beb1022809.tar.xz
icespider-55c7a6d8211adcbfa053e7ac396774beb1022809.zip
No need to proxy getProxy through route handler now we have a core instance
-rw-r--r--icespider/compile/routeCompiler.cpp3
-rw-r--r--icespider/core/core.h6
-rw-r--r--icespider/core/irouteHandler.cpp6
-rw-r--r--icespider/core/irouteHandler.h8
4 files changed, 8 insertions, 15 deletions
diff --git a/icespider/compile/routeCompiler.cpp b/icespider/compile/routeCompiler.cpp
index 7f8fb38..6941872 100644
--- a/icespider/compile/routeCompiler.cpp
+++ b/icespider/compile/routeCompiler.cpp
@@ -268,6 +268,7 @@ namespace IceSpider {
fprintf(output, "// Standard headers.\n");
fprintf(output, "#include <irouteHandler.h>\n");
+ fprintf(output, "#include <core.h>\n");
fprintf(output, "#include <slicer/serializer.h>\n");
fprintf(output, "\n// Interface headers.\n");
@@ -399,7 +400,7 @@ namespace IceSpider {
if (proxies.find(proxyName) == proxies.end()) {
proxies[proxyName] = n;
fprintf(output, ",\n");
- fprintbf(4, output, "prx%d(getProxy<%s>(core))", n, boost::algorithm::replace_all_copy(proxyName, ".", "::"));
+ fprintbf(4, output, "prx%d(core->getProxy<%s>())", n, boost::algorithm::replace_all_copy(proxyName, ".", "::"));
n += 1;
}
}
diff --git a/icespider/core/core.h b/icespider/core/core.h
index 238f4ae..0a888a6 100644
--- a/icespider/core/core.h
+++ b/icespider/core/core.h
@@ -22,6 +22,12 @@ namespace IceSpider {
Ice::ObjectPrx getProxy(const char * type) const;
+ template<typename Interface>
+ typename Interface::ProxyType getProxy() const
+ {
+ return Interface::ProxyType::uncheckedCast(getProxy(typeid(Interface).name()));
+ }
+
MethodRoutes routes;
Ice::CommunicatorPtr communicator;
diff --git a/icespider/core/irouteHandler.cpp b/icespider/core/irouteHandler.cpp
index 2c33258..e096e9c 100644
--- a/icespider/core/irouteHandler.cpp
+++ b/icespider/core/irouteHandler.cpp
@@ -20,12 +20,6 @@ namespace IceSpider {
{
}
- Ice::ObjectPrx
- IRouteHandler::getProxy(const Core * core, const char * type) const
- {
- return core->getProxy(type);
- }
-
ContentTypeSerializer
IRouteHandler::getSerializer(const AcceptPtr & a, std::ostream & strm) const
{
diff --git a/icespider/core/irouteHandler.h b/icespider/core/irouteHandler.h
index 7a1635a..e75ec8f 100644
--- a/icespider/core/irouteHandler.h
+++ b/icespider/core/irouteHandler.h
@@ -35,14 +35,6 @@ namespace IceSpider {
boost::lexical_cast<std::string>(key));
}
- Ice::ObjectPrx getProxy(const Core *, const char *) const;
-
- template<typename Interface>
- typename Interface::ProxyType getProxy(const Core * core) const
- {
- return Interface::ProxyType::uncheckedCast(getProxy(core, typeid(Interface).name()));
- }
-
void addRouteSerializer(const MimeType &, StreamSerializerFactoryPtr);
void removeRouteSerializer(const MimeType &);
};