Function initialize

Synopsis

#include <lib/inc/drogon/plugins/Plugin.h>

void initialize()

Description

This method must be called by drogon.

Mentioned in

Source

Lines 46-69 in lib/inc/drogon/plugins/Plugin.h.

void initialize()
{
    if (status_ == PluginStatus::None)
    {
        status_ = PluginStatus::Initializing;
        for (auto dependency : dependencies_)
        {
            dependency->initialize();
        }
        initAndStart(config_);
        status_ = PluginStatus::Initialized;
        if (initializedCallback_)
            initializedCallback_(this);
    }
    else if (status_ == PluginStatus::Initialized)
    {
        // Do nothing;
    }
    else
    {
        LOG_FATAL << "There are a circular dependency within plugins.";
        abort();
    }
}





Add Discussion as Guest

Log in to DocsForge