Function registerFilter

Synopsis

#include <lib/inc/drogon/HttpAppFramework.h>

template <typename T>
HttpAppFramework & registerFilter(const std::shared_ptr< T > &filterPtr)

Description

Register filter objects created and initialized by the user.

This method is similar to the above method.

Source

Lines 545-556 in lib/inc/drogon/HttpAppFramework.h.

template <typename T>
HttpAppFramework &registerFilter(const std::shared_ptr<T> &filterPtr)
{
    static_assert(std::is_base_of<HttpFilterBase, T>::value,
                  "Error! Only fitler objects can be registered here");
    static_assert(!T::isAutoCreation,
                  "Filters created and initialized "
                  "automatically by drogon cannot be "
                  "registered here");
    DrClassMap::setSingleInstance(filterPtr);
    return *this;
}





Add Discussion as Guest

Log in to DocsForge