rikitiki  v0.1.67
Build C++ web server modules that allow easy routing and deployment.
register.h
1 /* Copyright (C) 2012-2013 Justin Berger
2  The full license is available in the LICENSE file at the root of this project and is also available at http://opensource.org/licenses/MIT. */
3 
4 #pragma once
5 #include "connContext.h"
6 #include "../routing.h"
7 #include <rikitiki/apache/server.h>
8 
9 namespace rikitiki {
10  namespace apache {
11  template <typename T>
12  static int handler(request_rec *r);
13 
14  template <typename T>
15  static void register_hooks(apr_pool_t *p){
16  ap_hook_handler( handler<T>, NULL, NULL, APR_HOOK_MIDDLE);
17  }
18  }
19 }
20 
21 #include "register.tcc"
22 
23 #define RegisterApacheHandler(name, handler_t) \
24  module AP_MODULE_DECLARE_DATA name ##_module = { \
25  STANDARD20_MODULE_STUFF, \
26  NULL, \
27  NULL, \
28  NULL, \
29  NULL, \
30  NULL, \
31  rikitiki::apache::register_hooks<handler_t>, \
32  };
33 
34 #define RegisterApacheRoute(name, handler_t) \
35  RegisterApacheHandler(name, handler_t);
36