DCL 4.0
Loading...
Searching...
No Matches
HttpServlet.h File Reference
#include <dcl/Object.h>
#include <dcl/Exception.h>
#include <dcl/HttpServerExtension.h>
#include <dcl/HttpHeader.h>

Go to the source code of this file.

Classes

class  HttpServletContext
class  HttpServlet

Macros

#define __DCL_HTTP_SERVLET_H__   20050530
#define HTTP_SERVLET_INSTANCE(ServletClass, Description)

Macro Definition Documentation

◆ __DCL_HTTP_SERVLET_H__

#define __DCL_HTTP_SERVLET_H__   20050530

Definition at line 2 of file HttpServlet.h.

◆ HTTP_SERVLET_INSTANCE

#define HTTP_SERVLET_INSTANCE ( ServletClass,
Description )

Definition at line 125 of file HttpServlet.h.

125#define HTTP_SERVLET_INSTANCE(ServletClass, Description) \
126static HttpServlet* __servlet__ = NULL; \
127static BOOL ModuleInitialize( \
128 const DCL_HTTP_SERVLET_CONFIG* pConfig, \
129 void* hErrorReport \
130 ) \
131{ \
132 __servlet__ = new ServletClass; \
133 if (!__servlet__) { \
134 pConfig->pSAPI->pfnReportError( \
135 hErrorReport, \
136 L"Out of Memory", \
137 13); \
138 return FALSE; \
139 } \
140 else { \
141 if (!HttpServlet::__initialize( \
142 __servlet__, \
143 pConfig, \
144 hErrorReport \
145 ) \
146 ) { \
147 delete __servlet__; \
148 __servlet__ = NULL; \
149 return FALSE; \
150 } \
151 } \
152 return TRUE; \
153} \
154\
155static BOOL ModuleCleanup( \
156 void* hErrorReport \
157 ) \
158{ \
159 BOOL bResult = HttpServlet::__cleanup( \
160 __servlet__, \
161 hErrorReport \
162 ); \
163 delete __servlet__; \
164 __servlet__ = NULL; \
165 return bResult; \
166} \
167\
168static BOOL ModuleHttpService( \
169 const DCL_HTTP_SERVLET_CONTEXT* pContext, \
170 void* hErrorReport \
171 ) \
172{ \
173 return HttpServlet::__httpService( \
174 __servlet__, \
175 pContext, \
176 hErrorReport \
177 ); \
178}\
179\
180extern "C" { \
181DCL_DSO_EXPORT \
182DCL_HTTP_SERVLET DCL_DSO_ENTRY_POINT = { \
183 sizeof(DCL_HTTP_SERVLET), \
184 DCL_VERSION, \
185 __T(__TIMESTAMP__), \
186 DCL_BUILD_FLAG, \
187 DCL_HTTP_SERVLET_MODULE, \
188 Description, \
189 DCL_HTTP_SERVER_VERSION, \
190 ModuleInitialize, \
191 ModuleCleanup, \
192 ModuleHttpService \
193}; \
194} \
195