From ff124040623879bc48a0ba5cf06a841642adef53 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Mon, 30 Nov 2009 08:36:32 +0000 Subject: Fixes to the http client, httpd modules and memcached component to get the store and shopping cart test case working end to end. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@885349 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/modules/server/mod-cpp.hpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'sca-cpp/trunk/modules/server/mod-cpp.hpp') diff --git a/sca-cpp/trunk/modules/server/mod-cpp.hpp b/sca-cpp/trunk/modules/server/mod-cpp.hpp index cb24b76f6c..99b69a0d9f 100644 --- a/sca-cpp/trunk/modules/server/mod-cpp.hpp +++ b/sca-cpp/trunk/modules/server/mod-cpp.hpp @@ -34,6 +34,7 @@ #include "function.hpp" #include "list.hpp" #include "value.hpp" +#include "debug.hpp" #include "monad.hpp" #include "dynlib.hpp" #include "cache.hpp" @@ -52,12 +53,13 @@ namespace cpp { struct evalImplementation { const lib ilib; const ilambda impl; - evalImplementation(const lib& ilib, const ilambda& impl) : ilib(ilib), impl(impl) { + const list px; + evalImplementation(const lib& ilib, const ilambda& impl, const list& px) : ilib(ilib), impl(impl), px(px) { } const failable operator()(const value& func, const list& params) const { - httpd::logValue(cons(func, params), "expr"); - const failable val = impl(func, params); - httpd::logValue(content(val), "val"); + debug(cons(func, params), "modeval::cpp::evalImplementation::input"); + const failable val = impl(func, append(params, px)); + debug(content(val), "modeval::cpp::evalImplementation::result"); return val; } }; @@ -65,7 +67,7 @@ struct evalImplementation { /** * Read a C++ component implementation. */ -const failable readLatestImplementation(const std::string path) { +const failable readLatestImplementation(const std::string path, const list& px) { const failable ilib(dynlib(path)); if (!hasContent(ilib)) return mkfailure(reason(ilib)); @@ -73,14 +75,14 @@ const failable readLatestImplementation(const std::string const failable impl(dynlambda(value, list)>("eval", content(ilib))); if (!hasContent(impl)) return impl; - return ilambda(evalImplementation(content(ilib), content(impl))); + return ilambda(evalImplementation(content(ilib), content(impl), px)); } -const cached > readImplementation(const std::string& path) { - const lambda(std::string)> ri(readLatestImplementation); +const cached > readImplementation(const std::string& path, const list& px) { + const lambda(std::string, list)> ri(readLatestImplementation); const lambda ft(latestFileTime); const std::string p(path + dynlibExt); - return cached >(curry(ri, p), curry(ft, p)); + return cached >(curry(ri, p, px), curry(ft, p)); } } -- cgit v1.2.3