diff options
Diffstat (limited to 'project2/cgi/cgiAppEngine.h')
-rw-r--r-- | project2/cgi/cgiAppEngine.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/project2/cgi/cgiAppEngine.h b/project2/cgi/cgiAppEngine.h index 64f081d..b362ece 100644 --- a/project2/cgi/cgiAppEngine.h +++ b/project2/cgi/cgiAppEngine.h @@ -9,6 +9,7 @@ #include "viewHost.h" #include "transform.h" #include "xmlPresenter.h" +#include "presenterCache.h" #include "sessionContainer.h" #include <boost/intrusive_ptr.hpp> #include <boost/tuple/tuple.hpp> @@ -67,11 +68,14 @@ class CgiApplicationEngine : public ApplicationEngine, public TransformChainLink /// Base class for a stage that can be a response to the client class ResponseStage : public Stage { public: + typedef ANONORDEREDSTORAGEOF(PresenterCache) PresenterCaches; + ResponseStage(const CgiEnvironment * e, ScriptNodePtr root); virtual HttpHeaderPtr getHeader() const = 0; OutputOptionsPtr outputOptions; ScriptNodePtr root; + PresenterCaches caches; }; /// Stage implementation used to bootstrap the iteration process based on the CGI environment @@ -104,6 +108,17 @@ class CgiApplicationEngine : public ApplicationEngine, public TransformChainLink mutable MultiRowSetPresenterPtr presenter; }; + /// Stage to return previous cached output + class CacheHitStage : public virtual ResponseStage { + public: + CacheHitStage(const CgiEnvironment * e, ScriptNodePtr, PresenterCachePtr); + + virtual NextStage run(); + virtual HttpHeaderPtr getHeader() const; + protected: + PresenterCachePtr pc; + }; + /// The built-in fail-safe not found stage class DefaultNotFoundStage : public virtual ResponseStage { public: @@ -150,6 +165,7 @@ class CgiApplicationEngine : public ApplicationEngine, public TransformChainLink mutable NextStage currentStage; SessionPtr cursession; mutable std::ostream & IO; + mutable bool outputCachingActive; }; #endif |