VWeb/Includes/MiddleWare.h

16 lines
452 B
C
Raw Normal View History

#pragma once
#include <optional>
#include "Response.h"
#include "Request.h"
namespace VWeb {
typedef std::optional<Ref<Response>> PreMiddleWareReturn;
struct MiddleWare {
int Pos{0};
virtual PreMiddleWareReturn PreHandle(Request &) { return {}; }
virtual bool PostHandle(Request &, Response &) { return true; }
virtual void Shutdown(Request &, const Response &){};
bool operator<(const MiddleWare *rhs) const { return Pos < rhs->Pos; }
};
}