NAWA 0.9
Web Application Framework for C++
nawa::HandleRequestFunctionWrapper Class Reference

#include <nawa/RequestHandler/HandleRequestFunction.h>

Public Member Functions

virtual ~HandleRequestFunctionWrapper ()
 
 HandleRequestFunctionWrapper (HandleRequestFunction handleRequestFunction, void *reference=nullptr, DestructionCallbackFunction destructionCallback=DestructionCallbackFunction())
 
int operator() (nawa::Connection &connection) const
 

Detailed Description

A wrapper structure for a HandleRequestFunction which can store an additional reference pointer and a callback, which will be called on destruction. This allows nawarun to free memory consumed by an app as soon as it is not in use anymore (e.g., after being replaced in a hotswap operation).

Definition at line 40 of file HandleRequestFunction.h.

Constructor & Destructor Documentation

◆ ~HandleRequestFunctionWrapper()

virtual nawa::HandleRequestFunctionWrapper::~HandleRequestFunctionWrapper ( )
virtual

◆ HandleRequestFunctionWrapper()

nawa::HandleRequestFunctionWrapper::HandleRequestFunctionWrapper ( HandleRequestFunction  handleRequestFunction,
void *  reference = nullptr,
DestructionCallbackFunction  destructionCallback = DestructionCallbackFunction() 
)
explicit

Construct a wrapper for a HandleRequestFunction.

Parameters
handleRequestFunctionThe request handling function.
referenceAn arbitrary reference pointer which can be used as a hint during destruction.
destructionCallbackA function which will be called on destruction of the wrapper object, the reference pointer is passed to this function as a reference.

Definition at line 51 of file HandleRequestFunction.cpp.

Member Function Documentation

◆ operator()()

int nawa::HandleRequestFunctionWrapper::operator() ( nawa::Connection connection) const

Convenience operator which just runs the request handling function.

Parameters
connectionThe nawa::Connection object (parameter of the request handling function).
Returns
Return value of the request handling function.

Definition at line 57 of file HandleRequestFunction.cpp.


The documentation for this class was generated from the following files: