SNode.C
Loading...
Searching...
No Matches
Route.h File Reference
Include dependency graph for Route.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  express::Route
 

Namespaces

namespace  express
 
namespace  express::dispatcher
 

Macros

#define DECLARE_ROUTE_REQUESTMETHOD(METHOD)
 

Macro Definition Documentation

◆ DECLARE_ROUTE_REQUESTMETHOD

#define DECLARE_ROUTE_REQUESTMETHOD (   METHOD)
Value:
Route& METHOD(const std::function<void(const std::shared_ptr<Request>&, const std::shared_ptr<Response>&)>& lambda) const; \
Route& METHOD(const std::function<void(const std::shared_ptr<Request>&, const std::shared_ptr<Response>&, Next&)>& lambda) const; \
template <typename... Lambdas> \
Route& METHOD(const std::function<void(const std::shared_ptr<Request>&, const std::shared_ptr<Response>&)>& lambda, \
Lambdas... lambdas) const; \
template <typename... Lambdas> \
Route& METHOD(const std::function<void(const std::shared_ptr<Request>&, const std::shared_ptr<Response>&, Next&)>& lambda, \
Lambdas... lambdas) const;

Definition at line 69 of file Route.h.

78 {
79
80 class Route {
81 public:
82 enum class StrictRouting { INHERIT, STRICT, LAX };
83
84 Route(const std::string& method, const std::string& relativeMountPath, const std::shared_ptr<Dispatcher>& dispatcher);
85
86 Route& setStrictRouting(bool strict = true);
87 const StrictRouting& getStrictRouting() const;
88
89 std::list<std::string> getRoute(const std::string& parentMountPath, bool strictRouting) const;
90
91 private:
92 Route();
93
94 bool dispatch(Controller& controller);
95
96 bool dispatch(Controller& controller, const std::string& parentMountPath);
97 bool dispatchNext(Controller& controller, const std::string& parentMountPath);
98
99 MountPoint mountPoint;
100 std::shared_ptr<Dispatcher> dispatcher;
101
102 StrictRouting strictRouting = StrictRouting::INHERIT;
103
104 public:
116
117 friend class dispatcher::RouterDispatcher;
118 friend class Dispatcher;
119 friend class RootRoute;
120 friend class Controller;
121 };
122
123} // namespace express
124
125#include "express/Route.hpp" // IWYU pragma: export
126
127#endif // EXPRESS_ROUTE_H
#define DECLARE_ROUTE_REQUESTMETHOD(METHOD)
Definition Route.h:69