Function getPlugin

Summary

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

(1) template <typename T>
    T * getPlugin()

(2) virtual PluginBase * getPlugin(const std::string &name)=0

Function overload

Synopsis

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

template <typename T>
T * getPlugin()

Description

Get the plugin object registered in the framework.

Note
This method is usually called after the framework runs. Calling this method in the initAndStart() method of plugins is also valid.

Mentioned in

Source

Lines 152-162 in lib/inc/drogon/HttpAppFramework.h.

template <typename T>
T *getPlugin()
{
    static_assert(IsPlugin<T>::value,
                  "The Template parameter must be a subclass of "
                  "PluginBase");
    assert(isRunning());
    static auto pluginPtr =
        dynamic_cast<T *>(getPlugin(T::classTypeName()));
    return pluginPtr;
}

Synopsis

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

virtual PluginBase * getPlugin(const std::string &name)=0

Description

Get the plugin object registered in the framework.

Parameters:

name - is the class name of the plugin.

Note
This method is usually called after the framework runs. Calling this method in the initAndStart() method of plugins is also valid.

Mentioned in

Source

Line 173 in lib/inc/drogon/HttpAppFramework.h.






Add Discussion as Guest

Log in to DocsForge